Re: [patch v5 11/19] x86/cpu: Use common topology code for AMD

From: Thomas Gleixner
Date: Mon Feb 12 2024 - 09:50:17 EST


On Tue, Feb 06 2024 at 16:58, Borislav Petkov wrote:
> On Tue, Jan 23, 2024 at 01:53:47PM +0100, Thomas Gleixner wrote:
>> --- a/arch/x86/kernel/cpu/mce/inject.c
>> +++ b/arch/x86/kernel/cpu/mce/inject.c
>> @@ -433,8 +433,7 @@ static u32 get_nbc_for_node(int node_id)
>> struct cpuinfo_x86 *c = &boot_cpu_data;
>> u32 cores_per_node;
>>
>> - cores_per_node = (c->x86_max_cores * smp_num_siblings) / amd_get_nodes_per_socket();
>> -
>> + cores_per_node = (c->x86_max_cores * smp_num_siblings) / topology_amd_nodes_per_pkg();
>> return cores_per_node * node_id;
>> }
>
> One more hunk depending on what goes in when and in what order, to fix
> a build issue from the RAS tree:
>
> ERROR: modpost: "amd_get_nodes_per_socket" [drivers/ras/amd/atl/amd_atl.ko] undefined!
> make[2]: *** [scripts/Makefile.modpost:145: Module.symvers] Error 1
> make[1]: *** [/mnt/kernel/kernel/2nd/linux/Makefile:1873: modpost] Error 2
> make: *** [Makefile:240: __sub-make] Error 2

Hrm. That is unfortunate, but we really don't want to mix the RAS
tree. So this needs a fixup in next and in the pull requests.