[tip: x86/msr] x86/hygon: Stop using 32-bit MSR interfaces

From: tip-bot2 for Juergen Gross

Date: Thu Jul 02 2026 - 06:37:59 EST


The following commit has been merged into the x86/msr branch of tip:

Commit-ID: c36c3d7e5dc49f0085e26ee4bcd2cb6493b0120e
Gitweb: https://git.kernel.org/tip/c36c3d7e5dc49f0085e26ee4bcd2cb6493b0120e
Author: Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Mon, 29 Jun 2026 08:05:01 +02:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Thu, 02 Jul 2026 11:54:51 +02:00

x86/hygon: Stop using 32-bit MSR interfaces

The 32-bit MSR interface rdmsr_safe()is planned to be removed. Use the
related 64-bit variant instead.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Pu Wen <puwen@xxxxxxxx>
Link: https://patch.msgid.link/20260629060526.3638272-11-jgross@xxxxxxxx
---
arch/x86/kernel/cpu/hygon.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/hygon.c b/arch/x86/kernel/cpu/hygon.c
index 3e8891a..ec51c2b 100644
--- a/arch/x86/kernel/cpu/hygon.c
+++ b/arch/x86/kernel/cpu/hygon.c
@@ -125,11 +125,12 @@ static void bsp_init_hygon(struct cpuinfo_x86 *c)

static void early_init_hygon(struct cpuinfo_x86 *c)
{
- u32 dummy;
+ u64 val;

set_cpu_cap(c, X86_FEATURE_K8);

- rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
+ rdmsrq_safe(MSR_AMD64_PATCH_LEVEL, &val);
+ c->microcode = (u32)val;

/*
* c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate