Re: [PATCH v6 2/8] x86/hygon: Map CPU NodeIds to DF nodes
From: Borislav Petkov
Date: Tue Sep 29 2026 - 23:00:42 EST
On Mon, Sep 21, 2026 at 01:55:57PM +0800, Lin Wang wrote:
> +/**
> + * hygon_cpu_to_df_node() - Map CPU to dense DF CDD index
> + * @cpu: CPU index
> + *
> + * Hygon Fam18h exposes sparse physical node IDs via CPUID 0x8000001E
> + * ECX[7:0].
> + * This function translates the per-CPU physical node ID into a dense
> + * DF CDD index in [0, hygon_cdd_num()). The NodeId reported by CPUID in
> + * a guest may not describe the physical DF topology, so the translation
> + * is unavailable in guests.
> + *
> + * Return: DF CDD index on success, -EINVAL if @cpu is out of range,
> + * -ENODEV if CPU-to-DF mapping is unavailable or the physical node ID
> + * does not map to a known DF node.
> + */
> +int hygon_cpu_to_df_node(unsigned int cpu);
arch/x86/include/asm/hygon/node.h:81: * hygon_cpu_to_df_node() - Map CPU to dense DF CDD index
arch/x86/include/asm/hygon/node.h:95:int hygon_cpu_to_df_node(unsigned int cpu);
arch/x86/include/asm/hygon/node.h:138:static inline int hygon_cpu_to_df_node(unsigned int cpu)
arch/x86/kernel/hygon_node.c:586:int hygon_cpu_to_df_node(unsigned int cpu)
arch/x86/kernel/hygon_node.c:600:EXPORT_SYMBOL_GPL(hygon_cpu_to_df_node);
So why is this function in a header and exported to no one?
Pls export it only when you need it and until then, keep it in the .c file
only.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette