x86/msr: Get rid of rdmsrl() and wrmsrl()
Subsystems (9)
cover x86/msr: Get rid of rdmsrl() and wrmsrl()
rdsmrl() and wrmsrl() are deprecated aliases of rdmsrq() and wrmsrq().
Switch all users and remove the deprecated variants.
Juergen Gross (4):
x86/msr: Switch rdmsrl() users to rdmsrq()
x86/msr: Remove rdmsrl()
x86/msr: Switch wrmsrl() users to wrmsrq()
x86/msr: Remove wrmsrl()
arch/x86/events/amd/uncore.c | 4 ++-- arch/x86/events/intel/core.c | 4 ++-- arch/x86/include/asm/msr.h | 5 ----- arch/x86/kernel/cpu/resctrl/monitor.c | 4 ++-- arch/x86/kernel/process_64.c | 2 +- arch/x86/kvm/pmu.c | 6 +++--- arch/x86/kvm/vmx/tdx.c | 6 +++--- drivers/hv/mshv_vtl_main.c | 4 ++-- drivers/idle/intel_idle.c | 6 +++--- 9 files changed, 18 insertions(+), 23 deletions(-)
Signature · 1 line
2.54.0
PATCH 1/4 x86/msr: Switch rdmsrl() users to rdmsrq()
rdmsrl() is a deprecated synonym for rdmsrq(). Switch its users to rdmsrq().
--- arch/x86/events/amd/uncore.c | 2 +- arch/x86/kernel/cpu/resctrl/monitor.c | 2 +- drivers/hv/mshv_vtl_main.c | 2 +- drivers/idle/intel_idle.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-)
arch/x86/events/amd/uncore.c +1 -1
@@ -966,7 +966,7 @@ static void amd_uncore_umc_read(struct perf_event *event)* UMC counters do not have RDPMC assignments. Read counts directly * from the corresponding PERF_CTR. */ -rdmsrl (hwc->event_base, new); +rdmsrq (hwc->event_base, new);/* * Unlike the other uncore counters, UMC counters saturate and set the
arch/x86/kernel/cpu/resctrl/monitor.c +1 -1
@@ -301,7 +301,7 @@ static int __cntr_id_read(u32 cntr_id, u64 *val)* is set if the counter data is unavailable. */ wrmsr (MSR_IA32_QM_EVTSEL ,ABMC_EXTENDED_EVT_ID |ABMC_EVT_ID , cntr_id); -rdmsrl (MSR_IA32_QM_CTR , msr_val); +rdmsrq (MSR_IA32_QM_CTR , msr_val);if (msr_val &RMID_VAL_ERROR )return -EIO ;
drivers/hv/mshv_vtl_main.c +1 -1
@@ -598,7 +598,7 @@ static int mshv_vtl_get_set_reg(struct hv_register_assoc *regs, bool set)if (set)wrmsrl (reg_table[i].msr_addr, *reg64);else -rdmsrl (reg_table[i].msr_addr, *reg64); +rdmsrq (reg_table[i].msr_addr, *reg64); }return 0 ; }
drivers/idle/intel_idle.c +2 -2
@@ -2370,7 +2370,7 @@ static void intel_c1_demotion_toggle(void *enable) {unsigned long long msr_val; -rdmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr_val); +rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr_val);/* * Enable/disable C1 undemotion along with C1 demotion, as this is the * most sensible configuration in general.
@@ -2410,7 +2410,7 @@ static ssize_t intel_c1_demotion_show(struct device *dev,* Read the MSR value for a CPU and assume it is the same for all CPUs. Any other * configuration would be a BIOS bug. */ -rdmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr_val); +rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr_val);return sysfs_emit (buf,"%d\n" , !!(msr_val &NHM_C1_AUTO_DEMOTE )); }static DEVICE_ATTR_RW (intel_c1_demotion);
Signature · 1 line
2.54.0
[tip: x86/msr] x86/msr: Switch rdmsrl() users to rdmsrq()
The following commit has been merged into the x86/msr branch of tip:
The following commit has been merged into the x86/msr branch of tip:
Commit-ID: 72ac0e45c2a386d73a579565727da748269697e6 Gitweb: https://git.kernel.org/tip/72ac0e45c2a386d73a579565727da748269697e6 Author: Juergen Gross <[email protected]> AuthorDate: Mon, 08 Jun 2026 10:28:06 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Mon, 08 Jun 2026 13:16:34 +02:00
x86/msr: Switch rdmsrl() users to rdmsrq()
rdmsrl() is a deprecated synonym for rdmsrq(). Switch its users to rdmsrq().
--- arch/x86/events/amd/uncore.c | 2 +- arch/x86/kernel/cpu/resctrl/monitor.c | 2 +- drivers/hv/mshv_vtl_main.c | 2 +- drivers/idle/intel_idle.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-)
arch/x86/events/amd/uncore.c +1 -1
@@ -966,7 +966,7 @@ static void amd_uncore_umc_read(struct perf_event *event)* UMC counters do not have RDPMC assignments. Read counts directly * from the corresponding PERF_CTR. */ -rdmsrl (hwc->event_base, new); +rdmsrq (hwc->event_base, new);/* * Unlike the other uncore counters, UMC counters saturate and set the
arch/x86/kernel/cpu/resctrl/monitor.c +1 -1
@@ -301,7 +301,7 @@ static int __cntr_id_read(u32 cntr_id, u64 *val)* is set if the counter data is unavailable. */ wrmsr (MSR_IA32_QM_EVTSEL ,ABMC_EXTENDED_EVT_ID |ABMC_EVT_ID , cntr_id); -rdmsrl (MSR_IA32_QM_CTR , msr_val); +rdmsrq (MSR_IA32_QM_CTR , msr_val);if (msr_val &RMID_VAL_ERROR )return -EIO ;
drivers/hv/mshv_vtl_main.c +1 -1
@@ -598,7 +598,7 @@ static int mshv_vtl_get_set_reg(struct hv_register_assoc *regs, bool set)if (set)wrmsrl (reg_table[i].msr_addr, *reg64);else -rdmsrl (reg_table[i].msr_addr, *reg64); +rdmsrq (reg_table[i].msr_addr, *reg64); }return 0 ; }
drivers/idle/intel_idle.c +2 -2
@@ -2370,7 +2370,7 @@ static void intel_c1_demotion_toggle(void *enable) {unsigned long long msr_val; -rdmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr_val); +rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr_val);/* * Enable/disable C1 undemotion along with C1 demotion, as this is the * most sensible configuration in general.
@@ -2410,7 +2410,7 @@ static ssize_t intel_c1_demotion_show(struct device *dev,* Read the MSR value for a CPU and assume it is the same for all CPUs. Any other * configuration would be a BIOS bug. */ -rdmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr_val); +rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr_val);return sysfs_emit (buf,"%d\n" , !!(msr_val &NHM_C1_AUTO_DEMOTE )); }static DEVICE_ATTR_RW (intel_c1_demotion);
PATCH 2/4 x86/msr: Remove rdmsrl()
In reply to Juergen Grossrdmsrl() has no users left. Delete it.
--- arch/x86/include/asm/msr.h | 1 - 1 file changed, 1 deletion(-)
arch/x86/include/asm/msr.h +0 -1
@@ -304,7 +304,6 @@ static inline int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8])#endif /* CONFIG_SMP */ /* Compatibility wrappers: */ -#define rdmsrl (msr, val) rdmsrq(msr, val)#define wrmsrl (msr, val) wrmsrq(msr, val)#endif /* __ASSEMBLER__ */
Signature · 1 line
2.54.0
[tip: x86/msr] x86/msr: Remove rdmsrl()
The following commit has been merged into the x86/msr branch of tip:
The following commit has been merged into the x86/msr branch of tip:
Commit-ID: 666a5742b72133e219e989855e87d32fd8c95677 Gitweb: https://git.kernel.org/tip/666a5742b72133e219e989855e87d32fd8c95677 Author: Juergen Gross <[email protected]> AuthorDate: Mon, 08 Jun 2026 10:28:07 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Mon, 08 Jun 2026 13:16:34 +02:00
x86/msr: Remove rdmsrl()
rdmsrl() has no users left. Delete it.
--- arch/x86/include/asm/msr.h | 1 - 1 file changed, 1 deletion(-)
arch/x86/include/asm/msr.h +0 -1
@@ -304,7 +304,6 @@ static inline int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8])#endif /* CONFIG_SMP */ /* Compatibility wrappers: */ -#define rdmsrl (msr, val) rdmsrq(msr, val)#define wrmsrl (msr, val) wrmsrq(msr, val)#endif /* __ASSEMBLER__ */
PATCH 3/4 x86/msr: Switch wrmsrl() users to wrmsrq()
In reply to Juergen Grosswrmsrl() is a deprecated synonym for wrmsrq(). Switch its users to wrmsrq().
--- arch/x86/events/amd/uncore.c | 2 +- arch/x86/events/intel/core.c | 4 ++-- arch/x86/kernel/cpu/resctrl/monitor.c | 2 +- arch/x86/kernel/process_64.c | 2 +- arch/x86/kvm/pmu.c | 6 +++--- arch/x86/kvm/vmx/tdx.c | 6 +++--- drivers/hv/mshv_vtl_main.c | 2 +- drivers/idle/intel_idle.c | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-)
arch/x86/events/amd/uncore.c +1 -1
@@ -975,7 +975,7 @@ static void amd_uncore_umc_read(struct perf_event *event)* that the counter never gets a chance to saturate. */ if (new &BIT_ULL (63 -COUNTER_SHIFT )) { -wrmsrl (hwc->event_base,0 ); +wrmsrq (hwc->event_base,0 );local64_set (&hwc->prev_count,0 ); }else {local64_set (&hwc->prev_count, new);
arch/x86/events/intel/core.c +2 -2
@@ -3166,12 +3166,12 @@ static void intel_pmu_config_acr(int idx, u64 mask, u32 reload) }if (cpuc->acr_cfg_b[idx] != mask) { -wrmsrl (msr_b + msr_offset, mask); +wrmsrq (msr_b + msr_offset, mask); cpuc->acr_cfg_b[idx] = mask; }/* Only need to update the reload value when there is a valid config value. */ if (mask && cpuc->acr_cfg_c[idx] != reload) { -wrmsrl (msr_c + msr_offset, reload); +wrmsrq (msr_c + msr_offset, reload); cpuc->acr_cfg_c[idx] = reload; } }
arch/x86/kernel/cpu/resctrl/monitor.c +1 -1
@@ -532,7 +532,7 @@ static void resctrl_abmc_config_one_amd(void *info) {union l3_qos_abmc_cfg *abmc_cfg = info; -wrmsrl (MSR_IA32_L3_QOS_ABMC_CFG , abmc_cfg->full); +wrmsrq (MSR_IA32_L3_QOS_ABMC_CFG , abmc_cfg->full); }/*
arch/x86/kernel/process_64.c +1 -1
@@ -708,7 +708,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)/* Reset hw history on AMD CPUs */ if (cpu_feature_enabled (X86_FEATURE_AMD_WORKLOAD_CLASS )) -wrmsrl (MSR_AMD_WORKLOAD_HRST ,0x1 ); +wrmsrq (MSR_AMD_WORKLOAD_HRST ,0x1 );return prev_p; }
arch/x86/kvm/pmu.c +3 -3
@@ -1313,14 +1313,14 @@ static void kvm_pmu_load_guest_pmcs(struct kvm_vcpu *vcpu) pmc = &pmu->gp_counters[i];if (pmc->counter !=rdpmc (i)) -wrmsrl (gp_counter_msr (i), pmc->counter); -wrmsrl (gp_eventsel_msr (i), pmc->eventsel_hw); +wrmsrq (gp_counter_msr (i), pmc->counter); +wrmsrq (gp_eventsel_msr (i), pmc->eventsel_hw); }for (i =0 ; i < pmu->nr_arch_fixed_counters; i++) { pmc = &pmu->fixed_counters[i];if (pmc->counter !=rdpmc (INTEL_PMC_FIXED_RDPMC_BASE | i)) -wrmsrl (fixed_counter_msr (i), pmc->counter); +wrmsrq (fixed_counter_msr (i), pmc->counter); } }
arch/x86/kvm/vmx/tdx.c +3 -3
@@ -823,7 +823,7 @@ static void tdx_prepare_switch_to_host(struct kvm_vcpu *vcpu)return ; ++vcpu->stat.host_state_reload; -wrmsrl (MSR_KERNEL_GS_BASE , vt->msr_host_kernel_gs_base); +wrmsrq (MSR_KERNEL_GS_BASE , vt->msr_host_kernel_gs_base); vt->guest_state_loaded = false; }
@@ -1048,10 +1048,10 @@ static void tdx_load_host_xsave_state(struct kvm_vcpu *vcpu)/* * Likewise, even if a TDX hosts didn't support XSS both arms of -* the comparison would be 0 and the wrmsrl would be skipped. +* the comparison would be 0 and the wrmsrq would be skipped. */ if (kvm_host.xss != (kvm_tdx->xfam & kvm_caps.supported_xss)) -wrmsrl (MSR_IA32_XSS , kvm_host.xss); +wrmsrq (MSR_IA32_XSS , kvm_host.xss); }#define TDX_DEBUGCTL_PRESERVED (DEBUGCTLMSR_BTF | \
drivers/hv/mshv_vtl_main.c +1 -1
@@ -596,7 +596,7 @@ static int mshv_vtl_get_set_reg(struct hv_register_assoc *regs, bool set) }else {/* Handle MSRs */ if (set) -wrmsrl (reg_table[i].msr_addr, *reg64); +wrmsrq (reg_table[i].msr_addr, *reg64);else rdmsrq (reg_table[i].msr_addr, *reg64); }
drivers/idle/intel_idle.c +1 -1
@@ -2379,7 +2379,7 @@ static void intel_c1_demotion_toggle(void *enable) msr_val |=NHM_C1_AUTO_DEMOTE |SNB_C1_AUTO_UNDEMOTE ; else msr_val &= ~(NHM_C1_AUTO_DEMOTE | SNB_C1_AUTO_UNDEMOTE); -wrmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr_val); +wrmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr_val); } static ssize_t intel_c1_demotion_store(struct device *dev,
Signature · 1 line
2.54.0
[tip: x86/msr] x86/msr: Switch wrmsrl() users to wrmsrq()
The following commit has been merged into the x86/msr branch of tip:
The following commit has been merged into the x86/msr branch of tip:
Commit-ID: 2232959db26d45593c545d7e6b89ebaef4999085 Gitweb: https://git.kernel.org/tip/2232959db26d45593c545d7e6b89ebaef4999085 Author: Juergen Gross <[email protected]> AuthorDate: Mon, 08 Jun 2026 10:28:08 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Mon, 08 Jun 2026 13:16:35 +02:00
x86/msr: Switch wrmsrl() users to wrmsrq()
wrmsrl() is a deprecated synonym for wrmsrq(). Switch its users to wrmsrq().
--- arch/x86/events/amd/uncore.c | 2 +- arch/x86/events/intel/core.c | 4 ++-- arch/x86/kernel/cpu/resctrl/monitor.c | 2 +- arch/x86/kernel/process_64.c | 2 +- arch/x86/kvm/pmu.c | 6 +++--- arch/x86/kvm/vmx/tdx.c | 6 +++--- drivers/hv/mshv_vtl_main.c | 2 +- drivers/idle/intel_idle.c | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-)
arch/x86/events/amd/uncore.c +1 -1
@@ -975,7 +975,7 @@ static void amd_uncore_umc_read(struct perf_event *event)* that the counter never gets a chance to saturate. */ if (new &BIT_ULL (63 -COUNTER_SHIFT )) { -wrmsrl (hwc->event_base,0 ); +wrmsrq (hwc->event_base,0 );local64_set (&hwc->prev_count,0 ); }else {local64_set (&hwc->prev_count, new);
arch/x86/events/intel/core.c +2 -2
@@ -3166,12 +3166,12 @@ static void intel_pmu_config_acr(int idx, u64 mask, u32 reload) }if (cpuc->acr_cfg_b[idx] != mask) { -wrmsrl (msr_b + msr_offset, mask); +wrmsrq (msr_b + msr_offset, mask); cpuc->acr_cfg_b[idx] = mask; }/* Only need to update the reload value when there is a valid config value. */ if (mask && cpuc->acr_cfg_c[idx] != reload) { -wrmsrl (msr_c + msr_offset, reload); +wrmsrq (msr_c + msr_offset, reload); cpuc->acr_cfg_c[idx] = reload; } }
arch/x86/kernel/cpu/resctrl/monitor.c +1 -1
@@ -527,7 +527,7 @@ static void resctrl_abmc_config_one_amd(void *info) {union l3_qos_abmc_cfg *abmc_cfg = info; -wrmsrl (MSR_IA32_L3_QOS_ABMC_CFG , abmc_cfg->full); +wrmsrq (MSR_IA32_L3_QOS_ABMC_CFG , abmc_cfg->full); }/*
arch/x86/kernel/process_64.c +1 -1
@@ -708,7 +708,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)/* Reset hw history on AMD CPUs */ if (cpu_feature_enabled (X86_FEATURE_AMD_WORKLOAD_CLASS )) -wrmsrl (MSR_AMD_WORKLOAD_HRST ,0x1 ); +wrmsrq (MSR_AMD_WORKLOAD_HRST ,0x1 );return prev_p; }
arch/x86/kvm/pmu.c +3 -3
@@ -1313,14 +1313,14 @@ static void kvm_pmu_load_guest_pmcs(struct kvm_vcpu *vcpu) pmc = &pmu->gp_counters[i];if (pmc->counter !=rdpmc (i)) -wrmsrl (gp_counter_msr (i), pmc->counter); -wrmsrl (gp_eventsel_msr (i), pmc->eventsel_hw); +wrmsrq (gp_counter_msr (i), pmc->counter); +wrmsrq (gp_eventsel_msr (i), pmc->eventsel_hw); }for (i =0 ; i < pmu->nr_arch_fixed_counters; i++) { pmc = &pmu->fixed_counters[i];if (pmc->counter !=rdpmc (INTEL_PMC_FIXED_RDPMC_BASE | i)) -wrmsrl (fixed_counter_msr (i), pmc->counter); +wrmsrq (fixed_counter_msr (i), pmc->counter); } }
arch/x86/kvm/vmx/tdx.c +3 -3
@@ -823,7 +823,7 @@ static void tdx_prepare_switch_to_host(struct kvm_vcpu *vcpu)return ; ++vcpu->stat.host_state_reload; -wrmsrl (MSR_KERNEL_GS_BASE , vt->msr_host_kernel_gs_base); +wrmsrq (MSR_KERNEL_GS_BASE , vt->msr_host_kernel_gs_base); vt->guest_state_loaded = false; }
@@ -1048,10 +1048,10 @@ static void tdx_load_host_xsave_state(struct kvm_vcpu *vcpu)/* * Likewise, even if a TDX hosts didn't support XSS both arms of -* the comparison would be 0 and the wrmsrl would be skipped. +* the comparison would be 0 and the wrmsrq would be skipped. */ if (kvm_host.xss != (kvm_tdx->xfam & kvm_caps.supported_xss)) -wrmsrl (MSR_IA32_XSS , kvm_host.xss); +wrmsrq (MSR_IA32_XSS , kvm_host.xss); }#define TDX_DEBUGCTL_PRESERVED (DEBUGCTLMSR_BTF | \
drivers/hv/mshv_vtl_main.c +1 -1
@@ -596,7 +596,7 @@ static int mshv_vtl_get_set_reg(struct hv_register_assoc *regs, bool set) }else {/* Handle MSRs */ if (set) -wrmsrl (reg_table[i].msr_addr, *reg64); +wrmsrq (reg_table[i].msr_addr, *reg64);else rdmsrq (reg_table[i].msr_addr, *reg64); }
drivers/idle/intel_idle.c +1 -1
@@ -2379,7 +2379,7 @@ static void intel_c1_demotion_toggle(void *enable) msr_val |=NHM_C1_AUTO_DEMOTE |SNB_C1_AUTO_UNDEMOTE ; else msr_val &= ~(NHM_C1_AUTO_DEMOTE | SNB_C1_AUTO_UNDEMOTE); -wrmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr_val); +wrmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr_val); } static ssize_t intel_c1_demotion_store(struct device *dev,
PATCH 4/4 x86/msr: Remove wrmsrl()
In reply to Juergen Grosswrmsrl() has no users left. Delete it.
--- arch/x86/include/asm/msr.h | 4 ---- 1 file changed, 4 deletions(-)
arch/x86/include/asm/msr.h +0 -4
@@ -302,9 +302,5 @@ static inline int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8])return wrmsr_safe_regs (regs); }#endif /* CONFIG_SMP */ - -/* Compatibility wrappers: */ -#define wrmsrl (msr, val) wrmsrq(msr, val) -#endif /* __ASSEMBLER__ */ #endif /* _ASM_X86_MSR_H */
Signature · 1 line
2.54.0
[tip: x86/msr] x86/msr: Remove wrmsrl()
The following commit has been merged into the x86/msr branch of tip:
The following commit has been merged into the x86/msr branch of tip:
Commit-ID: b5884070f9da9ffecd5141b5811cfdbaa274809a Gitweb: https://git.kernel.org/tip/b5884070f9da9ffecd5141b5811cfdbaa274809a Author: Juergen Gross <[email protected]> AuthorDate: Mon, 08 Jun 2026 10:28:09 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Mon, 08 Jun 2026 13:16:35 +02:00
x86/msr: Remove wrmsrl()
wrmsrl() has no users left. Delete it.
--- arch/x86/include/asm/msr.h | 4 ---- 1 file changed, 4 deletions(-)
arch/x86/include/asm/msr.h +0 -4
@@ -302,9 +302,5 @@ static inline int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8])return wrmsr_safe_regs (regs); }#endif /* CONFIG_SMP */ - -/* Compatibility wrappers: */ -#define wrmsrl (msr, val) wrmsrq(msr, val) -#endif /* __ASSEMBLER__ */ #endif /* _ASM_X86_MSR_H */