From nobody Sat Sep 05 00:31:22 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 4hcDlt4Pf1z6qZ4R for ; Sat, 05 Sep 2026 00:31:22 +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 4hcDlt2dxqz42V4 for ; Sat, 05 Sep 2026 00:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788568282; 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=q054s9UAOjdXCG5Kjqrw/pxVxQ8z+bJw730K6V/0s0c=; b=y3lDAH+vIKCsCXBOdgISxE8COx0UbVaDmJqJMt1sQNUICYKE0KXJvtD0JDL/iO9DyTdtYo 3OxsYyIIwYTUCkQIbAN9WvwMtLLIBh5n/HpRm70yAwdnk/v6SgEM+Y7iCMS/+xZ+3fbxoP WlvzSbhggtJy9gdxBTwktapADCzfWk3R1epi8kdRpQ1oHvvxXK/Iv4zfZwqDA4Wm4JY2ui ALRyCvgQiOq5LMlGjcmWSaRu6CQGzRLsO3Mo/YXrLbtMPDv3YQfWfsaQtGPgMNRz1NYl6n QtR9EPhIBzVit1/Jo9ZWRHIQ5itYvpt1WuGuAhU7Yl/M7MeqIkzwsrPZY5azTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788568282; a=rsa-sha256; cv=none; b=mqixT3jbXtD81mcm5LqDFn9wjSuINrURBfSUj5p7oqK2b1LMvo0uUR8BNGsNlPFuUJeckS V0lmkJgZ+r5t62lCT2c8w+CRzCLNvgh9rXdDs6Cpf73P1h7eKAUsLQ7UQpUyJcThP7v6vF c9/US10rAmDJ2H0Nyy+5UNzvJFCrCIZPC5Kb1fHrisk40hgtuVbyuVV6s/uKBBPRMoyxeJ K86oLPVC3eZ+HZpxz27MZYm3ld5lUanyA5p5VkFJrZsvxCQQWvOurU9t25ejdgTTSUy7nH fkvbx5umxADwgmULSS3RidmtgI3Et1DORWgXTcqtwZLu+rbiC0DnJviE6wMm/g== 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=1788568282; 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=q054s9UAOjdXCG5Kjqrw/pxVxQ8z+bJw730K6V/0s0c=; b=u4c9If65T2cArcxM8HlEfgqRdWAJxTWkxUuXurbF6vGMPhCKWgkSj0AqJup1D4oHR4av2o xAA/o5JWKuOTH/BD4rGj5mWr1CB3f7NcZagHVhKziI1jesj8fMEIdx03eAdETY8GJYlO9e ehom7mBovgBQuBz1p8b/njHRIuOC26YWXEiatUsmKwi0XBm0WF5Nn9BZlxBLYHIWb08z6m SDzo5dB1qeQKOU9xDIHtAcsnIdoJeAKhi/5mCypXCClyBE6A4nIlD5W4cakUTsXqAmyuek xhuf//i6LbxbCfSV3d/4xom7E2CdAitBqs0EfOE/c1qT7boVB1CtmvaCSk70/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hcDlt0sJ3z736 for ; Sat, 05 Sep 2026 00:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20402 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 05 Sep 2026 00:31:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b88d20eb0241 - stable/14 - pci: Expose a VF's owning PF to bus subclasses 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/14 X-Git-Reftype: branch X-Git-Commit: b88d20eb024110e563352ad2beb83817ed1f08bc Auto-Submitted: auto-generated Date: Sat, 05 Sep 2026 00:31:22 +0000 Message-Id: <6a9b62da.20402.66e96c7e@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b88d20eb024110e563352ad2beb83817ed1f08bc commit b88d20eb024110e563352ad2beb83817ed1f08bc Author: Kevin Bowling AuthorDate: 2026-08-22 03:14:37 +0000 Commit: Kevin Bowling CommitDate: 2026-09-05 00:31:07 +0000 pci: Expose a VF's owning PF to bus subclasses ofw_pcibus now uses pci_iov_get_pf() to inherit PF locality for VFs, but the accessor was inadvertently left in an uncommited ACPI change. This breaks powerpc builds. Expose the accessor from the PCI core and provide a stub when PCI_IOV is omitted. Record VF ownership before pci_add_child() so child added callbacks can safely query it, and remove the later redundant assignment. Sponsored by: BBOX.io (cherry picked from commit 3481a9cdc4dc26ef583bb0f46a04d5d059cde466) --- sys/dev/pci/pci.c | 25 +++++++++++++++++++++++++ sys/dev/pci/pci_iov.c | 1 - sys/dev/pci/pci_private.h | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index e947d9b4f6b4..becda495f92a 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -4394,10 +4394,23 @@ pci_rescan_method(device_t dev) } #ifdef PCI_IOV +device_t +pci_iov_get_pf(device_t dev) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + if (dinfo == NULL || (dinfo->cfg.flags & PCICFG_VF) == 0 || + dinfo->cfg.iov == NULL) + return (NULL); + return (dinfo->cfg.iov->iov_pf); +} + device_t pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, uint16_t did) { + struct pci_devinfo *pf_dinfo; struct pci_devinfo *vf_dinfo; device_t pcib; int busno, slot, func; @@ -4409,6 +4422,11 @@ pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, vf_dinfo = pci_fill_devinfo(pcib, bus, pci_get_domain(pcib), busno, slot, func, vid, did); + /* Make the VF-to-PF relationship available to child-added callbacks. */ + pf_dinfo = device_get_ivars(pf); + KASSERT(pf_dinfo->cfg.iov != NULL, + ("SR-IOV PF %s has no IOV state", device_get_nameunit(pf))); + vf_dinfo->cfg.iov = pf_dinfo->cfg.iov; vf_dinfo->cfg.flags |= PCICFG_VF; pci_add_child(bus, vf_dinfo); @@ -4422,6 +4440,13 @@ pci_create_iov_child_method(device_t bus, device_t pf, uint16_t rid, return (pci_add_iov_child(bus, pf, rid, vid, did)); } +#else +device_t +pci_iov_get_pf(device_t dev __unused) +{ + + return (NULL); +} #endif static int diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index ecae70ca0d4a..60547983277d 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -658,7 +658,6 @@ pci_iov_enumerate_vfs(struct pci_devinfo *dinfo, const nvlist_t *config, vfinfo = device_get_ivars(vf); - vfinfo->cfg.iov = iov; vfinfo->cfg.vf.index = i; pci_iov_add_bars(iov, vfinfo); diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index 0b20f20fbb42..9dd03e56bd14 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -120,6 +120,7 @@ void pci_add_children(device_t dev, int domain, int busno); void pci_add_child(device_t bus, struct pci_devinfo *dinfo); /* Call after cold enumeration and before attaching the bus's children. */ void pcie_reconcile_link_mps(device_t bus); +device_t pci_iov_get_pf(device_t dev); device_t pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, uint16_t did); void pci_add_resources(device_t bus, device_t dev, int force,