Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/resctrl: Add missing resctrl initialization for Hygon

Hygon CPUs supporting Platform QoS features currently undergo partial resctrl
initialization through resctrl_cpu_detect() in the Hygon BSP init helper and
AMD/Hygon common initialization code. However, several critical data
structures remain uninitialized for Hygon CPUs in the following paths:

- get_mem_config()-> __rdt_get_mem_config_amd():
rdt_resource::membw,alloc_capable
hw_res::num_closid

- rdt_init_res_defs()->rdt_init_res_defs_amd():
rdt_resource::cache
hw_res::msr_base,msr_update

Add the missing AMD/Hygon common initialization to ensure proper Platform QoS
functionality on Hygon CPUs.

Fixes: d8df126349da ("x86/cpu/hygon: Add missing resctrl_cpu_detect() in bsp_init helper")
Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251209062650.1536952-2-shenxiaochen@open-hieco.net

authored by

Xiaochen Shen and committed by
Borislav Petkov (AMD)
6ee98aab 0f61b186

+4 -2
+4 -2
arch/x86/kernel/cpu/resctrl/core.c
··· 825 825 826 826 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) 827 827 return __get_mem_config_intel(&hw_res->r_resctrl); 828 - else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) 828 + else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || 829 + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) 829 830 return __rdt_get_mem_config_amd(&hw_res->r_resctrl); 830 831 831 832 return false; ··· 988 987 { 989 988 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) 990 989 rdt_init_res_defs_intel(); 991 - else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) 990 + else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || 991 + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) 992 992 rdt_init_res_defs_amd(); 993 993 } 994 994