[tip: x86/msr] x86/msr: Remove rdmsr_safe_on_cpu()

From: tip-bot2 for Juergen Gross

Date: Mon Jun 08 2026 - 04:11:14 EST


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

Commit-ID: d2eb65a9aa061a3ee1f42bc0cdfe9ecffaf267fb
Gitweb: https://git.kernel.org/tip/d2eb65a9aa061a3ee1f42bc0cdfe9ecffaf267fb
Author: Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Mon, 08 Jun 2026 07:17:39 +02:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Mon, 08 Jun 2026 10:01:49 +02:00

x86/msr: Remove rdmsr_safe_on_cpu()

rdmsr_safe_on_cpu() has no users left. Delete it.

Tested-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>
Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Reviewed-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Cc: H. Peter Anvin <hpa@xxxxxxxxx>
Link: https://patch.msgid.link/20260608051741.3207435-10-jgross@xxxxxxxx
---
arch/x86/include/asm/msr.h | 6 ------
arch/x86/lib/msr-smp.c | 24 ------------------------
2 files changed, 30 deletions(-)

diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 0205643..b0bf1a7 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -260,7 +260,6 @@ int rdmsrq_on_cpu(unsigned int cpu, u32 msr_no, u64 *q);
int wrmsrq_on_cpu(unsigned int cpu, u32 msr_no, u64 q);
void rdmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr __percpu *msrs);
void wrmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr __percpu *msrs);
-int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
int rdmsrq_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 *q);
int wrmsrq_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 q);
@@ -287,11 +286,6 @@ static inline void wrmsr_on_cpus(const struct cpumask *m, u32 msr_no,
{
wrmsrq_on_cpu(0, msr_no, raw_cpu_read(msrs->q));
}
-static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no,
- u32 *l, u32 *h)
-{
- return rdmsr_safe(msr_no, l, h);
-}
static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
{
return wrmsr_safe(msr_no, l, h);
diff --git a/arch/x86/lib/msr-smp.c b/arch/x86/lib/msr-smp.c
index f3c75b6..f58e0ba 100644
--- a/arch/x86/lib/msr-smp.c
+++ b/arch/x86/lib/msr-smp.c
@@ -132,30 +132,6 @@ static void __wrmsr_safe_on_cpu(void *info)
rv->err = wrmsr_safe(rv->msr_no, rv->reg.l, rv->reg.h);
}

-int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
-{
- struct msr_info_completion rv;
- call_single_data_t csd;
- int err;
-
- INIT_CSD(&csd, __rdmsr_safe_on_cpu, &rv);
-
- memset(&rv, 0, sizeof(rv));
- init_completion(&rv.done);
- rv.msr.msr_no = msr_no;
-
- err = smp_call_function_single_async(cpu, &csd);
- if (!err) {
- wait_for_completion(&rv.done);
- err = rv.msr.err;
- }
- *l = rv.msr.reg.l;
- *h = rv.msr.reg.h;
-
- return err;
-}
-EXPORT_SYMBOL(rdmsr_safe_on_cpu);
-
int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
{
int err;