qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vfio-user: Do not delete the subregion
@ 2025-10-10  9:34 Akihiko Odaki
  2025-10-10  9:54 ` John Levon
  0 siblings, 1 reply; 3+ messages in thread
From: Akihiko Odaki @ 2025-10-10  9:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Williamson, Cédric Le Goater, Paolo Bonzini,
	Daniel P. Berrangé, Eduardo Habkost, Peter Xu,
	David Hildenbrand, Philippe Mathieu-Daudé, Richard Henderson,
	Helge Deller, Marc-André Lureau, Michael S. Tsirkin,
	Gerd Hoffmann, John Snow, qemu-block, Keith Busch, Klaus Jensen,
	Jesper Devantier, Marcel Apfelbaum, Nicholas Piggin, qemu-ppc,
	John Levon, Thanos Makatos, Yanan Wang, BALATON Zoltan,
	Jiaxun Yang, Daniel Henrique Barboza, David Gibson,
	Harsh Prateek Bora, Alexey Kardashevskiy, Alex Bennée,
	Fabiano Rosas, Thomas Huth, Laurent Vivier, Peter Maydell,
	Aurelien Jarno, Aleksandar Rikalo, Max Filippov,
	Hervé Poussineau, Mark Cave-Ayland, Artyom Tarasenko,
	Akihiko Odaki

Removing the PBA memory region from its container in
vfio_user_msix_teardown() is semantically incorrect as the reference to
the region is already deleted when the function is called.

The operation is unnecessary in the first place since the PCI code
removes all BARs during unrealization, so stop removing the PBA memory
region in vfio_user_msix_teardown().

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
---
 hw/vfio-user/pci.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c
index b53ed3b456f9..1a3741a29a1a 100644
--- a/hw/vfio-user/pci.c
+++ b/hw/vfio-user/pci.c
@@ -74,12 +74,6 @@ static void vfio_user_msix_setup(VFIOPCIDevice *vdev)
 
 static void vfio_user_msix_teardown(VFIOPCIDevice *vdev)
 {
-    MemoryRegion *mr, *sub;
-
-    mr = vdev->bars[vdev->msix->pba_bar].mr;
-    sub = vdev->msix->pba_region;
-    memory_region_del_subregion(mr, sub);
-
     g_free(vdev->msix->pba_region);
     vdev->msix->pba_region = NULL;
 }

---
base-commit: 94474a7733a57365d5a27efc28c05462e90e8944
change-id: 20251010-vfio-af834e5f3807

Best regards,
--  
Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-10 10:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-10  9:34 [PATCH] vfio-user: Do not delete the subregion Akihiko Odaki
2025-10-10  9:54 ` John Levon
2025-10-10  9:58   ` Akihiko Odaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).