Re: [PATCH v6 1/9] x86/topology: Export topo_lookup_cpuid() for resctrl use

From: Reinette Chatre

Date: Wed Aug 19 2026 - 18:55:56 EST


Hi Chenyu,

On 7/25/26 2:22 AM, Chen Yu wrote:
> Enhanced RDT (ERDT) enumerates its monitoring and control resources

Please use at least 80 characters per line. The checkpatch warnings about 75
characters can be ignored. For context, please see
https://lore.kernel.org/lkml/20250916105447.GCaMlB976WLxHHeNMD@fat_crate.local/

Please check entire series.

> through ACPI tables that identify each CPU by its x2APIC ID. To
> associate this firmware-provided data with the kernel's per-CPU
> structures, ERDT must translate those x2APIC IDs into logical CPU
> numbers.
>
> topo_lookup_cpuid() already performs this translation, but it is
> static to topology.c and therefore not reachable from resctrl.
>
> Export topo_lookup_cpuid() and add its declaration to asm/apic.h so

To support this change you could add a motivation why this particular
header file was chosen. For example,
"add its declaration to asm/apic.h" -> "add its declaration to asm/apic.h
that already exposes the inverse mapping"

> that ERDT can resolve x2APIC IDs from ACPI tables to logical CPU
> numbers.
>
> No functional change intended.
>
> Signed-off-by: Chen Yu <yu.c.chen@xxxxxxxxx>
> Tested-by: Hongyu Ning <hongyu.ning@xxxxxxxxxxxxxxx>
> ---

| Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette