pci_bridge: manually destroy memory regions within PCIBridgeWindows
PATCH 1/1 pci_bridge: manually destroy memory regions within PCIBridgeWindows
The regions are destroyed and recreated on configuration space accesses. We need to destroy them before the containing PCIBridgeWindows object is freed.
--- hw/pci/pci_bridge.c | 6 ++++++ 1 file changed, 6 insertions(+)
hw/pci/pci_bridge.c +6 -0
@@ -219,6 +219,12 @@ static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w)static void pci_bridge_region_cleanup (PCIBridge *br,PCIBridgeWindows *w) { +object_unparent (OBJECT (&w->alias_io)); +object_unparent (OBJECT (&w->alias_mem)); +object_unparent (OBJECT (&w->alias_pref_mem)); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_LO ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_HI ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_MEM ]));g_free (w); }
Signature · 1 line
1.8.3.1
Quoted 7 lines · Paolo Bonzini
The regions are destroyed and recreated on configuration space accesses. We need to destroy them before the containing PCIBridgeWindows object is freed.
Reported-by Gonglei <[email protected]>Reported-by Knut Omang <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>
Regression in 2.1? Cc stable?
Quoted 23 lines
--- hw/pci/pci_bridge.c | 6 ++++++ 1 file changed, 6 insertions(+)hw/pci/pci_bridge.c +6
-0@@ -219,6 +219,12 @@ static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w)static void pci_bridge_region_cleanup (PCIBridge *br,PCIBridgeWindows *w) { +object_unparent (OBJECT (&w->alias_io)); +object_unparent (OBJECT (&w->alias_mem)); +object_unparent (OBJECT (&w->alias_pref_mem)); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_LO ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_HI ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_MEM ]));g_free (w); }Signature · 1 line
1.8.3.1
Il 20/08/2014 21:17, Michael S. Tsirkin ha scritto:
Quoted 33 lines · Paolo Bonzini
Quoted 7 lines
The regions are destroyed and recreated on configuration space accesses. We need to destroy them before the containing PCIBridgeWindows object is freed.
Reported-by Gonglei <[email protected]>Reported-by Knut Omang <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>Regression in 2.1? Cc stable?
Quoted 21 lines
--- hw/pci/pci_bridge.c | 6 ++++++ 1 file changed, 6 insertions(+)hw/pci/pci_bridge.c +6
-0@@ -219,6 +219,12 @@ static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w)static void pci_bridge_region_cleanup (PCIBridge *br,PCIBridgeWindows *w) { +object_unparent (OBJECT (&w->alias_io)); +object_unparent (OBJECT (&w->alias_mem)); +object_unparent (OBJECT (&w->alias_pref_mem)); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_LO ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_HI ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_MEM ]));g_free (w); }
Quoted 2 lines
Quoted 2 lines
Signature · 1 line
1.8.3.1
No, regression from yesterday.
Paolo
Michael S. Tsirkin
AppliedQuoted 7 lines · Paolo Bonzini
The regions are destroyed and recreated on configuration space accesses. We need to destroy them before the containing PCIBridgeWindows object is freed.
Reported-by Gonglei <[email protected]>Reported-by Knut Omang <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>
Applied, thanks!
Quoted 23 lines
--- hw/pci/pci_bridge.c | 6 ++++++ 1 file changed, 6 insertions(+)hw/pci/pci_bridge.c +6
-0@@ -219,6 +219,12 @@ static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w)static void pci_bridge_region_cleanup (PCIBridge *br,PCIBridgeWindows *w) { +object_unparent (OBJECT (&w->alias_io)); +object_unparent (OBJECT (&w->alias_mem)); +object_unparent (OBJECT (&w->alias_pref_mem)); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_LO ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_HI ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_MEM ]));g_free (w); }Signature · 1 line
1.8.3.1
Quoted 40 lines
-----Original Message-----
From: Paolo Bonzini [mailto:[email protected]] On Behalf Of Paolo Bonzini
Sent: Wednesday, August 20, 2014 11:50 PM
To: [email protected]
Cc: [email protected]; Gonglei (Arei); [email protected]; [email protected]
Subject: [PATCH]pci_bridge: manually destroy memory regions within PCIBridgeWindowsThe regions are destroyed and recreated on configuration space accesses. We need to destroy them before the containing PCIBridgeWindows object is freed.
Reported-by Gonglei <[email protected]>Reported-by Knut Omang <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>--- hw/pci/pci_bridge.c | 6 ++++++ 1 file changed, 6 insertions(+)hw/pci/pci_bridge.c +6
-1@@ -219,6 +219,12 @@ static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w)static void pci_bridge_region_cleanup (PCIBridge *br,PCIBridgeWindows *w) { +object_unparent (OBJECT (&w->alias_io)); +object_unparent (OBJECT (&w->alias_mem)); +object_unparent (OBJECT (&w->alias_pref_mem)); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_LO ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_HI ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_MEM ]));g_free (w); } --
Quoted 1 line
1.8.3.1
Best regards,
-Gonglei
Michael S. Tsirkin
AppliedQuoted 7 lines · Paolo Bonzini
The regions are destroyed and recreated on configuration space accesses. We need to destroy them before the containing PCIBridgeWindows object is freed.
Reported-by Gonglei <[email protected]>Reported-by Knut Omang <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>
Applied in my tree.
Quoted 23 lines
--- hw/pci/pci_bridge.c | 6 ++++++ 1 file changed, 6 insertions(+)hw/pci/pci_bridge.c +6
-0@@ -219,6 +219,12 @@ static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w)static void pci_bridge_region_cleanup (PCIBridge *br,PCIBridgeWindows *w) { +object_unparent (OBJECT (&w->alias_io)); +object_unparent (OBJECT (&w->alias_mem)); +object_unparent (OBJECT (&w->alias_pref_mem)); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_LO ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_IO_HI ])); +object_unparent (OBJECT (&w->alias_vga[QEMU_PCI_VGA_MEM ]));g_free (w); }Signature · 1 line
1.8.3.1