[PATCH 14/32] x86/tsc: Stop using 32-bit MSR interfaces
From: Juergen Gross
Date: Mon Jun 29 2026 - 02:09:51 EST
The 32-bit MSR interfaces rdmsr() and rdmsr_safe() are planned to be
removed. Use the related 64-bit variants instead.
Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
arch/x86/kernel/tsc.c | 6 +++---
arch/x86/kernel/tsc_msr.c | 15 ++++++++-------
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index ce10ae4b298b..723347e2cf7f 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1221,11 +1221,11 @@ static void __init check_system_tsc_reliable(void)
if (is_geode_lx()) {
/* RTSC counts during suspend */
#define RTSC_SUSP 0x100
- unsigned long res_low, res_high;
+ u64 res;
- rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high);
+ rdmsrq_safe(MSR_GEODE_BUSCONT_CONF0, &res);
/* Geode_LX - the OLPC CPU has a very reliable TSC */
- if (res_low & RTSC_SUSP)
+ if (res & RTSC_SUSP)
tsc_clocksource_reliable = 1;
}
#endif
diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c
index 48e6cc1cb017..d74743c8d2a4 100644
--- a/arch/x86/kernel/tsc_msr.c
+++ b/arch/x86/kernel/tsc_msr.c
@@ -165,7 +165,8 @@ static const struct x86_cpu_id tsc_msr_cpu_ids[] = {
*/
unsigned long cpu_khz_from_msr(void)
{
- u32 lo, hi, ratio, freq, tscref;
+ u32 ratio, freq, tscref;
+ struct msr val;
const struct freq_desc *freq_desc;
const struct x86_cpu_id *id;
const struct muldiv *md;
@@ -178,16 +179,16 @@ unsigned long cpu_khz_from_msr(void)
freq_desc = (struct freq_desc *)id->driver_data;
if (freq_desc->use_msr_plat) {
- rdmsr(MSR_PLATFORM_INFO, lo, hi);
- ratio = (lo >> 8) & 0xff;
+ rdmsrq(MSR_PLATFORM_INFO, val.q);
+ ratio = (val.l >> 8) & 0xff;
} else {
- rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
- ratio = (hi >> 8) & 0x1f;
+ rdmsrq(MSR_IA32_PERF_STATUS, val.q);
+ ratio = (val.h >> 8) & 0x1f;
}
/* Get FSB FREQ ID */
- rdmsr(MSR_FSB_FREQ, lo, hi);
- index = lo & freq_desc->mask;
+ rdmsrq(MSR_FSB_FREQ, val.q);
+ index = val.l & freq_desc->mask;
md = &freq_desc->muldiv[index];
/*
--
2.54.0