pci-assign: Fix MSI-X MMIO page registration
PATCH 1/1 pci-assign: Fix MSI-X MMIO page registration
The MSI-X page must start below the address that comes after the end of a region. Otherwise we risk to register it twice. This bug existed since day #1 of the MSI-X support and was now reveal by
memory.c:1201: memory_region_add_subregion_common: Assertion `!subregion->parent' failed.
--- hw/device-assignment.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/device-assignment.c +1 -1
@@ -246,7 +246,7 @@ static void assigned_dev_iomem_setup(PCIDevice *pci_dev, int region_num,/* deal with MSI-X MMIO page */ if (real_region->base_addr <= r_dev->msix_table_addr && - real_region->base_addr + real_region->size >= + real_region->base_addr + real_region->size > r_dev->msix_table_addr) {int offset = r_dev->msix_table_addr - real_region->base_addr;
Signature · 1 line
1.7.3.4
Quoted 16 lines · Jan Kiszka
The MSI-X page must start below the address that comes after the end of a region. Otherwise we risk to register it twice. This bug existed since day #1 of the MSI-X support and was now reveal by
memory.c:1201:
memory_region_add_subregion_common: Assertion `!subregion->parent' failed.Signed-off-by Jan Kiszka <[email protected]>--- hw/device-assignment.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/device-assignment.c +0
-0
hw/device-assignment.c static void assigned_dev_iomem_setup(PCIDevice *pci_dev, int region_num, · line 252
Quoted 8 lines
hw/device-assignment.c +1
-1@@ -246,7 +246,7 @@ static void assigned_dev_iomem_setup(PCIDevice *pci_dev, int region_num,/* deal with MSI-X MMIO page */ if (real_region->base_addr <= r_dev->msix_table_addr && - real_region->base_addr + real_region->size >= + real_region->base_addr + real_region->size > r_dev->msix_table_addr) {int offset = r_dev->msix_table_addr - real_region->base_addr;
Marcelo Tosatti
AppliedQuoted 10 lines · Jan Kiszka
The MSI-X page must start below the address that comes after the end of a region. Otherwise we risk to register it twice. This bug existed since day #1 of the MSI-X support and was now reveal by
memory.c:1201:
memory_region_add_subregion_common: Assertion `!subregion->parent' failed.Signed-off-by Jan Kiszka <[email protected]>--- hw/device-assignment.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.