From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFACF606A320 for ; Mon, 30 Nov 2026 22:48:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=shazbot.org header.i=@shazbot.org header.a=rsa-sha256 header.s=fm3 header.b=U5AFtfox; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=daltwjYt Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYA9g-0006al-RK; Mon, 30 Nov 2026 17:47:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYA9d-0006Yr-AA for qemu-devel@nongnu.org; Mon, 30 Nov 2026 17:47:27 -0500 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYA9a-0003ZO-UZ for qemu-devel@nongnu.org; Mon, 30 Nov 2026 17:47:25 -0500 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 697451D00595 for ; Mon, 30 Nov 2026 17:47:21 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 30 Nov 2026 17:47:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shazbot.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1796078841; x=1796165241; bh=ePCsv5s5nC5pCTxklJ0HquWyUHQFCIED93z1Kwgz0T4=; b= U5AFtfoxO4SuwvRTFOlfEwuNY6HnWGptSADZG+a/GVfNAeJ/U/+GTxKzNdaIcROz Ut/i9w++Yz1TOK91UrJ25qDcfsGiuPVegFQMO9J5vSRMGylaV+fTcO1CkDC8PwMn ltL66jBqbJoFzAYnqwcCN9iyT1/SHLmuboZrJpYl8vs2wja3gf+8J9ZobfDShqQt QEV+grm6fpdY54JNbFbYm6GILSSOxPhYNeKh4nLOdLNhA+0VtdogiTU47c+V2xEQ Gx/KaEQ2zp27FV3qTUXPvCvcBI9GuAeRKWTyL5ZjpxbC6HyOsrVVzSO+vdbt5yfF viYx20jF1+Y8msL26DRV2Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1796078841; x= 1796165241; bh=ePCsv5s5nC5pCTxklJ0HquWyUHQFCIED93z1Kwgz0T4=; b=d altwjYt8/yjPu6AlPMXzM8NTxWh0bsx9JYblwno3sgCpLMuiY3xQtUPOUnyUAYhL iUvWfpbEdQxm+Os5WMfUEPY9b6aQTUd9aOI/fB3TQ6Izp9CM+rfuC/ECVboLoq2q fllFFufI8c1z54pG5yrCEay7t5swETAC7ICOkuATNx9heiEF6Wow83QFNqiq9LWH JwQu5MtzA0ejDnQ8luTm8U5VwGCmAuV6L2GVW2M6ReH/ffiucvvlzP9hsRWkqfYk kEhZ0JzOCXW8EGWYVOYmyX4c/cZDh2fC99g0xvtQFc+FwCYs40CMurwDMRQaAB3O xWzr4EnmAsgu15o3NCKTQ== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=shazbot.org a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796078841; d=shazbot.org; mf=PGFsZXhAc2hhemJvdC5vcmc+; rt=PHFlbXUtZGV2ZWxAbm9uZ251Lm9yZz4=; s=fm3:rsa-sha256:Z2i3xBYF7xRL+oDm9o7T9sSA4z05pLfyiFBESpjP67wXZI/ bVgkcHKBElmD79v+3RGfqGGgAQZhbY3kmALlevh6VWPW3pgF3SLOX4OTvKHAjI8f zygLyMMVlEBlqM2UKIpuqiKgwzJsV6FseaWyArqxodijOrJZO2+7/uIWz3gfyjMm nBrhqRQsoISlvdEEUL4tufXXCUn57RoNIPfXLcsSn2x0tCLvsYsK5TOtxV86UobZ 9bDkZqhe0BCyREc32lfj4h6OKXVWelOh/vcsy5zLZ9IUuVuM6bfXLugWrGxRJtgF ZZh89JP3/kcujQpLVUlpodDBEtfjOP8tNCDeitw==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-transfer-encoding,content-type,date,feedback-id, from,in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:MSTpEFaQoacwAtVg22c2FSaYyGh1q/a3FILxSi4SONw=:mP+K4ngPFLfdjd3jC5ZWg+VsnmHEGhmEMlqf9O+zOOM=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGaqODBX/0B7V1lTJBG3PB9pV7w6nKDMT+iWzN767csU4y9XM6Xl6PYCjAd1rPBk0 PIzpdlEkRY6/hE/O3QD1G72Id/cvQtydW4FqG7LfBjGKzXlWutGkQzO2/VDVDfNPPz5OvP NMjkPunZPajM0yvgGvgzbJMisYaoP5GpmGW5tvcuaiAHi+TQMgB4ZoUgPKuqRTOFFglv1b TwjywQ7XT5BD3pHhefJ2BXPNN+X0CGp8D1lRKavKAWmLLA0uz+Y9e0BqeELLGnIxaiU74x GtMh+1KSbUu7bcAdBlVMSPv+GaFd3lAWCJHZxMIb4A2uhv3pXI6q7sNLxlS3Zz5ztbgdPU Ax86XKNyDNhtxrcSoIBXbOxdq+kk+o5QFiLrrcE8Zsf+D3ooXgNzK1f4idNmfsMO8BOkkQ frI+wPbO04/WS6Eo0uKndagEM1bHjQfVkE1YwI9KhiFkmOnJnyI+abv6mwaEmLHCgP3YO4 sjTHQKFjCg43ohJ83qZNlZaZNN2qocquJT5l/Gjec4gZ2bkZ6z3CePiLdrwv+mBqLEbSgB kAlHcT8k4Rrf4VG52I4kpGgXEoh146EVFYjYE61vkqRrFgpbsZE66GbjLefngZ4esnH50J 14LTRwmbrGTWvp7ZyGThJLFCqCrmcpeP0V1crySettuN0g8tvK5O4xV2Zsww X-ME-Proxy: Feedback-ID: i03f14258:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Nov 2026 17:47:20 -0500 (EST) Date: Mon, 30 Nov 2026 15:47:18 -0700 From: Alex Williamson To: =?UTF-8?B?Q8OpZHJpYw==?= Le Goater Cc: qemu-devel@nongnu.org, alex@shazbot.org Subject: Re: [PATCH for-12.0 2/9] vfio/pci: Move vfio_mmap_set_enabled() to region.c Message-ID: <20261130154718.53615361@shazbot.org> In-Reply-To: <20261109090625.908592-3-clg@redhat.com> References: <20261109090625.908592-1-clg@redhat.com> <20261109090625.908592-3-clg@redhat.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=202.12.124.146; envelope-from=alex@shazbot.org; helo=fout-b3-smtp.messagingengine.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Mon, 9 Nov 2026 10:06:18 +0100 C=C3=A9dric Le Goater wrote: > vfio_mmap_set_enabled() iterates over BAR regions calling > vfio_region_mmaps_set_enabled(). Move it from pci-irq.c to region.c > and rename it to vfio_region_set_enabled(). I guess I don't understand the rename. We're only toggling the enable of the mmap MemoryRegions. The underlying MemoryRegions remain enabled. The rename suggests a broader scope than what the function does. Thanks, Alex >=20 > No functional change. >=20 > Signed-off-by: C=C3=A9dric Le Goater > --- > hw/vfio/pci.h | 1 - > hw/vfio/vfio-region.h | 4 +++- > hw/vfio/pci-irq.c | 15 +++------------ > hw/vfio/region.c | 12 +++++++++++- > 4 files changed, 17 insertions(+), 15 deletions(-) >=20 > diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h > index 2e6c90cbf8ff..3315fb4fbceb 100644 > --- a/hw/vfio/pci.h > +++ b/hw/vfio/pci.h > @@ -232,7 +232,6 @@ void vfio_update_msi(VFIOPCIDevice *vdev); > bool vfio_msix_early_setup(VFIOPCIDevice *vdev, Error **errp); > bool vfio_msi_setup(VFIOPCIDevice *vdev, int pos, Error **errp); > bool vfio_msix_setup(VFIOPCIDevice *vdev, int pos, Error **errp); > -void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled); > bool vfio_pci_interrupt_setup(VFIOPCIDevice *vdev, Error **errp); > void vfio_pci_intx_eoi(VFIODevice *vbasedev); > void vfio_pci_teardown_msi(VFIOPCIDevice *vdev); > diff --git a/hw/vfio/vfio-region.h b/hw/vfio/vfio-region.h > index abcfbacfff1b..51d4caf5dcd3 100644 > --- a/hw/vfio/vfio-region.h > +++ b/hw/vfio/vfio-region.h > @@ -42,7 +42,6 @@ uint64_t vfio_region_read(void *opaque, > int vfio_region_setup(Object *obj, VFIODevice *vbasedev, VFIORegion *reg= ion, > int index, const char *name, Error **errp); > int vfio_region_mmap(VFIORegion *region); > -void vfio_region_mmaps_set_enabled(VFIORegion *region, bool enabled); > void vfio_region_exit(VFIORegion *region); > void vfio_region_finalize(VFIORegion *region); > =20 > @@ -51,4 +50,7 @@ int vfio_region_setup_sparse_mmaps(VFIORegion *region, > struct vfio_region_info *info, > Error **errp); > =20 > +struct VFIOPCIDevice; > +void vfio_region_set_enabled(struct VFIOPCIDevice *vdev, bool enabled); > + > #endif /* HW_VFIO_REGION_H */ > diff --git a/hw/vfio/pci-irq.c b/hw/vfio/pci-irq.c > index c68be22f8723..2b2a118b130a 100644 > --- a/hw/vfio/pci-irq.c > +++ b/hw/vfio/pci-irq.c > @@ -93,7 +93,7 @@ static void vfio_intx_mmap_enable(void *opaque) > return; > } > =20 > - vfio_mmap_set_enabled(vdev, true); > + vfio_region_set_enabled(vdev, true); > } > =20 > static void vfio_intx_interrupt(void *opaque) > @@ -109,7 +109,7 @@ static void vfio_intx_interrupt(void *opaque) > =20 > vdev->intx.pending =3D true; > pci_irq_assert(pdev); > - vfio_mmap_set_enabled(vdev, false); > + vfio_region_set_enabled(vdev, false); > if (vdev->intx.mmap_timeout) { > timer_mod(vdev->intx.mmap_timer, > qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + vdev->int= x.mmap_timeout); > @@ -389,7 +389,7 @@ void vfio_intx_disable(VFIOPCIDevice *vdev) > vfio_device_irq_disable(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); > vdev->intx.pending =3D false; > pci_irq_deassert(pdev); > - vfio_mmap_set_enabled(vdev, true); > + vfio_region_set_enabled(vdev, true); > =20 > fd =3D event_notifier_get_fd(&vdev->intx.interrupt); > qemu_set_fd_handler(fd, NULL, NULL, vdev); > @@ -1439,15 +1439,6 @@ void vfio_pci_teardown_msi(VFIOPCIDevice *vdev) > } > } > =20 > -void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled) > -{ > - int i; > - > - for (i =3D 0; i < PCI_ROM_SLOT; i++) { > - vfio_region_mmaps_set_enabled(&vdev->bars[i].region, enabled); > - } > -} > - > /* > * Err/Req notifiers > */ > diff --git a/hw/vfio/region.c b/hw/vfio/region.c > index 30bc5079f1a7..d54d5e34cef5 100644 > --- a/hw/vfio/region.c > +++ b/hw/vfio/region.c > @@ -30,6 +30,7 @@ > #include "qemu/units.h" > #include "monitor/monitor.h" > #include "system/ramblock.h" > +#include "pci.h" > #include "vfio-helpers.h" > =20 > /* > @@ -539,7 +540,7 @@ void vfio_region_finalize(VFIORegion *region) > region->nr =3D 0; > } > =20 > -void vfio_region_mmaps_set_enabled(VFIORegion *region, bool enabled) > +static void vfio_region_mmaps_set_enabled(VFIORegion *region, bool enabl= ed) > { > int i; > =20 > @@ -556,3 +557,12 @@ void vfio_region_mmaps_set_enabled(VFIORegion *regio= n, bool enabled) > trace_vfio_region_mmaps_set_enabled(memory_region_name(region->mem), > enabled); > } > + > +void vfio_region_set_enabled(VFIOPCIDevice *vdev, bool enabled) > +{ > + int i; > + > + for (i =3D 0; i < PCI_ROM_SLOT; i++) { > + vfio_region_mmaps_set_enabled(&vdev->bars[i].region, enabled); > + } > +}