Skip to content

Commit d8df126

Browse files
Tianxiang Pengbp3tk0v
authored andcommitted
x86/cpu/hygon: Add missing resctrl_cpu_detect() in bsp_init helper
Since 923f3a2 ("x86/resctrl: Query LLC monitoring properties once during boot") resctrl_cpu_detect() has been moved from common CPU initialization code to the vendor-specific BSP init helper, while Hygon didn't put that call in their code. This triggers a division by 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. Add the missing resctrl_cpu_detect() in the Hygon BSP init helper. [ bp: Massage commit message. ] Fixes: 923f3a2 ("x86/resctrl: Query LLC monitoring properties once during boot") Signed-off-by: Tianxiang Peng <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Hui Li <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/[email protected]
1 parent c17b750 commit d8df126

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kernel/cpu/hygon.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <asm/spec-ctrl.h>
1717
#include <asm/delay.h>
1818
#include <asm/msr.h>
19+
#include <asm/resctrl.h>
1920

2021
#include "cpu.h"
2122

@@ -117,6 +118,8 @@ static void bsp_init_hygon(struct cpuinfo_x86 *c)
117118
x86_amd_ls_cfg_ssbd_mask = 1ULL << 10;
118119
}
119120
}
121+
122+
resctrl_cpu_detect(c);
120123
}
121124

122125
static void early_init_hygon(struct cpuinfo_x86 *c)

0 commit comments

Comments
 (0)