]> xenbits.xensource.com Git - qemu-xen-4.0-testing.git/commitdiff
fix offset of MSI-X memory mapped table.
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 5 Sep 2008 09:32:49 +0000 (10:32 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 5 Sep 2008 09:32:49 +0000 (10:32 +0100)
This patch fixes offset of MSI-X memory mapped table.

Current code does not set dev->msix->table_off variable.
The offset of MSI-X memory mapped table is treated as 0.
The wrong region is unmapped from guest physical memory space.
As a result, guest device driver can't access memory mapped resource.

The patch fixes this issue. My MegaRAID SAS assigned to guest domain
becomes working with the patch.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
hw/pt-msi.c

index 511eb56bc15b1b948d3ae724e8c731ffbf4142b5..c515c02b2c7a18701f6a8b460151c6f17d74fbcc 100644 (file)
@@ -313,7 +313,7 @@ int pt_msix_init(struct pt_dev *dev, int pos)
 
     table_off = pci_read_long(pd, pos + PCI_MSIX_TABLE);
     bar_index = dev->msix->bar_index = table_off & PCI_MSIX_BIR;
-    table_off &= table_off & ~PCI_MSIX_BIR;
+    table_off = dev->msix->table_off = table_off & ~PCI_MSIX_BIR;
     dev->msix->table_base = dev->pci_dev->base_addr[bar_index];
     PT_LOG("get MSI-X table bar base %llx\n",
            (unsigned long long)dev->msix->table_base);