[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250616100231.1238313-1-txpeng@tencent.com>
Date: Mon, 16 Jun 2025 18:02:31 +0800
From: Tianxiang Peng <luminosity1999@...il.com>
To: puwen@...on.cn,
tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org,
Tianxiang Peng <txpeng@...cent.com>,
Hui Li <caelli@...cent.com>,
Hao Peng <flyingpeng@...cent.com>
Subject: [PATCH] x86/cpu/hygon: fix missing resctrl_cpu_detect() in bsp_init helper
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 <txpeng@...cent.com>
Reviewed-by: Hui Li <caelli@...cent.com>
Reviewed-by: Hao Peng <flyingpeng@...cent.com>
---
arch/x86/kernel/cpu/hygon.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kernel/cpu/hygon.c b/arch/x86/kernel/cpu/hygon.c
index 2154f12766fb..1fda6c3a2b65 100644
--- a/arch/x86/kernel/cpu/hygon.c
+++ b/arch/x86/kernel/cpu/hygon.c
@@ -16,6 +16,7 @@
#include <asm/spec-ctrl.h>
#include <asm/delay.h>
#include <asm/msr.h>
+#include <asm/resctrl.h>
#include "cpu.h"
@@ -117,6 +118,8 @@ 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)
--
2.43.5
Powered by blists - more mailing lists