From nobody Fri Aug 21 00:32:07 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 4hR1Tn1fr3z6pMpQ for ; Fri, 21 Aug 2026 00:32:13 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hR1Tm5nSCz40Nw for ; Fri, 21 Aug 2026 00:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787272332; 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=Tnk7Tv3gl3Kik13o8RlVefcZFeZrVG/Qx/Kx1YLDfYg=; b=VmyV7B0q2weTzYS/zCDNhfCkDK1l6TRCYgebc1QiXIyCUAMBT9kX2/vhLwqH7cvIlgthOr mQQQ6RzIFKnVQ3gMfBA7LkUY4RRAXKBQmdMYfZukM9k+Aw3r5G1DNR782fZjMJAiN+VvrH GasROv0GpCRfm0F9pZqGo+Zh8CvFhzXLHfy1Cahk8OPtUuWKylq5wWG0bIAezqm+zeFbE5 t2D3PelqhDnRfbmh0DOAeudQrcQFqea3N32v8xUSNng5espH93G7Qpn1gsfQ7Us1umUNii 4ZXGvEVyQTcJcD2jCct+uFf1fNWEG6TlvZ3y0tb8FIeIGfo5dkqUEsL3TzMM+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787272332; a=rsa-sha256; cv=none; b=XFrMVwkxHGIuPQUxRkDKgO67LrjL64WT4jDmGYEwkntK5+V4fVMsXbgY2C1Ye3cVGm4lhw yMis1ONi9OH0pw8MFvweFm5EjkMoq6xi342/gDE25nau6PHxO1pm6SlFoyB3EdDGqKGKbX WxjOe3Q8bVPuWJeKh2wDbaAaV5DEoTf9Gz/ME5d8eOQGj6mvXAaemsuPNRuE5LhFEy0Db7 xJrxww1XefASYqsRzTcWpMrdHSGOrABYnPTuqyTB4N3Md0nQ1kLRs2/zM709vuKBy06WCM 2PwWM+vjXH1bTa9dw+qmGpCNblnA1GCgrWwUv4mRgQVW/j7DGdT2ZEHCJkuUMw== 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=1787272332; 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=Tnk7Tv3gl3Kik13o8RlVefcZFeZrVG/Qx/Kx1YLDfYg=; b=Mqarz5dy2G4TfAXEmOOA4k2UtmF46gLy5MHX2d9/sdiAYtZYsl1uAT82xkZ5qav2poranD SvCgNMkoFF2Z6P+oH1rJttyL+Xaou/+LZATCQuff72Oo+9WHQPcMZhRvMInRB1SbWkWhNy azv0/niYMvvvYlUyeNFLiX7afGzSLwfp0H+Zw8x9sWJZ+lqVmbeCUn963EtPj2PSMC2mjS jslRnZ44VXhfsLZYKhlxiEwXRU1lHh7qBzXPCMLwDTwr2WySujz8k80Uolq4pHXyhsHINB gyZ1H//CSqJMEot/wDQlLVoxY4rU0v6jYp3c579F1ncV2NVPeJhLa0HsQrUCMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hR1Tm44ztzhHZ for ; Fri, 21 Aug 2026 00:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22dc4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 21 Aug 2026 00:32:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 063f93740793 - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 063f937407938322b0d5c19777487ce83e00aae5 Auto-Submitted: auto-generated Date: Fri, 21 Aug 2026 00:32:07 +0000 Message-Id: <6a879c87.22dc4.713546a4@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=063f937407938322b0d5c19777487ce83e00aae5 commit 063f937407938322b0d5c19777487ce83e00aae5 Author: Kevin Bowling AuthorDate: 2026-08-07 13:30:06 +0000 Commit: Kevin Bowling CommitDate: 2026-08-21 00:31:59 +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. (cherry picked from commit 78547d542f776d366c36b5a2fc747ddfe99523c6) --- 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 fd4dc7413785..f40f68a48db9 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -6692,7 +6692,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 } @@ -6808,7 +6810,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