From nobody Sat Sep 6 14:58:50 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 175712563840142.75257882862695; Fri, 5 Sep 2025 19:27:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiWD-0001KZ-Lh; Fri, 05 Sep 2025 22:19:09 -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 1uuiW6-00018D-Ki; Fri, 05 Sep 2025 22:19:02 -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 1uuiVl-0008B1-UN; Fri, 05 Sep 2025 22:18:58 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862BtnW041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:12:17 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=OpbiSE5+GXh5qnILBgOZBDeiwND16PW2eHMIA2V3CbU=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124749; v=1; b=cLzNLHV0X/VsUfNw2mQh1HtI5aCZb6q3ApnGcXbyGjQ9pSX20u4igAU/fsXzzVKI nOTd8OL26HTOQA8uwUrLzswa3oCHdLeNMdwckWF4XIgz2Hz6vdrft5w8YTGhf2mG RapeDBuv0CIiMcBya1Bg3kINSUNc0yRqYjtMOSmjTyqDHjx/ufXP5NL7tK16aef1 V2VnpxIuPX7ke4KPO70P6qOFlzVQUfZ58bLrgeHp0YTDBUnd5g6lj97ok8UpLttf HF3w26SWKDGBBl/mrKAUM1AxGCsjVYUfMCCBrcbo8iPaMc7usDcXSkJEAix1p96L 8Kjany8RBqz4LLHH6mmMxA== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:10 +0200 Subject: [PATCH 01/22] docs/devel: Do not unparent in instance_finalize() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-1-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125639619116600 Children are automatically unparented so manually unparenting is unnecessary. Worse, automatic unparenting happens before the insntance_finalize() callback of the parent gets called, so object_unparent() calls in the callback will refer to objects that are already unparented, which is semantically incorrect. Remove the instruction to call object_unparent(), and the exception of the "do not call object_unparent()" rule for instance_finalize. Signed-off-by: Akihiko Odaki --- docs/devel/memory.rst | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/docs/devel/memory.rst b/docs/devel/memory.rst index 57fb2aec76e066236d33efe1033d2e73c7f7c295..749f11d8a4ddc80f2d44b66fa41= fb12c0fa54006 100644 --- a/docs/devel/memory.rst +++ b/docs/devel/memory.rst @@ -161,18 +161,11 @@ or never. Destruction of a memory region happens automatically when the owner object dies. =20 -If however the memory region is part of a dynamically allocated data -structure, you should call object_unparent() to destroy the memory region -before the data structure is freed. For an example see VFIOMSIXInfo -and VFIOQuirk in hw/vfio/pci.c. - You must not destroy a memory region as long as it may be in use by a device or CPU. In order to do this, as a general rule do not create or -destroy memory regions dynamically during a device's lifetime, and only -call object_unparent() in the memory region owner's instance_finalize -callback. The dynamically allocated data structure that contains the -memory region then should obviously be freed in the instance_finalize -callback as well. +destroy memory regions dynamically during a device's lifetime. +The dynamically allocated data structure that contains the +memory region should be freed in the instance_finalize callback. =20 If you break this rule, the following situation can happen: =20 @@ -198,9 +191,9 @@ this exception is rarely necessary, and therefore it is= discouraged, but nevertheless it is used in a few places. =20 For regions that "have no owner" (NULL is passed at creation time), the -machine object is actually used as the owner. Since instance_finalize is -never called for the machine object, you must never call object_unparent -on regions that have no owner, unless they are aliases or containers. +machine object is actually used as the owner. You must never call +object_unparent on regions that have no owner, unless they are aliases +or containers. =20 =20 Overlapping regions and priority --=20 2.51.0 From nobody Sat Sep 6 14:58:50 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 1757125674216549.0211613748181; Fri, 5 Sep 2025 19:27:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiWD-0001Ng-8N; Fri, 05 Sep 2025 22:19:12 -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 1uuiW5-0001AF-Qa; Fri, 05 Sep 2025 22:19:01 -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 1uuiVr-0008BC-EM; Fri, 05 Sep 2025 22:18:58 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862BtnX041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:12:29 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=pI7a0m1fI57fmHlHi8KpEqhcrE4H2Aca0FHoIemSJqk=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124761; v=1; b=aJNzl5jgDVDS16/icaYiiXgvoNmwSF4RsDf72tV8ZCNl9ziQ341OIP79qT+fTjGr T1gI9kKnXZ44BWbJEplqWshoA+YYb07m3isKndtH/JJUnI7shAHdZQROvaA15Z9X qOOIcLB262MjRI45RA7TwSTVcaedtta4b+CUk9Sbm0bxmzIw6A1tPkR8B1Ul3hgZ OL31nmRtDCl082icfGLWOT/JKLSKc3x2wo8EzT8XHfu1EDiso9tchWmuV/CX51Y1 JOZhJJCj6aFdtjO51RL3IhpJhf6S+pnx2gD/0DVDRMQ/rRe3y+LQvDZQTb2Fwod4 J6Ny4XRZ5QUBfWDclSCO2g== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:11 +0200 Subject: [PATCH 02/22] vfio/pci: Do not unparent in instance_finalize() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-2-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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: 1757125675866116600 Children are automatically unparented so manually unparenting is unnecessary. Worse, automatic unparenting happens before the insntance_finalize() callback of the parent gets called, so object_unparent() calls in the callback will refer to objects that are already unparented, which is semantically incorrect. Signed-off-by: Akihiko Odaki --- hw/vfio/pci.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 07257d0fa049b09fc296ac2279a6fafbdf93d277..2e909c190f86a722e1022fa7c45= a96d2dde8d58e 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2000,7 +2000,6 @@ static void vfio_bars_finalize(VFIOPCIDevice *vdev) vfio_region_finalize(&bar->region); if (bar->mr) { assert(bar->size); - object_unparent(OBJECT(bar->mr)); g_free(bar->mr); bar->mr =3D NULL; } @@ -2008,9 +2007,6 @@ static void vfio_bars_finalize(VFIOPCIDevice *vdev) =20 if (vdev->vga) { vfio_vga_quirk_finalize(vdev); - for (i =3D 0; i < ARRAY_SIZE(vdev->vga->region); i++) { - object_unparent(OBJECT(&vdev->vga->region[i].mem)); - } g_free(vdev->vga); } } --=20 2.51.0 From nobody Sat Sep 6 14:58:50 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 175712502557573.64973616071336; Fri, 5 Sep 2025 19:17:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiRn-0003yI-75; Fri, 05 Sep 2025 22:14: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 1uuiRb-0003wD-PP; Fri, 05 Sep 2025 22:14:23 -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 1uuiRO-0006Q8-EU; Fri, 05 Sep 2025 22:14:22 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862BtnY041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:12:42 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=py43IqlzE5vFeWpPuIxLuLFKrIYuMLr2zAmltTreJ00=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124775; v=1; b=VbJCYqxH2/eRo37csaPkOpuuaaq8F0hQg7WkRM2yL7VfoyshlhNa2jyE818GZYTH 31xIxOUYS6gV3Z3CRO70xop0foGngyuEmLi80vpYM+Vs1GyQJECbXjFjzuCEXjx8 y/SEmaN31/GB4u3kDYDh7XbsDk29oOvJzWPEnbkNwmyNAYD4gVqjXEx7tDwEtxlt gYIYWeGmTqYnXuu+0cgEgcinm26jB9fEdenIcGAVXW31xTi3rmbfc34KlvpVDsjk U2fyVssXUSL0yDUmHywl4FW/LHy7PpdbOKR/5okrbZp3Ic1YKhFYisQQVu5jSnN7 vVuqgk9TDGBrIawqnlBfuA== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:12 +0200 Subject: [PATCH 03/22] 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: <20250906-use-v1-3-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125030698124100 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 6b7d3ac8a3611d00d1c1c949c260f3dd44d36cc4..d0bd214b4e11eccc085f7ebe421= d170f37552ac3 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 c70b5ceebaf1f2b10768bd030526cbb518da2b8d..516029f66cda6705bded15322cb= 6f7eb3d42f82c 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 76255c4cd8929cf9f350af4be1a8448791d52afa..240d0f904de9771f81a392ad26b= e6ba38a41e4f6 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 Sat Sep 6 14:58:50 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 1757125111750633.1803027442356; Fri, 5 Sep 2025 19:18:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiS3-00045B-RZ; Fri, 05 Sep 2025 22:14:51 -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 1uuiRp-0003za-3n; Fri, 05 Sep 2025 22:14:37 -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 1uuiRQ-0006St-Le; Fri, 05 Sep 2025 22:14:34 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862BtnZ041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:12:55 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=/uPgwcc3IWq7aKQRv1rX6E+OqnUwtEP9BCpfmuk3Vig=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124787; v=1; b=dQKGD+G85Gety2SkYn0HeaNZABHMSfa57XczRQ4L6Kl2fiGsdrddphwf1Lw46KcL T5duX2QxlOmxT8ZXEN+tt+3J/+VodoeLSYYZ3fOasnuF95TH+8Sz6q0AGlWeSSTE rPHEZr6FYcC2D9G1iOzAUk3tbDGuKX2Y66iBLLku7Ro70juTPDcXvfuJXbaSjmQ/ YvksUuvFdM9yRQBlRMOD1CtfEMAxepDSh5KT4TZMCpT9khJy475XDxL1GHrrwa7g BNP7NQGaTDFdw8HENfByts5IWB16JW/t9yWgHmE4/lmrddfRCVFMNBfV9t5MgJxv QliZQS29gQVsgFEjjm5y0w== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:13 +0200 Subject: [PATCH 04/22] target/mips: Fix AddressSpace exposure timing MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-4-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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: 1757125113502124100 mips-cpu is not hotpluggable but its instance can still be created and finalized when processing the device-list-properties QMP command. Exposing such a temporary instance to AddressSpace should be avoided because it leaks the instance. Expose instances to the AddressSpace at their realization time so that it won't happen for the temporary instances. Signed-off-by: Akihiko Odaki --- target/mips/cpu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 1f6c41fd3401e88637c2c0d8fe3fcf4a38370288..e166b570984a40fba2ef417799a= 267eac9bff7d3 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -457,6 +457,13 @@ static void mips_cpu_realizefn(DeviceState *dev, Error= **errp) MIPSCPUClass *mcc =3D MIPS_CPU_GET_CLASS(dev); Error *local_err =3D NULL; =20 +#ifndef CONFIG_USER_ONLY + if (mcc->cpu_def->lcsr_cpucfg2 & (1 << CPUCFG2_LCSRP)) { + address_space_init(&env->iocsr.as, + &env->iocsr.mr, "IOCSR"); + } +#endif + if (!clock_get(cpu->clock)) { #ifndef CONFIG_USER_ONLY if (!qtest_enabled()) { @@ -505,8 +512,6 @@ static void mips_cpu_initfn(Object *obj) if (mcc->cpu_def->lcsr_cpucfg2 & (1 << CPUCFG2_LCSRP)) { memory_region_init_io(&env->iocsr.mr, OBJECT(cpu), NULL, env, "iocsr", UINT64_MAX); - address_space_init(&env->iocsr.as, - &env->iocsr.mr, "IOCSR"); } #endif } --=20 2.51.0 From nobody Sat Sep 6 14:58:50 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 175712520698453.807234268022626; Fri, 5 Sep 2025 19:20:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiRv-00043t-HG; Fri, 05 Sep 2025 22:14:44 -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 1uuiRl-0003zB-Di; Fri, 05 Sep 2025 22:14:34 -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 1uuiRZ-0006Xq-Ts; Fri, 05 Sep 2025 22:14:32 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btna041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:13:07 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=VCWgUoTRg/k1AUk49wkoQFRWzcXCqr+AZelXZUH2ZBE=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124799; v=1; b=Mb9LKHOE4d7dnUuZfJWLY/3080nZZk1K5DYfN8zw6rcWo6d3kX8Vdajif3FrTqmu RGLaMlcLa27yhYLG+iOQW853AAxlfsA7WDaaG5agvDj8v5zRxAxtjMaA7k41Lh5+ mB4u3VwytzA1F3ytFldPs4XjNywaXEXqbaStkX8wl2tYMRwqe7mrVzivSJ7rRJVn Cgre/iR7Slo0EpzeeZ7kemPrJWyclDIEdCcFbrGEL1PLtnnGTg0PqkpCpf0/E7he u9a9GlApmfSfeQc3E/7Len0lX2K67MUrdTJP0c950cumwFfu4AcWPEU9Et5CPSRJ FSC3GnsAgG+kiCBMyoriDw== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:14 +0200 Subject: [PATCH 05/22] target/xtensa: Fix AddressSpace exposure timing MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-5-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125207623116600 xtensa-cpu is not hotpluggable but its instance can still be created and finalized when processing the device-list-properties QMP command. Exposing such a temporary instance to AddressSpace should be avoided because it leaks the instance. Expose instances to the AddressSpace at their realization time so that it won't happen for the temporary instances. Signed-off-by: Akihiko Odaki --- target/xtensa/cpu.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index ea9b6df3aa24178c8e6a88b02afda5db659199da..63edc3a5b2778c8379a30125481= f65361655fe1c 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -243,7 +243,11 @@ static void xtensa_cpu_realizefn(DeviceState *dev, Err= or **errp) Error *local_err =3D NULL; =20 #ifndef CONFIG_USER_ONLY - xtensa_irq_init(&XTENSA_CPU(dev)->env); + CPUXtensaState *env =3D &XTENSA_CPU(dev)->env; + + env->address_space_er =3D g_malloc(sizeof(*env->address_space_er)); + address_space_init(env->address_space_er, env->system_er, "ER"); + xtensa_irq_init(env); #endif =20 cpu_exec_realizefn(cs, &local_err); @@ -268,11 +272,9 @@ static void xtensa_cpu_initfn(Object *obj) env->config =3D xcc->config; =20 #ifndef CONFIG_USER_ONLY - env->address_space_er =3D g_malloc(sizeof(*env->address_space_er)); env->system_er =3D g_malloc(sizeof(*env->system_er)); memory_region_init_io(env->system_er, obj, NULL, env, "er", UINT64_C(0x100000000)); - address_space_init(env->address_space_er, env->system_er, "ER"); =20 cpu->clock =3D qdev_init_clock_in(DEVICE(obj), "clk-in", NULL, cpu, 0); clock_set_hz(cpu->clock, env->config->clock_freq_khz * 1000); --=20 2.51.0 From nobody Sat Sep 6 14:58:50 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 1757125022170404.84622517016703; Fri, 5 Sep 2025 19:17:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiS7-00046x-FZ; Fri, 05 Sep 2025 22:14:55 -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 1uuiS3-00045I-8L; Fri, 05 Sep 2025 22:14: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 1uuiRt-0006fG-IC; Fri, 05 Sep 2025 22:14:48 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnb041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:13:20 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=cN5bYCz95z43poG/hzCshYc7BVuKfAjXwSqQcnCNxz0=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124812; v=1; b=X97E9C/vFb4eJOPvohkQT/b+9jdqfQ43r0a5eDgVdCJ4tR2NDK1QcBJ8cpSGbakF xE6Q7dHSO8LsCTYGTMKlmP3zLsXm/yGeqhYwrfNnTEsysPudx0eHkoEdw6B/DWYk TAxeyTGBoVa2EgQLAI7mzI5GHcxNp/fAZ/KY5j4HQkeZuI71btpcNK/udyWc3Pqz 7nzbnda6P2rnddo67xWjDzww9kX8WBBLtaBx+uy2nLWBlPrCWQLL/LwLyS4hJ3PY fgpeS53PRmSPTO5D2nptdeK8kKGFZNeGr1kK2DR2yEI+9UrunR68JEVwWf6nmZe+ aV6HJXyXFfo6lR6BVjJK7g== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:15 +0200 Subject: [PATCH 06/22] auxbus: Fix AddressSpace exposure timing MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-6-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125024608116600 aux-bus is not hotpluggable but its instance can still be created and finalized when processing the device-list-properties QMP command. Exposing such a temporary instance to AddressSpace should be avoided because it leaks the instance. Expose instances to the AddressSpace at their realization time so that it won't happen for the temporary instances. Signed-off-by: Akihiko Odaki --- hw/misc/auxbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c index 877f34560626f0ef741f00bb6c7272135d264399..c47db4da985d8e81f9eb4954227= 9499c931aac6c 100644 --- a/hw/misc/auxbus.c +++ b/hw/misc/auxbus.c @@ -74,12 +74,12 @@ AUXBus *aux_bus_init(DeviceState *parent, const char *n= ame) /* Memory related. */ bus->aux_io =3D g_malloc(sizeof(*bus->aux_io)); memory_region_init(bus->aux_io, OBJECT(bus), "aux-io", 1 * MiB); - address_space_init(&bus->aux_addr_space, bus->aux_io, "aux-io"); return bus; } =20 void aux_bus_realize(AUXBus *bus) { + address_space_init(&bus->aux_addr_space, bus->aux_io, "aux-io"); qdev_realize(DEVICE(bus->bridge), BUS(bus), &error_fatal); } =20 --=20 2.51.0 From nobody Sat Sep 6 14:58:50 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 1757125019880881.5020772404084; Fri, 5 Sep 2025 19:16:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiSG-0004BL-Hl; Fri, 05 Sep 2025 22:15:04 -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 1uuiS9-00047n-4u; Fri, 05 Sep 2025 22:14:57 -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 1uuiRz-0006fu-2C; Fri, 05 Sep 2025 22:14:56 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnc041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:13:32 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=z0YH0QMtBFBQG+CaXT27uewgJWSh8xAMHDbxqOUFkk0=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124824; v=1; b=dUG7IxeSwdaFRl5BCwStf6XW+NsPZGVu+YAteuNfU0uUew8NQaMg9rCIMpGpmgbR wA462bZlG4iL140bRfgT9k0Q+n9sUH+G5PhWIW7gbcMDBCz05HTVhgAOvlqsS0b4 sFC8u0iWySBTXFqR91zNWYiIRoIyhCrtOKkp62RoTeHNNYpeNP2ajqkZgnutOYGB /dqCenir3UpnOoWcNkY1T1zH/wm3jsQlAaT54CtbNA7kYcA1Eubbtft/FW5MOXPs Lh9BeP0o2dI9fxDR781DStOueVFQLJm6VejfBIU7PH21LDdD335GrHNCniBtKw7F wKzK8hGGKQcO5WsbwuEUVA== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:16 +0200 Subject: [PATCH 07/22] hw/pci-host/raven: Fix AddressSpace exposure timing MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-7-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125024638116600 raven-pcihost is not hotpluggable but its instance can still be created and finalized when processing the device-list-properties QMP command. Exposing such a temporary instance to AddressSpace should be avoided because it leaks the instance. Expose instances to the AddressSpace at their realization time so that it won't happen for the temporary instances. Signed-off-by: Akihiko Odaki --- hw/pci-host/raven.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index f8c0be5d21c351305742a696a65f70f87b546b0c..82f245c91cf267cdc6a518765a8= c31d06eac7228 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -233,6 +233,20 @@ static void raven_pcihost_realizefn(DeviceState *d, Er= ror **errp) MemoryRegion *address_space_mem =3D get_system_memory(); int i; =20 + address_space_init(&s->pci_io_as, &s->pci_io, "raven-io"); + + /* CPU address space */ + memory_region_add_subregion(address_space_mem, PCI_IO_BASE_ADDR, + &s->pci_io); + memory_region_add_subregion_overlap(address_space_mem, PCI_IO_BASE_ADD= R, + &s->pci_io_non_contiguous, 1); + memory_region_add_subregion(address_space_mem, 0xc0000000, &s->pci_mem= ory); + pci_root_bus_init(&s->pci_bus, sizeof(s->pci_bus), DEVICE(d), NULL, + &s->pci_memory, &s->pci_io, 0, TYPE_PCI_BUS); + + address_space_init(&s->bm_as, &s->bm, "raven-bm"); + pci_setup_iommu(&s->pci_bus, &raven_iommu_ops, s); + /* * According to PReP specification section 6.1.6 "System Interrupt * Assignments", all PCI interrupts are routed via IRQ 15 @@ -276,14 +290,12 @@ static void raven_pcihost_initfn(Object *obj) { PCIHostState *h =3D PCI_HOST_BRIDGE(obj); PREPPCIState *s =3D RAVEN_PCI_HOST_BRIDGE(obj); - MemoryRegion *address_space_mem =3D get_system_memory(); DeviceState *pci_dev; =20 memory_region_init(&s->pci_io, obj, "pci-io", 0x3f800000); memory_region_init_io(&s->pci_io_non_contiguous, obj, &raven_io_ops, s, "pci-io-non-contiguous", 0x00800000); memory_region_init(&s->pci_memory, obj, "pci-memory", 0x3f000000); - address_space_init(&s->pci_io_as, &s->pci_io, "raven-io"); =20 /* * Raven's raven_io_ops use the address-space API to access pci-conf-i= dx @@ -292,15 +304,6 @@ static void raven_pcihost_initfn(Object *obj) */ s->pci_io_non_contiguous.disable_reentrancy_guard =3D true; =20 - /* CPU address space */ - memory_region_add_subregion(address_space_mem, PCI_IO_BASE_ADDR, - &s->pci_io); - memory_region_add_subregion_overlap(address_space_mem, PCI_IO_BASE_ADD= R, - &s->pci_io_non_contiguous, 1); - memory_region_add_subregion(address_space_mem, 0xc0000000, &s->pci_mem= ory); - pci_root_bus_init(&s->pci_bus, sizeof(s->pci_bus), DEVICE(obj), NULL, - &s->pci_memory, &s->pci_io, 0, TYPE_PCI_BUS); - /* Bus master address space */ memory_region_init(&s->bm, obj, "bm-raven", 4 * GiB); memory_region_init_alias(&s->bm_pci_memory_alias, obj, "bm-pci-memory", @@ -310,8 +313,6 @@ static void raven_pcihost_initfn(Object *obj) get_system_memory(), 0, 0x80000000); memory_region_add_subregion(&s->bm, 0 , &s->bm_pci_memory_alia= s); memory_region_add_subregion(&s->bm, 0x80000000, &s->bm_ram_alias); - address_space_init(&s->bm_as, &s->bm, "raven-bm"); - pci_setup_iommu(&s->pci_bus, &raven_iommu_ops, s); =20 h->bus =3D &s->pci_bus; =20 --=20 2.51.0 From nobody Sat Sep 6 14:58:50 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 1757125098070347.15049400595296; Fri, 5 Sep 2025 19:18:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiSm-0004ON-Es; Fri, 05 Sep 2025 22:15: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 1uuiSY-0004Gx-Od; Fri, 05 Sep 2025 22:15:25 -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 1uuiS9-0006hG-Je; Fri, 05 Sep 2025 22:15:18 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnd041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:13:44 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=mg0ILQS2B5cAZXx5omO4UeETOZOBuc3DqAZJ4UmKvz8=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124836; v=1; b=UNVaw+xClixMnF2zbEhoZF3UECN75Jw1U6fMG4OVsZoINYU3TN+sA9B1gAfYrYnn xgAbhizCB1mPaYR/wokud12ymKpbmSpYrn+fxFUYz24ROxUj4ZEtNaJ1DEVoJC88 G6ken5AXUtCpxA+GOYlLE8oTGbL6lG8Oq+H3KjgaOOvEnUy+axXi9UqRMCsHUmlQ 81aovTTF+VYXam+qrt5LOhl+xpQhU2OK/FV4wkrT6sg8OwxvPUgNF/RrysCjGZ8d wg4Vfs+8mvMdyczBDAHLK6yxS/yWUsZr8WlpNCZO4JJTCPjm0IaAHpcBG1EwqKUC nrr6EY/ZFksoXMHxQ3Z/Wg== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:17 +0200 Subject: [PATCH 08/22] sun4m: Fix AddressSpace exposure timing MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-8-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01 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: 1757125101078116600 sun4m-iommu is not hotpluggable but its instance can still be created and finalized when processing the device-list-properties QMP command. Exposing such a temporary instance to AddressSpace should be avoided because it leaks the instance. Expose instances to the AddressSpace at their realization time so that it won't happen for the temporary instances. Signed-off-by: Akihiko Odaki --- hw/sparc/sun4m_iommu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/sparc/sun4m_iommu.c b/hw/sparc/sun4m_iommu.c index a7ff36ee78c1d6295efea6499dffc2a481022167..0997f29ccb97d3dec4e3d34db49= f2e51b6807a1a 100644 --- a/hw/sparc/sun4m_iommu.c +++ b/hw/sparc/sun4m_iommu.c @@ -359,7 +359,6 @@ static void iommu_init(Object *obj) memory_region_init_iommu(&s->iommu, sizeof(s->iommu), TYPE_SUN4M_IOMMU_MEMORY_REGION, OBJECT(dev), "iommu-sun4m", UINT64_MAX); - address_space_init(&s->iommu_as, MEMORY_REGION(&s->iommu), "iommu-as"); =20 sysbus_init_irq(dev, &s->irq); =20 @@ -368,6 +367,13 @@ static void iommu_init(Object *obj) sysbus_init_mmio(dev, &s->iomem); } =20 +static void iommu_realize(DeviceState *dev, Error **errp) +{ + IOMMUState *s =3D SUN4M_IOMMU(dev); + + address_space_init(&s->iommu_as, MEMORY_REGION(&s->iommu), "iommu-as"); +} + static const Property iommu_properties[] =3D { DEFINE_PROP_UINT32("version", IOMMUState, version, 0), }; @@ -377,6 +383,7 @@ static void iommu_class_init(ObjectClass *klass, const = void *data) DeviceClass *dc =3D DEVICE_CLASS(klass); =20 device_class_set_legacy_reset(dc, iommu_reset); + dc->realize =3D iommu_realize; dc->vmsd =3D &vmstate_iommu; device_class_set_props(dc, iommu_properties); } --=20 2.51.0 From nobody Sat Sep 6 14:58:50 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 1757125028929133.00148644262708; Fri, 5 Sep 2025 19:17:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiSo-0004Pc-9o; Fri, 05 Sep 2025 22:15: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 1uuiSW-0004GD-Po; Fri, 05 Sep 2025 22:15:24 -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 1uuiSE-0006iM-Bj; Fri, 05 Sep 2025 22:15:18 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btne041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:13:57 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=hDE6MDpM29+rIuyhBoh3MNFBBlYhx+hw3yC0XNEvU1Q=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124848; v=1; b=nFA5MOO20dSmu7eWfkEOMBJkLjqOhBgI9IwVe4vUjoynwuZr+VjaxaINCnzlkord /gIx4xPOw2FU+fxMrtzmT1hvKwN4HflElC/F8vpjuE79/LkJ0zZfn3H12Dvkqli4 bpV9bm2hXPI6ciyUOI07VTHy/kLys8kilnvHEyCIQ+ZuqZH9Qsij1Qv5Eef5Zw8Y qeZQfKZOwnbTE5vX7crC1BcgycCMIf0aRdwJ8e8jExmagy1FYQDcAM2TU3FUy1ZP 69ganHHlKW0io3aUmAWOzCmNW1w84MoL47s4yaHIx5GcaJ8Mi9DGWfX4CHieypyn VwlhGeGXaAbUmyigyzS1cQ== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:18 +0200 Subject: [PATCH 09/22] sun4u: Fix AddressSpace exposure timing MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-9-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125030049116600 sun4u-iommu is not hotpluggable but its instance can still be created and destroyed when processing the device-list-properties QMP command. Exposing such a temporary instance to AddressSpace should be avoided because it leaks the instance. Expose instances to the AddressSpace at their realization time so that it won't happen for the temporary instances. Signed-off-by: Akihiko Odaki --- hw/sparc64/sun4u_iommu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/sparc64/sun4u_iommu.c b/hw/sparc64/sun4u_iommu.c index 14645f475a09ed3a6bef77f8d8b4b6b4b36ae40a..b6568551935610116d33481ae8d= 9fc08f02ecf7b 100644 --- a/hw/sparc64/sun4u_iommu.c +++ b/hw/sparc64/sun4u_iommu.c @@ -298,18 +298,25 @@ static void iommu_init(Object *obj) memory_region_init_iommu(&s->iommu, sizeof(s->iommu), TYPE_SUN4U_IOMMU_MEMORY_REGION, OBJECT(s), "iommu-sun4u", UINT64_MAX); - address_space_init(&s->iommu_as, MEMORY_REGION(&s->iommu), "iommu-as"); =20 memory_region_init_io(&s->iomem, obj, &iommu_mem_ops, s, "iommu", IOMMU_NREGS * sizeof(uint64_t)); sysbus_init_mmio(sbd, &s->iomem); } =20 +static void iommu_realize(DeviceState *dev, Error **errp) +{ + IOMMUState *s =3D SUN4U_IOMMU(dev); + + address_space_init(&s->iommu_as, MEMORY_REGION(&s->iommu), "iommu-as"); +} + static void iommu_class_init(ObjectClass *klass, const void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 device_class_set_legacy_reset(dc, iommu_reset); + dc->realize =3D iommu_realize; } =20 static const TypeInfo iommu_info =3D { --=20 2.51.0 From nobody Sat Sep 6 14:58:50 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 1757125491623560.7160655125764; Fri, 5 Sep 2025 19:24:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiSs-0004Qo-Hr; Fri, 05 Sep 2025 22:15:42 -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 1uuiSe-0004JR-9i; Fri, 05 Sep 2025 22:15:33 -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 1uuiSV-00070C-7j; Fri, 05 Sep 2025 22:15:26 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnf041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:14:09 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=3y3lEmcLsExfyPyQNVoE1PMNFbkUoglqqUOlB+qqwB8=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124861; v=1; b=W0KNsFF4cTDuBm5v0uby09jrWUkmqmSW7rKzcfOpNBXLXLCs5pd4iaoS8DsMCHyv fAa5U+CYTIPvoaiW/26YOZBp+RKCjpEr6RpRaTUpRMCnV3UWMBXUqHtAhAjyvrqZ 175VWkn7gCb9X2zeAFtYA6OmyjH3pIPIeH8JTqfP/2DBOAB9thlVHMmJqjsg9gVn AFDK1LjClpsqIeGlOGi+b1WUsJ4lHqam3RDE5SNMbj5PyfAQtz8D6QYHUWIoEa0R bre6Lz8RFg+RHfTNCt1Af+gyZbDJ/MZFNRTewrYTwejuAKMNmdQgrFm/M07zzzX5 J3TLfZrJcy0Tkg5Vaa0rQg== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:19 +0200 Subject: [PATCH 10/22] qdev: Automatically delete memory subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-10-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125493775124100 A common pattern is that to delete memory subregions during realization error handling and unrealization. pci automatically automatically deletes the IO subregions, but the pattern 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 8147fff3523eaa45c4a0d2c21d40b4ade3f419ff..4665f0a4b7a513c5863f6d5227a= 0173c836505e6 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 530f3da70218df59da72dc7a975dca8265600e00..8f443d5f8ea5f31d69181cc1ec5= 3a0b022eb71cc 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 f600226176871361d7ff3875f5d06bd4e614be6e..8fdf6774f87ec8424348e8c9652= dc4c99a2faeb5 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 0000000000000000000000000000000000000000..9c36531ae542d804dc19ed2a3c6= 57005881a2bca --- /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 cef046e6854ddaa9f12714c317a541ea75b8d412..b4df4e60a1af89c9354d5b92449= ce5409095b9f1 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 Sat Sep 6 14:58:50 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 1757125038641767.4316349736757; Fri, 5 Sep 2025 19:17:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiTB-0004d6-UW; Fri, 05 Sep 2025 22:16:04 -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 1uuiT2-0004Yt-Sw; Fri, 05 Sep 2025 22:15: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 1uuiSm-00076p-7b; Fri, 05 Sep 2025 22:15:50 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btng041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:14:21 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=JRn9IlAuuwcjgZFjdSaO6s+DIIBhc0p+mDtciOTKUsA=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124874; v=1; b=gR4PLgVdik3WXu2M6/F5aqckz1HPM4XSUTlxuvNj7HA3N6nYzbTuCAcQ1zCkWgX0 5NLx32dnO3hmseqJa7dLijG35W6DCFDa4uBMmPCqxc5kgvZilS2Fu0slV7l6cBz/ JQ7UNbAvG6BZkKBHVGGPzLobYfalqYrBBUdqwrr0JpUTCIn37W0D5XtUWhdo+M38 AW82QxDO30KRPSSFJKvzQ/oWMPkVX6DUn8kPDRiJoTk1CAsSYASoU3z6LOV56qAi g5s8s5cYK+spQ4UARohq10ltMd6yKt7quQC5tHTG1LFHiJU4eLaWTeV3DRdwsBYC CTx7FO93pAbnsVg+vDDawQ== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:20 +0200 Subject: [PATCH 11/22] 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: <20250906-use-v1-11-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125039617116600 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 be71c777291f0c68b01b54029612c4dbc6aa86e2..0b6c6a1c5ed327ec53b119a7999= 76a0823e304c3 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 Sat Sep 6 14:58:50 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 1757125346501371.4394015973188; Fri, 5 Sep 2025 19:22:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiTK-0004kU-CS; Fri, 05 Sep 2025 22:16:10 -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 1uuiT8-0004dQ-Eq; Fri, 05 Sep 2025 22:15:59 -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 1uuiSt-0007AU-8X; Fri, 05 Sep 2025 22:15:55 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnh041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:14:34 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=C011D3nEi4gnvkKvq30wWt2rhwDFSibnUsxSm7LxoTk=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124886; v=1; b=X6G5lUC7zIAIjR2R9Hl9zOJGMdHfrQiKwWOee/x5GJSMswB4V2fgRBzN7KGb7xHS QhAACQ9cEC0AybXRrQQRl+uJtLGfxEiZ83cgmNgk3ZqimEZ6PnTNSoKJacMF9VNb G7tXgUXETmveI4Hs/oKiBqBSU6CUxygsbTRMYjPODFzGExe+AUUgJ6+U04fWUrPS QJwEnH1d0QiJV27oR0lvQgqqACHGDVeG47F8f7ovB0AX2C/LnsaFXfhxmhqR6MtD vV9UtXaPQEiwRvQp7Zpk2ddqqrDYj2MoM9St0LC0vANs3mN88U2XpJITWMsJhgqo PCgKtLlVN/XEMb4a9Amo5g== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:21 +0200 Subject: [PATCH 12/22] 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: <20250906-use-v1-12-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_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: 1757125350198124100 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 e1f0713cb794d0442c56935dfe56d784d96949f0..1ae472e879b53555d4751b6a484= 8354f81c27fee 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 Sat Sep 6 14:58:50 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 1757125101376909.5149402108561; Fri, 5 Sep 2025 19:18:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiTQ-0004nj-UQ; Fri, 05 Sep 2025 22:16:19 -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 1uuiTD-0004gm-PF; Fri, 05 Sep 2025 22:16:04 -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 1uuiT2-0007Es-Tf; Fri, 05 Sep 2025 22:16:02 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btni041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:14:47 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=yVddGPFKHGH7ywDN+5LX7u8IS3es11FFm1EZQqc1z24=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124898; v=1; b=H8HkDND2ESMbtvU6rJuUxKIIt9vdJ2P/rnymFHUM62yPF1Vy+KztifEiGgL3DVuy q1GZA5HYJyDsA94OujFDK2RBVXAFrSjWKCxjaNlHW0koxJ75P2CIFE+dVhH2NWLB 1BfXhVxvCdZSWUbqIPLfKcJOFlTZjlny771UyTjQnge6QaYDgnnWS8dYAnBDjCdh j6kUTAuwAH3QHa8wxHRatXpbtPFIuF+AV7xzzHiryFzS3r+sefmrteCdKsLl0DYg MG7MWXliWV/i+lXTvvcyZ+rz4b7uKYpO07fd4Weppc1wGooqpWNg+zqwEfHSkIJK FEJ1XcW4qp7N9qfHKXifaA== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:22 +0200 Subject: [PATCH 13/22] 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: <20250906-use-v1-13-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125102532116600 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 13df272691a64f14ca3597174815653a01fbd381..3132ca90cebfe411cd3333b62ed= 75dd01f501067 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 Sat Sep 6 14:58:50 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 1757125771090139.48066583944353; Fri, 5 Sep 2025 19:29:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiTo-0005bF-DE; Fri, 05 Sep 2025 22:16:41 -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 1uuiTh-0005LV-Ks; Fri, 05 Sep 2025 22:16:33 -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 1uuiTT-0007SE-5c; Fri, 05 Sep 2025 22:16:31 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnj041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:14:59 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=kn8Bqoxi+tjKwwRXg2cZTs8dYOv2Ly9ES2G+ar9juS0=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124911; v=1; b=HQjxGqD12yYJnl2RNyQVgOtvRMBViN66R2En+XHIxXv6NqZg0zUl/uoMYoTxaaJl nqLni1wd2RUF5KDR3YFn4h6ExtN5G7S21ap058gwjW6L6BtLqbKSQhNi3OLFQaRg bc2Tzed4dUrx2I9axF5ImF/n4Zus7Tp1d1mqGzNXAsgJxu2Tl3HgcnRdEZ3f96d3 B7p6RBOtZLUbujouL5l8wr9hmcmTJF8+iddjOKx9gV/JL2KFpIeld56bskrXEQS9 c7RdlY10sXOSXU/yYtaOoMBIq4Ljvwhk9HYNC1J+067la24+aRPLLMryDMd2cdYI KqwS/Q1ydQkR+cuAw+hQVA== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:23 +0200 Subject: [PATCH 14/22] 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: <20250906-use-v1-14-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125772593116600 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 b81f7fd2d0fd11913e6b132897028ca490e74b95..90b4545d382135b109e3bbc880b= b8fe1a4fc5275 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 Sat Sep 6 14:58:50 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 1757125641869372.2289251207791; Fri, 5 Sep 2025 19:27:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiTn-0005MV-Uk; Fri, 05 Sep 2025 22:16:39 -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 1uuiTe-0005Jo-CG; Fri, 05 Sep 2025 22:16:30 -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 1uuiTO-0007Wf-MQ; Fri, 05 Sep 2025 22:16:28 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnk041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:15:11 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=Ku5gTVgI2eFOcSa5Fx00WOVlDLfLzBXwYcYASIz2wj0=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124923; v=1; b=C9i1wiIYsM4ULhuUI81VR7QzMhK/9MBwGmWPSfNNnGzUUQnWSWVGE8zaNzPPaTo7 5giqdd3GoxmsooOrZCnqQrVHrkEGgLDDx6HiOaYLUGA0p5cu4Ce+sqOcs6NO5VQ0 bQqCj6guxNHcqr0FDunqVDyFZtxRERz1T3V1AdhBDmP+uhi0ZQFP3NphP001r25q dcFGoQGtJa8MwGPIKUg/2LHhdeGfAaFpUjDzaccA7XWYtY/mb1MUhKPe2o8aBvda wBlJ3oVaxrLdp4PXsBFmLXgNIuRFXUcsDnaTBzdLFaQAWNF42XSFK7EiyBOvlBh8 F7k1rw+cLhjY/zWK7Enudg== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:24 +0200 Subject: [PATCH 15/22] cmd646: Do not delete the subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-15-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01 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: 1757125643436116600 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 2a59516a9ddbc0a7d40400f521b9cef07006b76a..ea4d501c5e40b0f7f5fcd5c025c= 113d97d89f5b7 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 Sat Sep 6 14:58:50 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 1757125728884449.6047619050704; Fri, 5 Sep 2025 19:28:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiZ1-0005A5-GD; Fri, 05 Sep 2025 22:22:05 -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 1uuiYv-0004um-HP; Fri, 05 Sep 2025 22:21:57 -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 1uuiYa-0000IJ-NX; Fri, 05 Sep 2025 22:21:55 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnl041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:15:24 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=AMIrLUwGb20DCX2QJ9sI6hzRgdwLBWo6KaejLtXVMas=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124935; v=1; b=MODj2VFVvsW/BnObGWOT3kdITg9LLUJsuB+kt+WlGCJwuoCVuSiGPXfxG/wjYUIZ OC0jFdulkatqESlsI/sleeXNCmuxR/zDFseuWk4h10Kx8MpxdSO6BULNRY3+F7ro s3Ilfr5rPeaarYyB5T4vT61JXG0JYGicngXbD97HQiiFXSUkNGUK30dQvdTguKGI bH8GVfggSHYEnxXQC2GeRn4ilDU0TSTpyAbBhg/JOAD9jMy+boZ3eqs5FasodiXn gniBFhD7awMZEO5eTDjY6L2oI8xhx+MNwuRxhvrDoEtkNDN+5RXaQWCzoylumgR4 oGyTAn7dCskJL64dEPO8Hg== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:25 +0200 Subject: [PATCH 16/22] 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: <20250906-use-v1-16-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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: 1757125730176116600 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 a0f2709c6973420b9e07fc5cc3fa1ef12a8e3d42..138f8e1936b448cb9185018ba57= 44d3c5445abd9 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 Sat Sep 6 14:58:50 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 1757125186178959.035491367362; Fri, 5 Sep 2025 19:19:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiUS-0006QT-Ck; Fri, 05 Sep 2025 22:17:20 -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 1uuiUI-0006EB-Dz; Fri, 05 Sep 2025 22:17:11 -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 1uuiTz-0007ky-TQ; Fri, 05 Sep 2025 22:17:09 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnm041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:15:36 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=Sc8FTNaJ6chbtPcBo7M9g5GEXppq2W5QBLE99E5rkoE=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124949; v=1; b=UbLW/JGhHYQWeZJvt1ev6c4iWB3IPKiL6+yx7Hp8mDcrv3NwOY9xLxbOGCWwwSVU x1JMP6EqByi8E4wgsnEdmx5gZDbzG9PC0Ee3Ce2rwQYsBdxTOCb0kKt8KVIchTXA gARYoDuGpE2lplQbAcTn+zqdJ/FXMIa7+ejzr0xWbGIewt+POAtHolhMeREgQBrM uPN+1FbTAwQhXQzNb5GiMw5yZ2UERwHD7klgptlvYwjNK4INK5S7WOAaflMKDjec 3WLukRt1Y7cP56ZcyQ+LZ1Rm2z1PIrEwfO3rBqSHQ7Wf7czBs+8vBj+L4zf038A4 DDS+55rb8Tcls+IYyXFcxA== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:26 +0200 Subject: [PATCH 17/22] 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: <20250906-use-v1-17-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 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: 1757125188298124100 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 dedc2674c002f9de8894e6c49cdb3989cb0deccc..cbaf4ad1548b94afa1480993072= 9eba169f1b061 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 Sat Sep 6 14:58:50 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 1757125759939557.8847869049811; Fri, 5 Sep 2025 19:29:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiZG-0005za-QR; Fri, 05 Sep 2025 22:22:18 -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 1uuiZC-0005rv-Dg; Fri, 05 Sep 2025 22:22:14 -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 1uuiYv-0000KS-KW; Fri, 05 Sep 2025 22:22:11 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnn041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:15:49 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=A2GlR2TJmK/k+sr8q7+ruESRjTfRwEx+idAZUzdfRKY=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124961; v=1; b=gQKGhaqM8Sqqe4hAJLZMUDcHa9pb5UIADjzTtI8YoxiPLRC8PE8/Pwt+bX0SYC5b NhoX+2gYZfdSx49NeaAIy3wRkoXfxnrVrrV7x9yUn9HEn59Flx8cw3mVzYBxrQ4m +7XdyRHgfbD660pTtzhwpt3uxLoO8eHhLwW8cY7b4FT9LUJAr4RnW1qCRqe0e5OX kpvAFSbTXI0Wv1HFvq7DbLIqG1V0u5hsB+JK4E2gaCkvplBMicCSG+MxvQ89hso9 74G3EqtN7MrccHE9V/uRv7s1ygYKzxcd6tDEEUxBIv7VZfZBi0Fl+nQq7wj/T6cV i9RUb03uyHO8MqTfuDK+8A== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:27 +0200 Subject: [PATCH 18/22] 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: <20250906-use-v1-18-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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: 1757125761103124100 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 f5ee6bf260f159249204571a366472f3e0d16dea..eebce1f787f464978f535356533= 294c5a0c7bea8 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 Sat Sep 6 14:58:50 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 1757125821749485.1506793777619; Fri, 5 Sep 2025 19:30:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiZv-0006mW-IX; Fri, 05 Sep 2025 22:22: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 1uuiZt-0006jy-Fv; Fri, 05 Sep 2025 22:22:57 -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 1uuiZf-0000N4-7B; Fri, 05 Sep 2025 22:22:56 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btno041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:16:02 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=XLOh5bKdwPf/hM03cxDhD82xMWslxlka8JwWwK6/WQo=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124973; v=1; b=wWdrdFC6ii7rM83GuNMZL9HjwJwbZY+dMMVO2CaVBqFt/r10XsscTTdUQHiEyx81 kAHM6G8XJXriQGKQxn7ZIW1EjdkusrznjgnMsydO196i2Anw85gFaZALai5U13ot lyrD/871G6yFdLLjRzbuNvbbQ5lbRo4ecR37GuYvaY9eUdlHvzH5qGwHFb02SHVG DGi+nRCI+N1qTqzpgbVkcj88o3c+/D/qO+DEYB5ok8V4fkPvtp7pEbo3ICANJUFY Ra1upp3np9pTXS4akT5W4xFuuPqcDcxjYaOoqQbp0jwdIxnOaysZNFzjSbYVNl0t IGSq4E6smU3VA34qGmj1Qg== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:28 +0200 Subject: [PATCH 19/22] pci: Do not delete the subregions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250906-use-v1-19-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125823590124100 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 516029f66cda6705bded15322cb6f7eb3d42f82c..2b408c7ec336df08086f1be9a5b= d2555e2e906b7 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 Sat Sep 6 14:58:50 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 1757125648298116.06149178311148; Fri, 5 Sep 2025 19:27:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiZm-0006iX-4W; Fri, 05 Sep 2025 22:22:50 -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 1uuiZj-0006gq-2m; Fri, 05 Sep 2025 22:22:47 -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 1uuiZN-0000Og-OJ; Fri, 05 Sep 2025 22:22:42 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnp041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:16:14 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=Qvj4+hZAXQ+HATM7aKOWvKVpmlqyAC4ni6CowomDhZk=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124986; v=1; b=u3oUoc5FS+ykl5ye/y72MYN+xpl/H+FpkE3N5flf8YijwL1Eup8sUzv1QZCfoJEv EB+w4DI5hDa+8I8MI0lZVrOR/d+YAI8PRSO+ZYaAo7rKkO+uBHpV1YJDlry9YqVN HFY+x3nd5sc/p766vyCs5/2RyeGxqLlPE7oLpNYamCSy1k+zf2fgIll7Aa8uSbV0 4JhvXCSM/+g1xaAL3qAqD6hfSvSHuhH7dhK22rde8YLVQUE0wwVwtYwnNGhRt7Gf 188wmUrhH5Jc1CSaM2L5V1DPhaGF3H4Sqm4d5HXGOjI6qzD49esGZhVttY0w7kA1 xmF/5WIUCHT/RRe2iHLMrA== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:29 +0200 Subject: [PATCH 20/22] 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: <20250906-use-v1-20-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125649683124100 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 1ac1185825e84ca908fd878f6cbe7e8cacac1d89..b4043ee752c5f9ab2c0f5800dff= a809d3c182225 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 Sat Sep 6 14:58:50 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 1757125768737180.95153890146537; Fri, 5 Sep 2025 19:29:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiVA-00083U-0g; Fri, 05 Sep 2025 22:18:04 -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 1uuiUv-0007c2-UQ; Fri, 05 Sep 2025 22:17:50 -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 1uuiUl-00083n-0s; Fri, 05 Sep 2025 22:17:44 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnq041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:16:26 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=YjEOA88OVLGi9vWo20mvtb9700xqRArT+mSkxNVX9R4=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757124998; v=1; b=ETeEpAt1bGU2DbBlOM8mK2CG0q8PVJOTb6xffWxfjU5mf95gdcsPQib9KUbgQoLK StyJ6EMYFQdZzgrVNh9JsxV+FYvIyJVAYe/00kW1naO38clE51XqqU8klZ+uPBG3 qk5sxih8B6M1C8uYNJKsAHTHEgQYVxBt+DyCZxUGcCDU9/WDNUHndO+xgdTGrCgc U5n6buxRYQ9F9sM4CnoSHvOHTt17Jhd0eyVRq0EeoAkO33qmaSw7M0iVY5CqT5UT 8Y5m39+CKRtCUw0bb61+yUAI0nprFdEtJ0YUSkQ/uhQsjR1xM3bsOMOS61Oki6I/ mA72NTvSzqUqItw64aubxQ== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:30 +0200 Subject: [PATCH 21/22] 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: <20250906-use-v1-21-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125781661124100 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 b090f253656ba17c7c6b3b805235a9360334baf5..21c3501455b5705b5e155acf9df= 2156b653f69bf 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 Sat Sep 6 14:58:50 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 1757125660320737.674054022424; Fri, 5 Sep 2025 19:27:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuiVV-0000DB-Ts; Fri, 05 Sep 2025 22:18:25 -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 1uuiVD-0008Iz-Uk; Fri, 05 Sep 2025 22:18:11 -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 1uuiUz-00084H-Kp; Fri, 05 Sep 2025 22:18:07 -0400 Received: from [10.40.4.92] (93-51-222-138.ip268.fastwebnet.it [93.51.222.138]) (authenticated bits=0) by www3579.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 5862Btnr041566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Sep 2025 11:16:39 +0900 (JST) (envelope-from odaki@rsg.ci.i.u-tokyo.ac.jp) DKIM-Signature: a=rsa-sha256; bh=mKUX+37+W6DCHXaSHKP3HQpAh7aEXoOw1LuL7ABZjxU=; c=relaxed/relaxed; d=rsg.ci.i.u-tokyo.ac.jp; h=From:Date:Subject:Message-Id:To; s=rs20250326; t=1757125010; v=1; b=X4P99cfpv2KVAQ+iA9GpqPomBdeTqycoyv0wgE8iFi6mxeHHZ/C9chaeY6HNkJ8Y 9nY/TAtkaeRBx3q8bDU732SbNfzaT0n7iOeG3lGnDrXUGQwE8TH04cJWlgPykR2F 7apmFBSWJob0OmDlYGaroLYuMjRMERfe6XTlxU7SMu5Q4uUSjoAHCWNJnFsMsQG/ Z3Yh/3TlQF9oNXt8wa5AouFw37soDbhVmrrjYJV7YmrhxUgMBXZS23ipsjCst+Cq /dUGTWNxD1BW4zN4y0lBn4dbw8fQwHkN0WUN5HW46E5tCJvRIlpuD3eJD3Vw/+Qy 04wSJ8/6cW6evV77Khie6A== From: Akihiko Odaki Date: Sat, 06 Sep 2025 04:11:31 +0200 Subject: [PATCH 22/22] 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: <20250906-use-v1-22-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> References: <20250906-use-v1-0-c51caafd1eb7@rsg.ci.i.u-tokyo.ac.jp> In-Reply-To: <20250906-use-v1-0-c51caafd1eb7@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.14.2 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1757125661593116600 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 292c378bfc98bf458f7f760cdb6f1f21f23a7633..b68a2aec317107ec36736f762b9= dccd71b53dc3e 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