Patchwork [v2,9/9] msix: clear not only INTA, but all INTx when MSI-X is enabled.

login
register
mail settings
Submitter Isaku Yamahata
Date Sept. 8, 2010, 7:39 a.m.
Message ID <26ae0d1004af68fb5ec5f7b00823ec6a623a0111.1283931134.git.yamahata@valinux.co.jp>
Download mbox | patch
Permalink /patch/64110/
State New
Headers show

Comments

Isaku Yamahata - Sept. 8, 2010, 7:39 a.m.
clear not only INTA, but all INTx when MSI-X is enabled.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/msix.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
Michael S. Tsirkin - Sept. 8, 2010, 10:33 a.m.
On Wed, Sep 08, 2010 at 04:39:42PM +0900, Isaku Yamahata wrote:
> clear not only INTA, but all INTx when MSI-X is enabled.
> 
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

Nod. This makes sense.

> ---
>  hw/msix.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/msix.c b/hw/msix.c
> index 7ce63eb..b202ff7 100644
> --- a/hw/msix.c
> +++ b/hw/msix.c
> @@ -158,6 +158,7 @@ void msix_write_config(PCIDevice *dev, uint32_t addr,
>  {
>      unsigned enable_pos = dev->msix_cap + MSIX_CONTROL_OFFSET;
>      int vector;
> +    int i;
>  
>      if (!range_covers_byte(addr, len, enable_pos)) {
>          return;
> @@ -167,7 +168,9 @@ void msix_write_config(PCIDevice *dev, uint32_t addr,
>          return;
>      }
>  
> -    qemu_set_irq(dev->irq[0], 0);
> +    for (i = 0; i < PCI_NUM_PINS; ++i) {
> +        qemu_set_irq(dev->irq[i], 0);
> +    }
>  
>      if (msix_function_masked(dev)) {
>          return;
> -- 
> 1.7.1.1

Patch

diff --git a/hw/msix.c b/hw/msix.c
index 7ce63eb..b202ff7 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -158,6 +158,7 @@  void msix_write_config(PCIDevice *dev, uint32_t addr,
 {
     unsigned enable_pos = dev->msix_cap + MSIX_CONTROL_OFFSET;
     int vector;
+    int i;
 
     if (!range_covers_byte(addr, len, enable_pos)) {
         return;
@@ -167,7 +168,9 @@  void msix_write_config(PCIDevice *dev, uint32_t addr,
         return;
     }
 
-    qemu_set_irq(dev->irq[0], 0);
+    for (i = 0; i < PCI_NUM_PINS; ++i) {
+        qemu_set_irq(dev->irq[i], 0);
+    }
 
     if (msix_function_masked(dev)) {
         return;