From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105568778373.65599257753286; Wed, 17 Sep 2025 03:39:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypYw-0000Ru-92; Wed, 17 Sep 2025 06:38:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYr-0000Mx-Ub; Wed, 17 Sep 2025 06:38:54 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYp-00074B-7S; Wed, 17 Sep 2025 06:38:53 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAZ099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:32:56 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=jD8xXCxKpQezlTUVEU/kFhHTu8Hn9yOq/MDXRMgQpcc=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105176; v=1; b=o1VexklQyWKJ2rNsvAOh3/KSWkheh8m1g1/WMhy88XinniJDifD194rHWkONKMN4 lbSM8iBx+M4mYKFhLnRrJ854S1uO62PsMeoHgZOLdXGwpUUBk0LvKLA5MpPqOiwd GUh7ueayJLdCVr38FH9XyCVTJdmSgZ8RDKJIAZKDSzF1/TRYeeVgbW4/boyEyffH ImuKc5hQ19/Hj/DJMRxnRh1sOfehGuBNA4DKqo1c+jOZix1UIsVGfI8oRpOePEni 5rYWUuj+7zajfPwOHKOADaZ2oC1gI8SvRguqqz9UElyATev5WFRfAZwsSZDT2gHI f9LrdC7gARGYK44/UjCgkw== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:47 +0900 Subject: [PATCH 01/14] hw/pci-bridge: Do not assume immediate MemoryRegion finalization MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-1-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105570441116600 When updating memory mappings, pci_bridge_update_mappings() performed the following operations: 1. Start a transaction 2. Delete the subregions from the container 3. Unparent the subregions 4. Initialize the subregions 5. End the transaction This assumes the old subregion instances are finalized immediately after 3, but it is not true; the finalization is delayed until 5. Remove the assumption by using functions to dynamically update MemoryRegions. Signed-off-by: Akihiko Odaki --- include/hw/pci/pci.h | 1 + hw/pci/pci.c | 2 +- hw/pci/pci_bridge.c | 96 ++++++++++++++++++++++++++++--------------------= ---- 3 files changed, 54 insertions(+), 45 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 6b7d3ac8a361..d0bd214b4e11 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -256,6 +256,7 @@ void pci_register_bar(PCIDevice *pci_dev, int region_nu= m, uint8_t attr, MemoryRegion *memory); void pci_register_vga(PCIDevice *pci_dev, MemoryRegion *mem, MemoryRegion *io_lo, MemoryRegion *io_hi); +void pci_update_vga(PCIDevice *pci_dev); void pci_unregister_vga(PCIDevice *pci_dev); pcibus_t pci_get_bar_addr(PCIDevice *pci_dev, int region_num); =20 diff --git a/hw/pci/pci.c b/hw/pci/pci.c index c70b5ceebaf1..516029f66cda 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1521,7 +1521,7 @@ void pci_register_bar(PCIDevice *pci_dev, int region_= num, } } =20 -static void pci_update_vga(PCIDevice *pci_dev) +void pci_update_vga(PCIDevice *pci_dev) { uint16_t cmd; =20 diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c index 76255c4cd892..240d0f904de9 100644 --- a/hw/pci/pci_bridge.c +++ b/hw/pci/pci_bridge.c @@ -145,11 +145,10 @@ pcibus_t pci_bridge_get_limit(const PCIDevice *bridge= , uint8_t type) return limit; } =20 -static void pci_bridge_init_alias(PCIBridge *bridge, MemoryRegion *alias, - uint8_t type, const char *name, - MemoryRegion *space, - MemoryRegion *parent_space, - bool enabled) +static void pci_bridge_update_alias(PCIBridge *bridge, bool init, + MemoryRegion *alias, uint8_t type, + const char *name, MemoryRegion *space, + MemoryRegion *parent_space, bool enabl= ed) { PCIDevice *bridge_dev =3D PCI_DEVICE(bridge); pcibus_t base =3D pci_bridge_get_base(bridge_dev, type); @@ -158,25 +157,37 @@ static void pci_bridge_init_alias(PCIBridge *bridge, = MemoryRegion *alias, * Apparently no way to do this with existing memory APIs. */ pcibus_t size =3D enabled && limit >=3D base ? limit + 1 - base : 0; =20 - memory_region_init_alias(alias, OBJECT(bridge), name, space, base, siz= e); + if (init) { + memory_region_init_alias(alias, OBJECT(bridge), name, space, base,= size); + } else { + memory_region_set_size(alias, size); + memory_region_set_alias_offset(alias, base); + } + memory_region_add_subregion_overlap(parent_space, base, alias, 1); } =20 -static void pci_bridge_init_vga_aliases(PCIBridge *br, PCIBus *parent, - MemoryRegion *alias_vga) +static void pci_bridge_update_vga_aliases(PCIBridge *br, bool init, + PCIBus *parent, + MemoryRegion *alias_vga) { PCIDevice *pd =3D PCI_DEVICE(br); uint16_t brctl =3D pci_get_word(pd->config + PCI_BRIDGE_CONTROL); =20 - memory_region_init_alias(&alias_vga[QEMU_PCI_VGA_IO_LO], OBJECT(br), - "pci_bridge_vga_io_lo", &br->address_space_io, - QEMU_PCI_VGA_IO_LO_BASE, QEMU_PCI_VGA_IO_LO_S= IZE); - memory_region_init_alias(&alias_vga[QEMU_PCI_VGA_IO_HI], OBJECT(br), - "pci_bridge_vga_io_hi", &br->address_space_io, - QEMU_PCI_VGA_IO_HI_BASE, QEMU_PCI_VGA_IO_HI_S= IZE); - memory_region_init_alias(&alias_vga[QEMU_PCI_VGA_MEM], OBJECT(br), - "pci_bridge_vga_mem", &br->address_space_mem, - QEMU_PCI_VGA_MEM_BASE, QEMU_PCI_VGA_MEM_SIZE); + if (init) { + memory_region_init_alias(&alias_vga[QEMU_PCI_VGA_IO_LO], OBJECT(br= ), + "pci_bridge_vga_io_lo", &br->address_spac= e_io, + QEMU_PCI_VGA_IO_LO_BASE, + QEMU_PCI_VGA_IO_LO_SIZE); + memory_region_init_alias(&alias_vga[QEMU_PCI_VGA_IO_HI], OBJECT(br= ), + "pci_bridge_vga_io_hi", &br->address_spac= e_io, + QEMU_PCI_VGA_IO_HI_BASE, + QEMU_PCI_VGA_IO_HI_SIZE); + memory_region_init_alias(&alias_vga[QEMU_PCI_VGA_MEM], OBJECT(br), + "pci_bridge_vga_mem", &br->address_space_= mem, + QEMU_PCI_VGA_MEM_BASE, + QEMU_PCI_VGA_MEM_SIZE); + } =20 if (brctl & PCI_BRIDGE_CTL_VGA) { pci_register_vga(pd, &alias_vga[QEMU_PCI_VGA_MEM], @@ -185,33 +196,33 @@ static void pci_bridge_init_vga_aliases(PCIBridge *br= , PCIBus *parent, } } =20 -static void pci_bridge_region_init(PCIBridge *br) +static void pci_bridge_region_update(PCIBridge *br, bool init) { PCIDevice *pd =3D PCI_DEVICE(br); PCIBus *parent =3D pci_get_bus(pd); PCIBridgeWindows *w =3D &br->windows; uint16_t cmd =3D pci_get_word(pd->config + PCI_COMMAND); =20 - pci_bridge_init_alias(br, &w->alias_pref_mem, - PCI_BASE_ADDRESS_MEM_PREFETCH, - "pci_bridge_pref_mem", - &br->address_space_mem, - parent->address_space_mem, - cmd & PCI_COMMAND_MEMORY); - pci_bridge_init_alias(br, &w->alias_mem, - PCI_BASE_ADDRESS_SPACE_MEMORY, - "pci_bridge_mem", - &br->address_space_mem, - parent->address_space_mem, - cmd & PCI_COMMAND_MEMORY); - pci_bridge_init_alias(br, &w->alias_io, - PCI_BASE_ADDRESS_SPACE_IO, - "pci_bridge_io", - &br->address_space_io, - parent->address_space_io, - cmd & PCI_COMMAND_IO); - - pci_bridge_init_vga_aliases(br, parent, w->alias_vga); + pci_bridge_update_alias(br, init, &w->alias_pref_mem, + PCI_BASE_ADDRESS_MEM_PREFETCH, + "pci_bridge_pref_mem", + &br->address_space_mem, + parent->address_space_mem, + cmd & PCI_COMMAND_MEMORY); + pci_bridge_update_alias(br, init, &w->alias_mem, + PCI_BASE_ADDRESS_SPACE_MEMORY, + "pci_bridge_mem", + &br->address_space_mem, + parent->address_space_mem, + cmd & PCI_COMMAND_MEMORY); + pci_bridge_update_alias(br, init, &w->alias_io, + PCI_BASE_ADDRESS_SPACE_IO, + "pci_bridge_io", + &br->address_space_io, + parent->address_space_io, + cmd & PCI_COMMAND_IO); + + pci_bridge_update_vga_aliases(br, init, parent, w->alias_vga); } =20 static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w) @@ -237,14 +248,11 @@ static void pci_bridge_region_cleanup(PCIBridge *br, = PCIBridgeWindows *w) =20 void pci_bridge_update_mappings(PCIBridge *br) { - PCIBridgeWindows *w =3D &br->windows; - /* Make updates atomic to: handle the case of one VCPU updating the br= idge * while another accesses an unaffected region. */ memory_region_transaction_begin(); - pci_bridge_region_del(br, w); - pci_bridge_region_cleanup(br, w); - pci_bridge_region_init(br); + pci_bridge_region_del(br, &br->windows); + pci_bridge_region_update(br, false); memory_region_transaction_commit(); } =20 @@ -386,7 +394,7 @@ void pci_bridge_initfn(PCIDevice *dev, const char *type= name) memory_region_init(&br->address_space_io, OBJECT(br), "pci_bridge_io", 4 * GiB); address_space_init(&br->as_io, &br->address_space_io, "pci_bridge_pci_= io"); - pci_bridge_region_init(br); + pci_bridge_region_update(br, true); QLIST_INIT(&sec_bus->child); QLIST_INSERT_HEAD(&parent->child, sec_bus, sibling); =20 --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105402416153.41601906238373; Wed, 17 Sep 2025 03:36:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypUh-0002RN-9o; Wed, 17 Sep 2025 06:34:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUQ-0002Hj-Dt; Wed, 17 Sep 2025 06:34:20 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUC-0005uX-0Q; Wed, 17 Sep 2025 06:34:15 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAa099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:32:56 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=z5aIFWflp7k8WS0CLunYLNy2ZUWd6d/N8M5iSX1wzX4=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105177; v=1; b=JlKWNHSxe8u/hAcybElW0iVXcXr6GRj4NDqgUKRQ8yurKVlfJ6FJDhfBnHwK7mSb Galv9ZoO8d7Knq257MVhjY1RZvZCdB1vD/8fQpMngOLbcxGh5Hq4GPhmIhZZ+HGm Sd0mdeDw0nsBp0iZHnrrYKWW4JleEoCFYd4EnutWYnMOOZhr4N8A39VnK3WrDq1s m/Bkw6fhM9TjK4u2I/P7oUp7FWUOtKI6wugintp0mluIUUbFM4JwJtV/4bVmfB4q xZsPQoJi5Bh6Wxz8/Mm/Bop/RXTIve9qWMNr8GlkjCvG937S7Mlqw2gJOQphwtwU XrgAV2BaWFuiH1G+ic1tmg== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:48 +0900 Subject: [PATCH 02/14] qdev: Automatically delete memory subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-2-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105404665116600 It is a common requirement of qdev to delete memory subregions to hide them from address spaces during unrealization. pci automatically deletes the IO subregions, but this process is manually implemented in other places, which is tedious and error-prone. Implement the logic to delete subregions in qdev to cover all devices. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + include/hw/qdev-core.h | 1 + hw/core/qdev.c | 14 ++++++++++++++ stubs/memory.c | 9 +++++++++ stubs/meson.build | 1 + 5 files changed, 26 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8147fff3523e..4665f0a4b7a5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3212,6 +3212,7 @@ F: include/system/memory.h F: include/system/ram_addr.h F: include/system/ramblock.h F: include/system/memory_mapping.h +F: stubs/memory.c F: system/dma-helpers.c F: system/ioport.c F: system/memory.c diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 530f3da70218..8f443d5f8ea5 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -526,6 +526,7 @@ bool qdev_realize_and_unref(DeviceState *dev, BusState = *bus, Error **errp); * - unrealize any child buses by calling qbus_unrealize() * (this will recursively unrealize any devices on those buses) * - call the unrealize method of @dev + * - remove @dev from memory * * The device can then be freed by causing its reference count to go * to zero. diff --git a/hw/core/qdev.c b/hw/core/qdev.c index f60022617687..8fdf6774f87e 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -451,6 +451,17 @@ static bool check_only_migratable(Object *obj, Error *= *errp) return true; } =20 +static int del_memory_region(Object *child, void *opaque) +{ + MemoryRegion *mr =3D (MemoryRegion *)object_dynamic_cast(child, TYPE_M= EMORY_REGION); + + if (mr && mr->container) { + memory_region_del_subregion(mr->container, mr); + } + + return 0; +} + static void device_set_realized(Object *obj, bool value, Error **errp) { DeviceState *dev =3D DEVICE(obj); @@ -582,6 +593,7 @@ static void device_set_realized(Object *obj, bool value= , Error **errp) if (dc->unrealize) { dc->unrealize(dev); } + object_child_foreach(OBJECT(dev), del_memory_region, NULL); dev->pending_deleted_event =3D true; DEVICE_LISTENER_CALL(unrealize, Reverse, dev); } @@ -606,6 +618,8 @@ post_realize_fail: } =20 fail: + object_child_foreach(OBJECT(dev), del_memory_region, NULL); + error_propagate(errp, local_err); if (unattached_parent) { /* diff --git a/stubs/memory.c b/stubs/memory.c new file mode 100644 index 000000000000..9c36531ae542 --- /dev/null +++ b/stubs/memory.c @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "qemu/osdep.h" +#include "system/memory.h" + +void memory_region_del_subregion(MemoryRegion *mr, + MemoryRegion *subregion) +{ +} diff --git a/stubs/meson.build b/stubs/meson.build index cef046e6854d..b4df4e60a1af 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -95,5 +95,6 @@ if have_system or have_user =20 # Also included in have_system for tests/unit/test-qdev-global-props stub_ss.add(files('hotplug-stubs.c')) + stub_ss.add(files('memory.c')) stub_ss.add(files('sysbus.c')) endif --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105391868427.8069929021874; Wed, 17 Sep 2025 03:36:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypUh-0002Rk-Kz; Wed, 17 Sep 2025 06:34:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUQ-0002Hi-Dn; Wed, 17 Sep 2025 06:34:20 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypU9-0005uT-I8; Wed, 17 Sep 2025 06:34:14 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAb099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:32:57 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=3cGH6b5E85/I0U4om6lK9pPVs4VMPnqongUbGQsfkaQ=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105177; v=1; b=u0Lh+6q7BWlB/CsS/jfNs3jm+V1w+T7P3mvjZfu/wqUfBzpcD1Fkw0YsbjghR594 tQh+sIookvrhlebSbkdEBhjQctfbQza6ey9YUCtiIr617x8sxklh2rFVIt0jQy/2 Bq7X+loIp1wbxBjZHHuycZOrNUNMC7ahU9sjN9nQIa4nXG3WSGLBUCoimaOGNqB6 Am5XXaBh7WAY1XyeIfTF0G+wfRYrqFuieyucvUaLY1GHtCFqKLOVEBN6Zk+iIXsJ tPmGLl1s3E+7TUS4ZkaAYNNpXxb3UPD6HEd4P77feCqwoDdW0UpFj1G7Esjl0jd9 6vcAIvutpnVNZwtikbQi8w== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:49 +0900 Subject: [PATCH 03/14] vfio-user: Do not delete the subregion MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-3-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105394244116600 It is no longer necessary. Signed-off-by: Akihiko Odaki --- 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 be71c777291f..0b6c6a1c5ed3 100644 --- a/hw/vfio-user/pci.c +++ b/hw/vfio-user/pci.c @@ -73,12 +73,6 @@ static void vfio_user_msix_setup(VFIOPCIDevice *vdev) =20 static void vfio_user_msix_teardown(VFIOPCIDevice *vdev) { - MemoryRegion *mr, *sub; - - mr =3D vdev->bars[vdev->msix->pba_bar].mr; - sub =3D vdev->msix->pba_region; - memory_region_del_subregion(mr, sub); - g_free(vdev->msix->pba_region); vdev->msix->pba_region =3D NULL; } --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105662140540.3032689766553; Wed, 17 Sep 2025 03:41:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypYu-0000QU-Tw; Wed, 17 Sep 2025 06:38:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYr-0000MZ-I0; Wed, 17 Sep 2025 06:38:53 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYp-000745-6s; Wed, 17 Sep 2025 06:38:53 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAc099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:32:57 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=eeuVsJCDwKbW8icJDfICufxGLQvTBPTzkETbuI6aCMQ=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105178; v=1; b=gGMLB0+BIw2Kv/bqUTlcsGa4i1idjt+iTjbPDudd9T0r5QJ4PRTr6l95rjenSUOf zCkyYSnzNrKsfzVjB62Jg1g3ikAcvIPo/RCBWnQdXAf/UINc0bf8WBZhRy9E7KIF WbZwHZe4QxeS7DgHJSo0tiIQtqU8ya0mGTATKO0txkICkkLyu0P83GkM2H303qZK Vd5+SD1e8UAb50ikisq75hJTk7w1heGQaqVXwbD0B3D630RpYizGXwigrEIiliKq k8iOM0BK27MQCiAQPh9SJPm1S5h5VO4vEDx3FBBc0Dzkw1mtY/Zzp7p/dwUGkXFB S7xtFZS93xU5C3K+KoSl9Q== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:50 +0900 Subject: [PATCH 04/14] hw/char/diva-gsp: Do not delete the subregion MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-4-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105663436116600 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/char/diva-gsp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/char/diva-gsp.c b/hw/char/diva-gsp.c index e1f0713cb794..1ae472e879b5 100644 --- a/hw/char/diva-gsp.c +++ b/hw/char/diva-gsp.c @@ -63,7 +63,6 @@ static void diva_pci_exit(PCIDevice *dev) for (i =3D 0; i < pci->ports; i++) { s =3D pci->state + i; qdev_unrealize(DEVICE(s)); - memory_region_del_subregion(&pci->membar, &s->io); g_free(pci->name[i]); } qemu_free_irqs(pci->irqs, pci->ports); --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105337560797.6960845001146; Wed, 17 Sep 2025 03:35:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypUj-0002S9-AL; Wed, 17 Sep 2025 06:34:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUQ-0002Hr-GK; Wed, 17 Sep 2025 06:34:20 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUC-0005uc-0T; Wed, 17 Sep 2025 06:34:15 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAd099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:32:58 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=z/x+oUtoEfRpX+IwyYPhXBXqVyl2wVT8koXCpnykol8=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105178; v=1; b=lmOQlNxCVJSnfYRKuK1iGuhSgTmgoSeUm2IFjI5rhPQ+S148+W2wMVG8feW5Eba/ 8a4u4/5sbD7OOd7jGInp2HBYVTcvf2ejKXD++vG41Z4/JImEggRnBn3hMoL1CrjO wze75fqNSgPGW6z2T/EskQAb5ksb1ZeefzVxs3aKdR+Q81RH5Rdd9t6EvLhmUmh1 m+xwbSs4JJ6cvWFvNz5PxixoXdQwWYZ7USWbtnSVKA/vGJgr31YO59F1/PE28poO sBRH3H3pEYRI70EszQI7Br0GWFTp37QY36tOiGMzOAk/47r1FTpOivxRw5ySOakg nDUFyi+95e+eXKc4TyfqNQ== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:51 +0900 Subject: [PATCH 05/14] hw/char/serial-pci-multi: Do not delete the subregion MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-5-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105339679116600 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/char/serial-pci-multi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial-pci-multi.c index 13df272691a6..3132ca90cebf 100644 --- a/hw/char/serial-pci-multi.c +++ b/hw/char/serial-pci-multi.c @@ -57,7 +57,6 @@ static void multi_serial_pci_exit(PCIDevice *dev) for (i =3D 0; i < pci->ports; i++) { s =3D pci->state + i; qdev_unrealize(DEVICE(s)); - memory_region_del_subregion(&pci->iobar, &s->io); g_free(pci->name[i]); } } --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175810535231394.90360852282663; Wed, 17 Sep 2025 03:35:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypUi-0002S1-D3; Wed, 17 Sep 2025 06:34:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUQ-0002Ho-Fj; Wed, 17 Sep 2025 06:34:20 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUC-0005ua-0V; Wed, 17 Sep 2025 06:34:15 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAe099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:32:58 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=TnkAVUPt94jHFzYRxW+Zo8oRA9b9oUhjR9/nHExe2Gw=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105179; v=1; b=m92Kwxu8y5u3IRUedE++PGryWmeMkfRVBj8SPpghegwJNw61CkYDRdayYlxhcpNR GcPX4zzT0kd23DWWjg5/PtMHX/BZLpPy1yIJcAuYjaOHoS/L2O3rh0AT8xw8ek04 ysBO9kqYsRYadaMAaOS2LB15i/FhkI/3ctAtO3XCf2AUTaQcRnUVdzE1Nirw7yCY pQ6tHzZg9cex1wm1cxDwvDxF7a4Vi1obktoloXT36q1mKeeFXy41sbRYTIpIZkp+ /UlYIQcKWWOydK3rpVn+WPBdNVsMuNjoI5iCCtYq4pOX57B5baQE3Bh4wNe++KoN LiVWAVVXJ0kziWNQBQlpXw== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:52 +0900 Subject: [PATCH 06/14] secondary-vga: Do not delete the subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-6-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105353680116600 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/display/vga-pci.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index b81f7fd2d0fd..90b4545d3821 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -307,14 +307,6 @@ static void pci_secondary_vga_exit(PCIDevice *dev) VGACommonState *s =3D &d->vga; =20 graphic_console_close(s->con); - memory_region_del_subregion(&d->mmio, &d->mrs[0]); - memory_region_del_subregion(&d->mmio, &d->mrs[1]); - if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) { - memory_region_del_subregion(&d->mmio, &d->mrs[2]); - } - if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_EDID)) { - memory_region_del_subregion(&d->mmio, &d->mrs[3]); - } } =20 static void pci_secondary_vga_init(Object *obj) --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105646232502.30091945715833; Wed, 17 Sep 2025 03:40:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypYw-0000Ry-FU; Wed, 17 Sep 2025 06:38:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYr-0000Ma-JK; Wed, 17 Sep 2025 06:38:53 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYp-00074D-BX; Wed, 17 Sep 2025 06:38:53 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAf099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:32:59 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=xaI2KenS6q6E7iB3V1ZG5UGfMQv+qfK+9G24Jw3H4nE=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105179; v=1; b=hgmGB1OIvwevgMatBnGGeuphoBq1R5fCIFkSAjZ5NLgd7MOEfc9IA7fC2+1STrc8 sF2CyZq7TUMO8RaauK954x/v/61pm74h6K7bUG1A/KncVao7LQ/dKD8rGAIVpzWV sCKx7imv6MfkdGzVPIsNMU5qXuAArti4epwHkOc1ZO6bNSrO1EV4oMozIiTX7bCw Y7rK2nv0FzpVHttD9Wdf5SMM2+xeBy7UJ0gc0dcoNF2gN+jpockONxzdhAJmq7qA Q/kKdZ3kFUSz/IpNK4LCqd6WgGd6QAnz1jnQrK8DWe14Qtkgewvaun139wZk/q1F v5sybrdK3wi3O9hRTz9qNg== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:53 +0900 Subject: [PATCH 07/14] cmd646: Do not delete the subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-7-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105647253116600 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/ide/cmd646.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index 2a59516a9ddb..ea4d501c5e40 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -302,17 +302,6 @@ static void pci_cmd646_ide_realize(PCIDevice *dev, Err= or **errp) } } =20 -static void pci_cmd646_ide_exitfn(PCIDevice *dev) -{ - PCIIDEState *d =3D PCI_IDE(dev); - unsigned i; - - for (i =3D 0; i < 2; ++i) { - memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].extra_io); - memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].addr_iopor= t); - } -} - static const Property cmd646_ide_properties[] =3D { DEFINE_PROP_UINT32("secondary", PCIIDEState, secondary, 0), }; @@ -325,7 +314,6 @@ static void cmd646_ide_class_init(ObjectClass *klass, c= onst void *data) device_class_set_legacy_reset(dc, cmd646_reset); dc->vmsd =3D &vmstate_ide_pci; k->realize =3D pci_cmd646_ide_realize; - k->exit =3D pci_cmd646_ide_exitfn; k->vendor_id =3D PCI_VENDOR_ID_CMD; k->device_id =3D PCI_DEVICE_ID_CMD_646; k->revision =3D 0x07; --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105334854759.1461459583609; Wed, 17 Sep 2025 03:35:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypUj-0002S7-43; Wed, 17 Sep 2025 06:34:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUS-0002Ir-MG; Wed, 17 Sep 2025 06:34:21 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUJ-0005vo-SI; Wed, 17 Sep 2025 06:34:17 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAg099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:32:59 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=iiyInnSiBdFW+yfPCMju2JfXG3ua48WG78dciSW5cd4=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105180; v=1; b=v9dhW7QLdBBweNxXOtWsioFjH2uCC5/SSnoLJiBWQbWPqaWCL/CbG1vmBwDjdIDW 0idTjsXtCqJeMqiFa1hWJjuyrY5RVy2BSRwjm7OdxaFlREo+xS9hcs/kbd3+yv0i 4Z1vm+z5kEdHgd4+g9panmBrkcI4jzGZDr0AcyEx6ptGw5qTNPdkXszB9SfeEaUl hKKFjasXbMIbfeT4NNC71PhqaaYCPMIFRmsbI79t2i4HooqmISmV8FtdioIJhtOp o6EbgKAlLZ2Hhyu71c4L0HDlmk6iqCeRGbJCQ2DcqBj1e/bLsxSWholPNAmz0vLu DKVRovnMUzg7kXDNata5aQ== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:54 +0900 Subject: [PATCH 08/14] hw/ide/piix: Do not delete the subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-8-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105335636116600 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/ide/piix.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index a0f2709c6973..138f8e1936b4 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -166,17 +166,6 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error= **errp) } } =20 -static void pci_piix_ide_exitfn(PCIDevice *dev) -{ - PCIIDEState *d =3D PCI_IDE(dev); - unsigned i; - - for (i =3D 0; i < 2; ++i) { - memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].extra_io); - memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].addr_iopor= t); - } -} - /* NOTE: for the PIIX3, the IRQs and IOports are hardcoded */ static void piix3_ide_class_init(ObjectClass *klass, const void *data) { @@ -186,7 +175,6 @@ static void piix3_ide_class_init(ObjectClass *klass, co= nst void *data) device_class_set_legacy_reset(dc, piix_ide_reset); dc->vmsd =3D &vmstate_ide_pci; k->realize =3D pci_piix_ide_realize; - k->exit =3D pci_piix_ide_exitfn; k->vendor_id =3D PCI_VENDOR_ID_INTEL; k->device_id =3D PCI_DEVICE_ID_INTEL_82371SB_1; k->class_id =3D PCI_CLASS_STORAGE_IDE; @@ -209,7 +197,6 @@ static void piix4_ide_class_init(ObjectClass *klass, co= nst void *data) device_class_set_legacy_reset(dc, piix_ide_reset); dc->vmsd =3D &vmstate_ide_pci; k->realize =3D pci_piix_ide_realize; - k->exit =3D pci_piix_ide_exitfn; k->vendor_id =3D PCI_VENDOR_ID_INTEL; k->device_id =3D PCI_DEVICE_ID_INTEL_82371AB; k->class_id =3D PCI_CLASS_STORAGE_IDE; --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105347378482.3449578594905; Wed, 17 Sep 2025 03:35:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypUf-0002Pb-Qn; Wed, 17 Sep 2025 06:34:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUQ-0002Hh-Ds; Wed, 17 Sep 2025 06:34:20 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypU9-0005uI-9D; Wed, 17 Sep 2025 06:34:13 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAh099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:33:00 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=N6KvdcMXa6qsZ06cdDLF8MQ7k2CfW5mVvMJOUaALk2A=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105180; v=1; b=A0EMi0mGLf+1sCcBCB9t23QKBjSgg2rnCouDR7ZMucZNEfK4AJeNhOsC1EFW8viF BdfHC063l7qC6IUqI8drV2KWP5df1Vjbj4aW8vbtk5gNiyDeIFX0SFZMgzMjGFso rNnIBtlcYqErg7mWCKJ3SyN1IS77Fz3OVKskRURSOUWIH7fgNyC5At/XL7pKsCBj QBkwxzkuE5OoCDrCQuEOUcG1p9ACFItpQbDg8uqpuHU1mKRXIurJX6J/w0ok2HBt ntgV2r8wDtseEFirBMEzPRE3podMNyG/y+UepLaycZAZM7UNxr0pEj0fzb1bFnd9 oYz1G1N48ZP7UiPJANuxJA== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:55 +0900 Subject: [PATCH 09/14] hw/ide/via: Do not delete the subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-9-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105349806116600 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/ide/via.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index dedc2674c002..cbaf4ad1548b 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -234,17 +234,6 @@ static void via_ide_realize(PCIDevice *dev, Error **er= rp) } } =20 -static void via_ide_exitfn(PCIDevice *dev) -{ - PCIIDEState *d =3D PCI_IDE(dev); - unsigned i; - - for (i =3D 0; i < ARRAY_SIZE(d->bmdma); ++i) { - memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].extra_io); - memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].addr_iopor= t); - } -} - static void via_ide_class_init(ObjectClass *klass, const void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -258,7 +247,6 @@ static void via_ide_class_init(ObjectClass *klass, cons= t void *data) k->config_read =3D via_ide_cfg_read; k->config_write =3D via_ide_cfg_write; k->realize =3D via_ide_realize; - k->exit =3D via_ide_exitfn; k->vendor_id =3D PCI_VENDOR_ID_VIA; k->device_id =3D PCI_DEVICE_ID_VIA_IDE; k->revision =3D 0x06; --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105358524272.3227559865137; Wed, 17 Sep 2025 03:35:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypUj-0002SC-Sv; Wed, 17 Sep 2025 06:34:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUS-0002Il-Bk; Wed, 17 Sep 2025 06:34:21 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUJ-0005uW-HV; Wed, 17 Sep 2025 06:34:16 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAi099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:33:00 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=ndYF867z6EElCDxaTC1J1gUsmSgX+BoU/xzKU8ItqzM=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105181; v=1; b=nMQOuqy2/xgBsfJ7t8t5kqXh/vyD5MtS0AHvvCoykFTa1eMu3Mbwk5XZlyo5Og8r isBt/9kF22Mhv/OUTMJukC0tzZyxZuwoYTWsfFBOy8MPrFkF/pdaMWIGmUaI59Aq I7xPhGK4koXe5vGxo2alO3EgEWGaD+PerN9vD8DSGP0ccCPEeRypEAHLT/sgv0EP eziE8I6GeVh7JPTg04RF7XvpNBDeONSIRbl/8KqLQXaBSNfH2CICtyrmdRzHJCh2 FZS45V8lQ6BAWSHmYdA9NOYEyWx5iNqAHOHe1bwAUe+DX37UvvrzgVGJzmbNd02t B8mPMFVTwAc/j8gdNQ63JQ== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:56 +0900 Subject: [PATCH 10/14] hw/nvme: Do not delete the subregion MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-10-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105360076116601 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/nvme/ctrl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index f5ee6bf260f1..eebce1f787f4 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -9058,8 +9058,6 @@ static void nvme_exit(PCIDevice *pci_dev) } else { msix_uninit(pci_dev, &n->bar0, &n->bar0); } - - memory_region_del_subregion(&n->bar0, &n->iomem); } =20 static const Property nvme_props[] =3D { --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17581056454851015.5200835584658; Wed, 17 Sep 2025 03:40:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypYx-0000SF-Re; Wed, 17 Sep 2025 06:38:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYu-0000Pe-FG; Wed, 17 Sep 2025 06:38:56 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYr-00074r-Is; Wed, 17 Sep 2025 06:38:56 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAj099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:33:01 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=9xkJspHpPQNQBoWKZvm2Uj1/DqAf0CZcwgKhdBrA1QA=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105181; v=1; b=d/0glsTJ/odLJp0tdqAsjgCfDMzbWgIZpEnQuGFc+EEQR29QOPElE6ktsu5enPlO rEyvOW8z2jO2aed5ADNAtfJAJRpWxUE++6daYji/YJ+GGCdJbrWUZzVrkpdVjmWg 2vwaD00UTJrPKsoSK1k1Sfvq2sh3JNsTEHVEcXTa04azL0v1JbShCQ73d0xoWhHO a41CH7AqKBZ0HP7JqjDP75LV4rglP8iJtLACSpr+8inCVgyGRj35HjuN5xLq2zNQ g/1Z22DpbyHjAO4MlELo5czYqdxGrU4GlPXrORr96/HTz5o8ihTUH6QJamsan/XT LPDYVQbqLIYSzsBKL73sLw== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:57 +0900 Subject: [PATCH 11/14] pci: Do not delete the subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-11-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105647253116601 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/pci/pci.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 516029f66cda..2b408c7ec336 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1188,10 +1188,6 @@ static void do_pci_unregister_device(PCIDevice *pci_= dev) if (xen_mode =3D=3D XEN_EMULATE) { xen_evtchn_remove_pci_device(pci_dev); } - if (memory_region_is_mapped(&pci_dev->bus_master_enable_region)) { - memory_region_del_subregion(&pci_dev->bus_master_container_region, - &pci_dev->bus_master_enable_region); - } address_space_destroy(&pci_dev->bus_master_as); } =20 @@ -1417,27 +1413,11 @@ static PCIDevice *do_pci_register_device(PCIDevice = *pci_dev, return pci_dev; } =20 -static void pci_unregister_io_regions(PCIDevice *pci_dev) -{ - PCIIORegion *r; - int i; - - for(i =3D 0; i < PCI_NUM_REGIONS; i++) { - r =3D &pci_dev->io_regions[i]; - if (!r->size || r->addr =3D=3D PCI_BAR_UNMAPPED) - continue; - memory_region_del_subregion(r->address_space, r->memory); - } - - pci_unregister_vga(pci_dev); -} - static void pci_qdev_unrealize(DeviceState *dev) { PCIDevice *pci_dev =3D PCI_DEVICE(dev); PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(pci_dev); =20 - pci_unregister_io_regions(pci_dev); pci_del_option_rom(pci_dev); pcie_sriov_unregister_device(pci_dev); =20 --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105646452304.1100097171387; Wed, 17 Sep 2025 03:40:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypYw-0000Rw-8O; Wed, 17 Sep 2025 06:38:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYt-0000Nv-EZ; Wed, 17 Sep 2025 06:38:55 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYr-00074k-Cw; Wed, 17 Sep 2025 06:38:55 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAk099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:33:01 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=hwAXHArhJLR6ifvReRiyEc7DJ0CC9c83Sf7dL+LBIpA=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105182; v=1; b=JmmGE5sVgzQQ2w4s3yOe4c1OU5Yk1uQDD6V5/H56dMPo8Dtw21768N6VEn4YxeGd I7dqPqQYlebGzYBkslPRpZtcJYQGMeAgCpC1bmFR58NOeWSoHuco40mtkQ3JNNtb zrDM5TawYIHCQVRP21Slro9RhOw2qKaUfiwY0RqMmcJbgHT5GABg0zhkwIbhvOQf 6Z21q+JaLzkZ/f01AnBCaiPGDef5fzkrgs5MRgvlH/APLlslx5EaVdgRaH8vp1I+ ByS++2WGxcUDrHok8VzBlC/MhPydeEgWexxXCDFxSC0+xmWkp0H82ag1Hcxhsjf/ ebd5nPTcVVgB9OmrnotqJA== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:58 +0900 Subject: [PATCH 12/14] hw/ppc/spapr_pci: Do not delete the subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-12-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105647331116600 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/ppc/spapr_pci.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 1ac1185825e8..b4043ee752c5 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1735,27 +1735,13 @@ static void spapr_phb_unrealize(DeviceState *dev) SysBusDevice *s =3D SYS_BUS_DEVICE(dev); PCIHostState *phb =3D PCI_HOST_BRIDGE(s); SpaprPhbState *sphb =3D SPAPR_PCI_HOST_BRIDGE(phb); - SpaprTceTable *tcet; int i; - const unsigned windows_supported =3D spapr_phb_windows_supported(sphb); =20 if (sphb->msi) { g_hash_table_unref(sphb->msi); sphb->msi =3D NULL; } =20 - /* - * Remove IO/MMIO subregions and aliases, rest should get cleaned - * via PHB's unrealize->object_finalize - */ - for (i =3D windows_supported - 1; i >=3D 0; i--) { - tcet =3D spapr_tce_find_by_liobn(sphb->dma_liobn[i]); - if (tcet) { - memory_region_del_subregion(&sphb->iommu_root, - spapr_tce_get_iommu(tcet)); - } - } - remove_drcs(sphb, phb->bus); =20 for (i =3D PCI_NUM_PINS - 1; i >=3D 0; i--) { @@ -1767,8 +1753,6 @@ static void spapr_phb_unrealize(DeviceState *dev) =20 QLIST_REMOVE(sphb, list); =20 - memory_region_del_subregion(&sphb->iommu_root, &sphb->msiwindow); - /* * An attached PCI device may have memory listeners, eg. VFIO PCI. We = have * unmapped all sections. Remove the listeners now, before destroying = the @@ -1779,12 +1763,6 @@ static void spapr_phb_unrealize(DeviceState *dev) =20 qbus_set_hotplug_handler(BUS(phb->bus), NULL); pci_unregister_root_bus(phb->bus); - - memory_region_del_subregion(get_system_memory(), &sphb->iowindow); - if (sphb->mem64_win_pciaddr !=3D (hwaddr)-1) { - memory_region_del_subregion(get_system_memory(), &sphb->mem64windo= w); - } - memory_region_del_subregion(get_system_memory(), &sphb->mem32window); } =20 static void spapr_phb_destroy_msi(gpointer opaque) --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105386886671.9135933450092; Wed, 17 Sep 2025 03:36:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypUi-0002S2-Fi; Wed, 17 Sep 2025 06:34:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUQ-0002Hk-EZ; Wed, 17 Sep 2025 06:34:20 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypUJ-0005ub-HX; Wed, 17 Sep 2025 06:34:15 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAl099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:33:02 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=F0AyM/lua4p28w0QtF6/Ku3cctKLYXgOBYs6U3KWbds=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105182; v=1; b=RBRMgmOSFmK/66iyeCtzp07J+8+R8m3cMUo/vLJXjS0KiUv9wHQXFstPh76Hk2VL kA5QM3A8YwraJRtO5CmZX2BEjQLny2+NLsfw7Vru4Ybl+RFfIsfsPt/L4kA1pWDe VfafwmbYs8CQZFLRmWLi7rPTYY1hglGWJRVMADLC87ppxT/2fQT2Bdto8m1TH5ct VW7Mr5i77yQMh8l3No1BVSplDCMrzmm6PwLpE7o+7xK/DRXtPn2IQiU+zCJbHsbN Ck09PqoAaw15El2Xt0ap2lp8CyNesSpCTdGzBhtUDoSuhiWHIRW8JmeCtYIDMFI1 a+Tmv4i9CftX3F4lqJgDpQ== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:32:59 +0900 Subject: [PATCH 13/14] hw/usb/hcd-ehci: Do not delete the subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-13-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105388260116600 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/usb/hcd-ehci.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index b090f253656b..21c3501455b5 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -2557,10 +2557,6 @@ void usb_ehci_unrealize(EHCIState *s, DeviceState *d= ev) ehci_queues_rip_all(s, 0); ehci_queues_rip_all(s, 1); =20 - memory_region_del_subregion(&s->mem, &s->mem_caps); - memory_region_del_subregion(&s->mem, &s->mem_opreg); - memory_region_del_subregion(&s->mem, &s->mem_ports); - usb_bus_release(&s->bus); =20 if (s->vmstate) { --=20 2.51.0 From nobody Mon Sep 22 02:19:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=reject dis=none) header.from=rsg.ci.i.u-tokyo.ac.jp Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758105646109754.2434731285373; Wed, 17 Sep 2025 03:40:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uypYv-0000Re-KY; Wed, 17 Sep 2025 06:38:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYr-0000MY-Hq; Wed, 17 Sep 2025 06:38:53 -0400 Received: from www3579.sakura.ne.jp ([49.212.243.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uypYp-000741-AX; Wed, 17 Sep 2025 06:38:53 -0400 Received: from h205.csg.ci.i.u-tokyo.ac.jp (h205.csg.ci.i.u-tokyo.ac.jp [133.11.54.205]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 58HAWmAm099616 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2025 19:33:02 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=POdHoCg5/LDRfXqqwG2wxEKm9Lch4GRRuKLv3lF9UqQ=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1758105183; v=1; b=hDEKL5Fg82+eD5D2TnjNAuAtLQ0/3HkFMUCoDxUSCQ21l34OGEkgmykD7hJtPGyL sZhC65i24ourRRFfYMhW46aSgTDxAmlqsBK7vpr2uVYtuuFOxaf/qKQPJlj5b8tf IWdLnrm4oUKfulFctn6pjO/RpjUtj/5pP8dQbHE+XPVDvHtOTGK7pdBKe9vduyzU kLjQ+z0I7KYEVxoRG38K34sJKz1uy0qsPOpq/LvMwWmveygcs0ZeZAZXY+6YijS0 vrny7M4p3sDfPX3uiVWUNdlCQrvdMKFzd9P+BppVjZ7OPEsij+TDBwpdQYwG6A2x XX4p2DCxBFeDRSQKfQeHeA== From: Akihiko Odaki Date: Wed, 17 Sep 2025 19:33:00 +0900 Subject: [PATCH 14/14] hw/usb/hcd-xhci: Do not delete the subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250917-subregion-v1-14-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> References: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250917-subregion-v1-0-bef37d9b4f73@rsg.ci.i.u-tokyo.ac.jp> To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Gerd Hoffmann , John Snow , qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Jesper Devantier , Marcel Apfelbaum , Nicholas Piggin , qemu-ppc@nongnu.org, John Levon , Thanos Makatos , Yanan Wang , BALATON Zoltan , Jiaxun Yang , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Thomas Huth , Laurent Vivier , Peter Maydell , Aurelien Jarno , Aleksandar Rikalo , Max Filippov , =?utf-8?q?Herv=C3=A9_Poussineau?= , Mark Cave-Ayland , Artyom Tarasenko , Akihiko Odaki X-Mailer: b4 0.15-dev-179e8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=49.212.243.89; envelope-from=odaki@rsg.ci.i.u-tokyo.ac.jp; helo=www3579.sakura.ne.jp X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758105647254116600 It is no longer necessary. Signed-off-by: Akihiko Odaki --- hw/usb/hcd-xhci.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 292c378bfc98..b68a2aec3171 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3454,16 +3454,6 @@ static void usb_xhci_unrealize(DeviceState *dev) xhci->mfwrap_timer =3D NULL; } =20 - memory_region_del_subregion(&xhci->mem, &xhci->mem_cap); - memory_region_del_subregion(&xhci->mem, &xhci->mem_oper); - memory_region_del_subregion(&xhci->mem, &xhci->mem_runtime); - memory_region_del_subregion(&xhci->mem, &xhci->mem_doorbell); - - for (i =3D 0; i < xhci->numports; i++) { - XHCIPort *port =3D &xhci->ports[i]; - memory_region_del_subregion(&xhci->mem, &port->mem); - } - usb_bus_release(&xhci->bus); } =20 --=20 2.51.0