From eb69d24beacb929ed8c2ec593346cae07ada4d74 Mon Sep 17 00:00:00 2001 From: txpeng Date: Thu, 10 Jul 2025 15:04:55 +0800 Subject: [PATCH] x86/cpu/hygon: fix missing resctrl_cpu_detect() in bsp_init helper commit d8df126349dad855cdfedd6bbf315bad2e901c2f upstream. Since upstream commit 923f3a2b48bdccb6a1d1f0dd48de03de7ad936d9 ("x86/resctrl: Query LLC monitoring properties once during boot"), resctrl_cpu_detect() has been moved from common cpu initialization code to vendor-specific bsp init helper, while hygon didn't put that call in their code. This triggers div-zero fault during early booting stage on our machines with X86_FEATURE_CQM* supported, where get_rdt_mon_resources() tries to calculate mon_l3_config with uninitialized boot_cpu_data.x86_cache_occ_scale. Fix the missing resctrl_cpu_detect() in hygon bsp init helper. Signed-off-by: Tianxiang Peng Reviewed-by: Hui Li --- arch/x86/kernel/cpu/hygon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/cpu/hygon.c b/arch/x86/kernel/cpu/hygon.c index 3da9c951ac31..5925d6c43670 100644 --- a/arch/x86/kernel/cpu/hygon.c +++ b/arch/x86/kernel/cpu/hygon.c @@ -16,6 +16,7 @@ #include #include #include +#include #ifdef CONFIG_X86_64 # include @@ -263,6 +264,7 @@ static void bsp_init_hygon(struct cpuinfo_x86 *c) x86_amd_ls_cfg_ssbd_mask = 1ULL << 10; } } + resctrl_cpu_detect(c); } static void early_init_hygon(struct cpuinfo_x86 *c) -- Gitee