x86/cpu: Get cache info and setup cache cpumap for Hygon Dhyana
authorPu Wen <puwen@hygon.cn>
Sun, 23 Sep 2018 09:33:44 +0000 (17:33 +0800)
committerBorislav Petkov <bp@suse.de>
Thu, 27 Sep 2018 16:28:57 +0000 (18:28 +0200)
commitd4f7423efdd1419b17524d090ff9ff4024bcf09b
tree860b9b06a3c15f693013d6a6453f6450c632a5b6
parent7eae653c8071e06719efc0b6e4da27d6908e5a5a
x86/cpu: Get cache info and setup cache cpumap for Hygon Dhyana

The Hygon Dhyana CPU has a topology extensions bit in CPUID. With
this bit, the kernel can get the cache information. So add support in
cpuid4_cache_lookup_regs() to get the correct cache size.

The Hygon Dhyana CPU also discovers num_cache_leaves via CPUID leaf
0x8000001d, so add support to it in find_num_cache_leaves().

Also add cacheinfo_hygon_init_llc_id() and init_hygon_cacheinfo()
functions to initialize Dhyana cache info. Setup cache cpumap in the
same way as AMD does.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: bp@alien8.de
Cc: tglx@linutronix.de
Cc: mingo@redhat.com
Cc: hpa@zytor.com
Cc: x86@kernel.org
Cc: thomas.lendacky@amd.com
Link: https://lkml.kernel.org/r/2a686b2ac0e2f5a1f2f5f101124d9dd44f949731.1537533369.git.puwen@hygon.cn
arch/x86/include/asm/cacheinfo.h
arch/x86/kernel/cpu/cacheinfo.c
arch/x86/kernel/cpu/cpu.h
arch/x86/kernel/cpu/hygon.c