Re: [PATCH RFC 3/3] Expose the CPU/Steering Tag mapping via debugfs

From: fengchengwen

Date: Wed Nov 18 2026 - 20:00:39 EST


Hi Wei,

1. Should we consider cpu hotplug ? How about add cpus_read_lock() in start() and
release it in stop()
2. Does this support RCiEP device?

Other LGTM

Thanks,
Chengwen

On 10/1/2026 11:55 PM, Wei Huang wrote:
> Steering Tags (ST) are opaque, platform specific values obtained from the
> ACPI ST _DSM, and are only visible to the driver that asks for them. That
> makes it hard to validate whether firmware reports a sane mapping at all.
>
> Expose the mapping read-only in the debugfs directory of each Root Port
> that has ST _DSM support:
>
> # cat /sys/kernel/debug/pci/0000:00:01.1/tph_cpu_st
> cpu vm_st vm_xst vm_ph_ignore pm_st pm_xst pm_ph_ignore
> 0 0x03 0x0103 0 - - 0
> 1 0x03 0x0103 0 - - 0
>
> Each line holds the raw ST info the _DSM returns for one online CPU;
> invalid tags and failed queries are reported as "-".
>
> The interface is per Root Port because the _DSM is evaluated on the ACPI
> device of the host bridge above it. A system with multiple host bridges may
> return different tags for the same CPU, and the value that matters to a
> driver is the one for the Root Port its device sits below. Root Ports below
> the same host bridge report identical contents.
>
> The file is created during enumeration and removed with the device's
> debugfs directory in pci_destroy_dev(), which returns only once no read is
> running, so the pci_dev the file refers to stays valid.
>
> Signed-off-by: Wei Huang <wei.huang2@xxxxxxx>