From nobody Tue Sep 22 15:05:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1780585727; cv=none; d=zohomail.com; s=zohoarc; b=SFuKaeNZoCK/nmcg53vjs9IZCAtZXKMmIGSqQIti0WfV4cieKSvmNXn4LvFXoXJs2F//xpIQeybq7JNEY0LzSEoRLnap7j6sd169VlDBfW/TBXSuz1qHoYNgE8a7zR7aT1vEMHSn3LjO/f+5cdhSKzYaKoARjPFYH5CIwHfjxBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780585727; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xaX3iBh5aQ6ieP4wRDACjZGRgQdbq9tB2uoE6aInkl8=; b=HGV5l0LkOkafop1nksqcxew3LhzPd0r5xltkNz1ckp9a/KSqDBLgObqvNMh7gCd4sxThmbay8kxICq473H5/+JFBPXOx+m0PvLQmVlpR0Pp9D+Hgr/kQxhszThBWAcQ6nSHOMPuwjrT5cZ3ya2hXLuErcMfII0SPHONk/bvr4MY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1780585727083990.3213220208305; Thu, 4 Jun 2026 08:08:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1328027.1592717 (Exim 4.92) (envelope-from ) id 1wV9gC-0005XE-6o; Thu, 04 Jun 2026 15:08:20 +0000 Received: by outflank-mailman (output) from mailman id 1328027.1592717; Thu, 04 Jun 2026 15:08:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wV9gB-0005U4-TA; Thu, 04 Jun 2026 15:08:19 +0000 Received: by outflank-mailman (input) for mailman id 1328027; Thu, 04 Jun 2026 15:02:08 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wV9aB-00046h-T0 for xen-devel@lists.xenproject.org; Thu, 04 Jun 2026 15:02:08 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wV9aB-00ALcc-9a for xen-devel@lists.xenproject.org; Thu, 04 Jun 2026 17:02:07 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a219360-bab6-0a2a0a5309dd-0a2a4504ca5a-42 for ; Thu, 04 Jun 2026 17:02:07 +0200 Received: from [209.85.216.54] (helo=mail-pj1-f54.google.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a21936d-1dec-0a2a45040019-d155d836c520-3 for ; Thu, 04 Jun 2026 17:02:07 +0200 Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-36ab8816a35so480701a91.1 for ; Thu, 04 Jun 2026 08:02:06 -0700 (PDT) Received: from localhost ([2a03:2880:7ff:41::]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36f6d109dcdsm4398717a91.9.2026.06.04.08.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2026 08:02:03 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780585325; x=1781190125; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xaX3iBh5aQ6ieP4wRDACjZGRgQdbq9tB2uoE6aInkl8=; b=Ifx0RzeWY15z2I60MHVeDWX1r9Erb4zYyBD1EA3U3TzXlRkObNYRfhkA7sIqKFO4CI YObzC0ygy/8KNYyR4ofNwYjCoO6zJebsIMmXQChIyK/DyNuJ47X6VYMxLCOtl4ygVyJy gUBRdTnKH/mu1/+523z/nyRYNyhujAN/0cghjaXMQ6YvgHqh0RaTeVsrVgn+1YhgGQ+9 Pxccshm0Lpog5dqId8Vf90P++p6kBwyedU1pgFrnvXIXfeNZn3FF2PNWin0B83F+ZMlN Bv/go44szf5O/VlEmY9it+WWFLiqpYhchsJ0dn8h0ft00mMnuh4iZidEucB5mK2+cYXr Y5+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780585325; x=1781190125; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xaX3iBh5aQ6ieP4wRDACjZGRgQdbq9tB2uoE6aInkl8=; b=OOWTmtc1+vyi2vVRL4SYD5jc+FxKs1S8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a:1ed8:6fe6 with SMTP id 98e67ed59e1d1-36e332f7e45mr8166646a91.24.1780585324132; Thu, 04 Jun 2026 08:02:04 -0700 (PDT) From: Dimitri Daskalakis To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Mahesh J Salgaonkar , Oliver O'Halloran , Niklas Schnelle , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Alex Williamson , Jason Gunthorpe , Kevin Tian , Ankit Agrawal , Leon Romanovsky , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Keith Busch , Alexander Duyck , Jakub Kicinski , Dimitri Daskalakis , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [RFC 06/12] PCI: Convert vfio_pci_core.c to pci_is_sriov_* helpers Date: Thu, 4 Jun 2026 08:01:47 -0700 Message-ID: <20260604150153.3619662-7-dimitri.daskalakis1@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260604150153.3619662-1-dimitri.daskalakis1@gmail.com> References: <20260604150153.3619662-1-dimitri.daskalakis1@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-ebf023/1780585327-4197A3FF-2626D5A3/0/0 X-purgate-type: clean X-purgate-size: 2535 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1780585728140158500 Content-Type: text/plain; charset="utf-8" From: Dimitri Daskalakis No functional changes. Assisted-by: Claude:claude-opus-4.7 Signed-off-by: Dimitri Daskalakis --- drivers/vfio/pci/vfio_pci_core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_c= ore.c index 3f8d093aacf8..ad8069612cb2 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -1856,7 +1856,7 @@ int vfio_pci_core_match_token_uuid(struct vfio_device= *core_vdev, * * If the VF token is provided but unused, an error is generated. */ - if (vdev->pdev->is_virtfn) { + if (pci_is_sriov_virtfn(vdev->pdev)) { struct vfio_pci_core_device *pf_vdev =3D vdev->sriov_pf_core_dev; bool match; =20 @@ -1979,13 +1979,13 @@ static int vfio_pci_bus_notifier(struct notifier_bl= ock *nb, struct pci_dev *physfn =3D pci_physfn(pdev); =20 if (action =3D=3D BUS_NOTIFY_ADD_DEVICE && - pdev->is_virtfn && physfn =3D=3D vdev->pdev) { + pci_is_sriov_virtfn(pdev) && physfn =3D=3D vdev->pdev) { pci_info(vdev->pdev, "Captured SR-IOV VF %s driver_override\n", pci_name(pdev)); WARN_ON(device_set_driver_override(&pdev->dev, vdev->vdev.ops->name)); } else if (action =3D=3D BUS_NOTIFY_BOUND_DRIVER && - pdev->is_virtfn && physfn =3D=3D vdev->pdev) { + pci_is_sriov_virtfn(pdev) && physfn =3D=3D vdev->pdev) { struct pci_driver *drv =3D pci_dev_driver(pdev); =20 if (drv && drv !=3D pci_dev_driver(vdev->pdev)) @@ -2005,7 +2005,7 @@ static int vfio_pci_vf_init(struct vfio_pci_core_devi= ce *vdev) struct pci_dev *physfn; int ret; =20 - if (pdev->is_virtfn) { + if (pci_is_sriov_virtfn(pdev)) { /* * If this VF was created by our vfio_pci_core_sriov_configure() * then we can find the PF vfio_pci_core_device now, and due to @@ -2025,7 +2025,7 @@ static int vfio_pci_vf_init(struct vfio_pci_core_devi= ce *vdev) } =20 /* Not a SRIOV PF */ - if (!pdev->is_physfn) + if (!pci_is_sriov_physfn(pdev)) return 0; =20 vdev->vf_token =3D kzalloc_obj(*vdev->vf_token); @@ -2166,7 +2166,7 @@ int vfio_pci_core_register_device(struct vfio_pci_cor= e_device *vdev) return -EBUSY; } =20 - if (pci_is_root_bus(pdev->bus) || pdev->is_virtfn) { + if (pci_is_root_bus(pdev->bus) || pci_is_sriov_virtfn(pdev)) { ret =3D vfio_assign_device_set(&vdev->vdev, vdev); } else if (!pci_probe_reset_slot(pdev->slot)) { ret =3D vfio_assign_device_set(&vdev->vdev, pdev->slot); --=20 2.52.0