From nobody Fri Aug 7 13:46:42 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hGln41Khkz6n73b for ; Fri, 07 Aug 2026 13:46:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hGln34lQ0z3KXZ for ; Fri, 07 Aug 2026 13:46:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786110407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hz2jWNbhQ4AWHOmaGaiZYmO3pWSpFkX0bsh8S8q6Uuo=; b=VZ/i9gci51TpRau/xOEVUiTeLZJxjQWpFWLGqN0n/NJoxh5WkVW19mdiSTvKAIOpSwvYP0 bmbAIB9+q0hIKcdSd+p+6r7X3pVJRAPixyTMYHAjLs3iiK9+PGXEpLuEOcr+gT8JgP5Thl 1pwgLqSe2BtmF29aZmTeJY2+aU7CrkxVM6F6UhL57XQQtuXwes0OIN64L/FvRYyxWd2AaG N/79RsI56qP4IpPTAiPqfFIgcrLzWVqbLP9NSd1QK0sgNctu5+4lAaM85D4KZ2ybSMlWc+ f4Kas7FEaKa14s4Jwca6Jw6LzrllHEWlFX2ossh9xviOi4DrX/rGM0TBBozW0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786110407; a=rsa-sha256; cv=none; b=uuxkWVyuK98CCIJgfeJoOvxagYtCzEW57tbHkTW2+AMObCudUcKLfd3buIwxiMI6qETaGe D7ae+GbhHK0GJR9NFZKAm+mIURBCdz10gFaCEihzgLjGwQEgb1ptPWCnEMrLv24bRPHGAo irhieApvcyMtKGQh1Kp2XU9TjWGKGwLT9E39nzK0w0iEJbs9IwnC3TSmd/4Qsm9TjOPIuh V4CAcfx+ziAPEmvcWg6AOn9pUvJ8ZV/5ux71Fx/pNJ7PbAj2Wyisb2QIV2b4+F+37be5H5 tasWrBnfJXwGD/bKnQ72JP8yROHp7pR1JpHz3f5q+L1JkF00MlVrCf5rGemEdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786110407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hz2jWNbhQ4AWHOmaGaiZYmO3pWSpFkX0bsh8S8q6Uuo=; b=Z/Cz6tjBXOxmShca50YKTX0y/uApQh7gaqRmpBNrDitKgTvT2VyhOx6e4cMskZSDIAqu6y jyFsl474c1QNfsD6cCCpj0ALcFWbtnbPjC6H2Va5PT/GGvvN+TpIDlWQcaIL+vywe0VS09 Qafa/RvbEfaGbRXW6Z+w7L5wbu/IddMg6WUJIrNn1/apddFB3plUO03DtoLUC1oKf8+uaP G5bpjQN5ZC9bKCpGuATkcy8KiQqfgqdFVZXopGQ/IkkFcqGWRqpfHKbi04tmQvyWntVS1h 2vojy4XS1lOSufctwUmpG8vIZYT0Cho2sHPTVg9zR1yU6cEcebhmnDMGGc2GQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hGln33Qn6z18Gx for ; Fri, 07 Aug 2026 13:46:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3fc40 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 07 Aug 2026 13:46:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 78547d542f77 - main - pci: Skip PF SR-IOV state handling for VFs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78547d542f776d366c36b5a2fc747ddfe99523c6 Auto-Submitted: auto-generated Date: Fri, 07 Aug 2026 13:46:42 +0000 Message-Id: <6a75e1c2.3fc40.28d9dda8@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=78547d542f776d366c36b5a2fc747ddfe99523c6 commit 78547d542f776d366c36b5a2fc747ddfe99523c6 Author: Kevin Bowling AuthorDate: 2026-08-07 13:30:06 +0000 Commit: Kevin Bowling CommitDate: 2026-08-07 13:46:35 +0000 pci: Skip PF SR-IOV state handling for VFs A VF's pci_devinfo references its PF's pcicfg_iov for resource bookkeeping, but only the PF implements the SR-IOV capability. pci_cfg_save() and pci_cfg_restore() treated any non-NULL cfg.iov as an owned capability and accessed the PF capability offset in VF configuration space. Saving a VF could therefore replace the shared PF settings with unrelated VF register values. Skip SR-IOV capability save and restore for PCICFG_VF children. The generic PCI and PCIe state of the VF remains preserved. This is also required by drivers that save VF state around a PF-driven function-level reset. MFC after: 2 weeks --- sys/dev/pci/pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 749ee71b195f..83ea487bdaa5 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -6691,7 +6691,9 @@ pci_cfg_restore(device_t dev, struct pci_devinfo *dinfo) pci_resume_msix(dev); #ifdef PCI_IOV - if (dinfo->cfg.iov != NULL) + /* The SR-IOV capability is implemented only by PFs. */ + if (dinfo->cfg.iov != NULL && + (dinfo->cfg.flags & PCICFG_VF) == 0) pci_iov_cfg_restore(dev, dinfo); #endif } @@ -6807,7 +6809,9 @@ pci_cfg_save(device_t dev, struct pci_devinfo *dinfo, int setstate) pci_cfg_save_pcix(dev, dinfo); #ifdef PCI_IOV - if (dinfo->cfg.iov != NULL) + /* The SR-IOV capability is implemented only by PFs. */ + if (dinfo->cfg.iov != NULL && + (dinfo->cfg.flags & PCICFG_VF) == 0) pci_iov_cfg_save(dev, dinfo); #endif