git: dbdc129981c3 - stable/15 - pcib: Only apply ARI translation to a bridge's own secondary bus
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 08 Oct 2026 20:44:17 UTC
The branch stable/15 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=dbdc129981c35b771f538e9f6c6a72b32b7858a0
commit dbdc129981c35b771f538e9f6c6a72b32b7858a0
Author: Osvaldo Janeri Filho <ojanerif@amd.com>
AuthorDate: 2026-09-30 15:04:08 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-10-08 20:42:33 +0000
pcib: Only apply ARI translation to a bridge's own secondary bus
ARI changes RID interpretation only for the device on a downstream
port's secondary bus. pcib_xlate_ari() applied that translation to
every config access through an ARI-enabled bridge, including cycles
forwarded to a subordinate bus.
A non-zero slot on a subordinate bus then panics an INVARIANTS kernel
and is misrouted otherwise. Translate only when the access targets
this bridge's secondary bus.
Reviewed by: kib, jhb
Fixes: 55d3ea1731d1 ("Add support for PCIe ARI")
Sponsored by: AMD
Differential Revision: https://reviews.freebsd.org/D60033
(cherry picked from commit 10409ee40baf593b810cd0140f3c2f0d737c1a65)
---
sys/dev/pci/pci_pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
index 3b4b15b25fa7..475202873ff7 100644
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -2346,7 +2346,8 @@ pcib_xlate_ari(device_t pcib, int bus, int *slot, int *func)
sc = device_get_softc(pcib);
ari_func = *func;
- if (sc->flags & PCIB_ENABLE_ARI) {
+ /* ARI applies only to this port's secondary bus. */
+ if ((sc->flags & PCIB_ENABLE_ARI) && bus == sc->bus.sec) {
KASSERT(*slot == 0,
("Non-zero slot number with ARI enabled!"));
*slot = PCIE_ARI_SLOT(ari_func);