From nobody Fri Aug 21 00:44:52 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 4hR1mP5c6pz6pP79 for ; Fri, 21 Aug 2026 00:44:53 +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 4hR1mN74b5z4565 for ; Fri, 21 Aug 2026 00:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787273093; 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=QAwKWYXl688KEVPq/6TqxoBta9KsyD5vLbaOXR+XGXk=; b=Rx2VaZEcpwjBogLdUG4DryaZ6IRMUU3zcWha6j79H9WpZe4OLVHAKaxEPRNX9BQ4ZDsf3c E+snxcVuM2WWwgpFQeO8pfKggzSkzSnoKou8TplEQz5XcgjZKZRFlNSs9T3lpYkqFbmfue lyZR7DM1mefxb3eLYR8tHLynKoXsssukyyWR4dSmQURjY4z0MHXF8Lmi7EtSqo8PfGKWYE 4/fOXwsiPBhLP72qoMQfbzY1o4PA4OU8IJeCtPsyBzzgSTWAwWQHaiLzSke00X87LAI0yg f8t1G9Dyn4jICn+QpJA/6NaKncHbWtN8hkXHKjZJWcgpZVIvvsaQf+VO+tNbmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787273093; a=rsa-sha256; cv=none; b=FNqbWPHfBlR0+FIzJsFXnNL7ERJN0qhRDDKQP0hDOrvR+/hpjbWrSLJvxMqdxL+0/dcDnc mOND16DvE6hqgNPxuT1VLVfEIU9CV/Fn75/lZC6P1RudVnTG9/ziZnblwtJkLpXrBm22qp OImhtkXHiHK93OkSDGrW3m5xaOXH/OrgryM1CO3ibj7bpVZpMQLe6nKEAhooaBK6f0FW4P 7nolY6xwr1NHVr4JKs+ujIfhc8AWIAuDNh05dmP8sTCkOhupQuGD0hlYzgN7An5gWJMFVD E34i+vbbBupjk+1rSTIKfBXuFdZJyn+AOdLY6sh/k/sUlZhaV78P3xO9P5Tvew== 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=1787273093; 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=QAwKWYXl688KEVPq/6TqxoBta9KsyD5vLbaOXR+XGXk=; b=QbNOvfc0Q7A/yN70DFWqJu+U+Q3fWo/XX+umcAgxgQVkixskJeEIkj/nhWtDCG9rEaY02R WlgE4+dXhyxVdGuy66PdbxKazaNf8S86HIKTD74Y5rHEn2Jg3XIm9VXDAxSUXmej1JJ0vk Gt8gOjVLSLEsCeMpQLCVrRKCy5eNpDJrF/DO1JiAkRoG3s5WuGqsSkea9csr1WUMXYAY0z nM/0lbnQVYdYdPJOtHqsd6x4yzfRWvLoUOgGMc5i8SCLJf0ZGmIKS1kx56OE9PG+1i2Jo8 sp6DcWt1fohT/yCALtVBrD7qWUEZNqPMZZ0m+GnsU2/JTU22kKUpUoSgD6Lvog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hR1mN5Dt3zhbw for ; Fri, 21 Aug 2026 00:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24365 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 21 Aug 2026 00:44:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 44fd85b1a55a - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 44fd85b1a55ad95fdc9c2ddf173151dcd8fb2d6c Auto-Submitted: auto-generated Date: Fri, 21 Aug 2026 00:44:52 +0000 Message-Id: <6a879f84.24365.79ffda1e@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=44fd85b1a55ad95fdc9c2ddf173151dcd8fb2d6c commit 44fd85b1a55ad95fdc9c2ddf173151dcd8fb2d6c Author: Kevin Bowling AuthorDate: 2026-08-07 13:30:06 +0000 Commit: Kevin Bowling CommitDate: 2026-08-21 00:43:03 +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 b56a6052e855..714e0498294f 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -6693,7 +6693,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 } @@ -6809,7 +6811,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