From nobody Fri Aug 21 00:32:07 2026 X-Original-To: dev-commits-src-branches@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 4hR1Tg4pvVz6pNLK for ; Fri, 21 Aug 2026 00:32:07 +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 4hR1Tg4BlKz40DN for ; Fri, 21 Aug 2026 00:32:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787272327; 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=CNQrAoiy/laOd6dALL/fXRWuIqmuYmcTQPaKpjo8IcCaKVAgXQF5rLbzcf5mj8/0BB0yGO Lp0mcW57LzeuENjxJsPgkBKgGW6o4fvId1SGRcZzH8LVfEEa2C85zCJbPoYCDfmBo6DEcH rsGVTOrvAwwnGfpLR+e8/mjNdJL/m9nvW0zPMGuutZi4GHrBHHrvstQNlb0haLBQWm0Bn7 LnsEYcl5YJUzzt20hOAnkqb5SRSLzozNR83ZtJXeM6lJGcLUWj7P89lyJl1qz+kVakJ4pu rewnIBAH03O3qDUwYMAR/25DKscK74GhlkJqpTdMNSw634/2K4gyisYzHz8CtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787272327; a=rsa-sha256; cv=none; b=NQXefCRBzFsrdis82nbARgpWtjE9XoX69GK1qrGozeyGxRyyiDmu2kntvz0rU+e9JvEZGn 6aU+nV201qnb20WjfSYw+pkOpgTwUzwDy4peLBWuZhaWHgMqlop8blH4eOuX7fFJGghyY3 FrgcnQJdI5GJGrZ2z+1FWixRgw/9+gt+9gn7whcZyhcIL599Mg5nma4kMbCtOpCSx6QTfK vSBgfJ6mNs/FSJmk9+1/8paPZWY3mGQ6VojYFCgn0JRdmjeHRy5YsNYZwka/qZXSUUcARU EAG41R1dmAKG0EhvdSudW12vB2OCUcfBPIiGywBCjLH4yt3/XN71gXVMsiGlfg== 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=1787272327; 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=JpggrhTYvFmSkgulGj8NV2arqEX3iOy/yA/fk8RBr9KIRv9vvNR/J4ey62zT1H37ss/O3p 4M5pBJu12rZgNbzJ1PSkj4naxnx6RM33aKXfsGmkU2kHk1vdRME1bUWDfXK4vJGyaTYKlJ EUQYnQwW2cYZSiL5T5ZIGAvkApgQbU0A+1aiBslReONwvm1X2alAWbtu+Sh2QnDxzMi48e qpGnMCc4F/hlS3JxTewazAW/p9CyZFyhCcSqkMkD4uLlSpoYcve0dcWszTkD2hRT9uNx+o 7XLAQHKDqorSMkq4a/RtUuhjzhcVx3ugt1oC99l3xJD/D1IV1oyJKWlY/wHZdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hR1Tg2yXczh37 for ; Fri, 21 Aug 2026 00:32:07 +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: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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