From: Keir Fraser Date: Fri, 5 Sep 2008 10:18:20 +0000 (+0100) Subject: ioemu: fix offset of MSI-X memory-mapped table. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14111^2~39 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b95d528041324423fc91174913ec0d98dad75e6f;p=xen.git ioemu: fix 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. Signed-off-by: Yuji Shimada --- diff --git a/tools/ioemu/hw/pt-msi.c b/tools/ioemu/hw/pt-msi.c index 98e485e076..9ac0614915 100644 --- a/tools/ioemu/hw/pt-msi.c +++ b/tools/ioemu/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);