From 0dd77a196931380c2588f83ed662e8826cfde9b2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 5 Sep 2008 10:32:49 +0100 Subject: [PATCH] fix offset of MSI-X memory mapped table. 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 (cherry picked from commit 5c3b16ef00b18d0c43574060ef124b4c52b2e998) --- hw/pt-msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pt-msi.c b/hw/pt-msi.c index 511eb56b..c515c02b 100644 --- a/hw/pt-msi.c +++ b/hw/pt-msi.c @@ -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); -- 2.39.5