git: dc4f80da18f0 - main - acpi_pci: Preserve CPU locality queries for descendants

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Thu, 27 Aug 2026 22:49:32 UTC
The branch main has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=dc4f80da18f0dcc557a969b4283a86569266eb5c

commit dc4f80da18f0dcc557a969b4283a86569266eb5c
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-27 06:21:59 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-27 22:48:47 +0000

    acpi_pci: Preserve CPU locality queries for descendants
    
    bus_generic_get_cpus() preserves the original leaf device while
    forwarding a request through the bus hierarchy. Consequently,
    acpi_pci_get_cpus() may receive a descendant below a PCI function
    rather than one of the PCI bus's direct children.
    
    Only apply the SR-IOV PF-locality mapping to direct PCI children.
    Preserve the previous ACPI CPU-locality lookup for descendants so their
    unrelated bus ivars are not interpreted as PCI device information.
    
    Reviewed by:    jhb
    MFC after:      2 weeks
    Sponsored by:   BBOX.io
    Differential Revision:  https://reviews.freebsd.org/D59206
---
 sys/dev/acpica/acpi_pci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/dev/acpica/acpi_pci.c b/sys/dev/acpica/acpi_pci.c
index 56ae2ce3dda4..8b6aeb69f593 100644
--- a/sys/dev/acpica/acpi_pci.c
+++ b/sys/dev/acpica/acpi_pci.c
@@ -222,6 +222,9 @@ acpi_pci_get_cpus(device_t dev, device_t child, enum cpu_sets op,
     size_t setsize, cpuset_t *cpuset)
 {
 
+	/* BUS_GET_CPUS may preserve a descendant below the PCI function. */
+	if (device_get_parent(child) != dev)
+		return (acpi_get_cpus(dev, child, op, setsize, cpuset));
 	child = acpi_pci_get_locality_device(child);
 	return (acpi_get_cpus(dev, child, op, setsize, cpuset));
 }