Subject: [PATCH] x86/msr: Add rdmsrl_on_cpu() compatibility wrapper

From: Ingo Molnar <[email-masked]>
Date: Thu, 15 May 2025 18:01:12 +0200

* Mario Limonciello <[email-masked]> wrote:

> > If it's only about rdmsrl_on_cpu(), how about the simple 
> > compatibility wrapper below instead, applied to the x86 tree?
> > 
> > Can merge it into -tip and tomorrow's -next would resolve this 
> > without any changes or merges done to the PM tree.
> 
> Sounds good to me.

Great - I've added the patch below to the x86 tree, tomorrow's -next 
should have this resolved in theory.

Thanks,

	Ingo

=======================>
From: Ingo Molnar <[email-masked]>
Date: Thu, 15 May 2025 17:49:16 +0200
Subject: [PATCH] x86/msr: Add rdmsrl_on_cpu() compatibility wrapper

Add a simple rdmsrl_on_cpu() compatibility wrapper for
rdmsrq_on_cpu(), to make life in -next easier, where
the PM tree recently grew more uses of the old API.

Reported-by: Stephen Rothwell <[email-masked]>
Signed-off-by: Ingo Molnar <[email-masked]>
Acked-by: Mario Limonciello <[email-masked]>
Cc: "H. Peter Anvin" <[email-masked]>
Cc: Juergen Gross <[email-masked]>
Cc: Dave Hansen <[email-masked]>
Cc: Xin Li <[email-masked]>
Link: https://lore.kernel.org/r/[email-masked]
---
 arch/x86/include/asm/msr.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index a9ce56fc8785..4096b8af4ba7 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -329,6 +329,7 @@ static inline int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8])
 /* Compatibility wrappers: */
 #define rdmsrl(msr, val) rdmsrq(msr, val)
 #define wrmsrl(msr, val) wrmsrq(msr, val)
+#define rdmsrl_on_cpu(cpu, msr, q) rdmsrq_on_cpu(cpu, msr, q)
 
 #endif /* __ASSEMBLER__ */
 #endif /* _ASM_X86_MSR_H */