Skip to contentSkip to conversation

pci-assign: Fix MSI-X MMIO page registration

PATCH Applied Jan Kiszka 3 participants 3 messages Oct 12, 2011 – Oct 19, 2011 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

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
index 054b059..11efd16 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw
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.

---
 hw/device-assignment.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/device-assignment.c +0 -0
index 054b059..11efd16 100644

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;
 
#2 lore raw
In reply to Jan Kiszka
Quoted 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.

---
 hw/device-assignment.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.