x86/topology: Set cpu_die_id only if DIE_TYPE found
mainline inclusion from mainline-v5.11-rc1 commit cb09a379 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I7DX6V CVE: NA Reference: https://git.kernel.org/torvalds/c/cb09a379724d299c603a7a79f444f52a9a75b8d2 --------------------------- commit cb09a379 upstream. CPUID Leaf 0x1F defines a DIE_TYPE level (nb: ECX[8:15] level type == 0x5), but CPUID Leaf 0xB does not. However, detect_extended_topology() will set struct cpuinfo_x86.cpu_die_id regardless of whether a valid Die ID was found. Only set cpu_die_id if a DIE_TYPE level is found. CPU topology code may use another value for cpu_die_id, e.g. the AMD NodeId on AMD-based systems. Code ordering should be maintained so that the CPUID Leaf 0x1F Die ID value will take precedence on systems that may use another value. Suggested-by:Borislav Petkov <bp@alien8.de> Signed-off-by:
Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by:
Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20201109210659.754018-5-Yazen.Ghannam@amd.com Signed-off-by:
Pu Wen <puwen@hygon.cn>
Loading
Please sign in to comment