x86/tsc: Stop using 32-bit MSR interfaces

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@suse.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20260629060526.3638272-15-jgross@suse.com
This commit is contained in:
Juergen Gross
2026-06-29 08:05:05 +02:00
committed by Ingo Molnar
parent 9c6be5e789
commit 4ff91f7b8f
2 changed files with 11 additions and 10 deletions

View File

@@ -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

View File

@@ -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];
/*