x86 MSR in-kernel API type cleanup and rename
Subsystems (43)
cover x86 MSR in-kernel API type cleanup and rename
H. Peter Anvin recently observed that the rdmsrl*()/wrmsrl*() APIs are historic misnomers and are actively misleading: the 'l' suffix suggests a 32-bit nature, while all these APIs are fixed 64-bit, for which we use the 'q' suffix.
Make the names reflect that, by renaming them to rdmsrq*()/wrmsrq*().
Also clean up the types to u32 and u64 in <asm/msr.h> and affected code, from a hodgepodge of equivalent integer types, to indicate that these are all hardware ABI derived types.
The Git tree with these commits can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.x86/msr
Thanks,
Ingo
==================>
Ingo Molnar (20):
x86/msr: Standardize on u64 in <asm/msr.h>
x86/msr: Standardize on u64 in <asm/msr-index.h> x86/msr: Use u64 in rdmsrl_amd_safe() and wrmsrl_amd_safe() x86/msr: Use u64 in rdmsrl_safe() and paravirt_read_pmc() x86/msr: Harmonize the prototype and definition of do_trace_rdpmc() x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h> x86/msr: Rename 'rdmsrl()' to 'rdmsrq()'
x86/msr: Rename 'wrmsrl()' to 'wrmsrq()'
x86/msr: Rename 'rdmsrl_safe()' to 'rdmsrq_safe()' x86/msr: Rename 'wrmsrl_safe()' to 'wrmsrq_safe()' x86/msr: Rename 'rdmsrl_safe_on_cpu()' to 'rdmsrq_safe_on_cpu()' x86/msr: Rename 'wrmsrl_safe_on_cpu()' to 'wrmsrq_safe_on_cpu()' x86/msr: Rename 'rdmsrl_on_cpu()' to 'rdmsrq_on_cpu()' x86/msr: Rename 'wrmsrl_on_cpu()' to 'wrmsrq_on_cpu()' x86/msr: Rename 'mce_rdmsrl()' to 'mce_rdmsrq()' x86/msr: Rename 'mce_wrmsrl()' to 'mce_wrmsrq()' x86/msr: Rename 'rdmsrl_amd_safe()' to 'rdmsrq_amd_safe()' x86/msr: Rename 'wrmsrl_amd_safe()' to 'wrmsrq_amd_safe()' x86/msr: Rename 'native_wrmsrl()' to 'native_wrmsrq()' x86/msr: Rename 'wrmsrl_cstar()' to 'wrmsrq_cstar()'
arch/x86/coco/sev/core.c | 2 +- arch/x86/events/amd/brs.c | 8 +- arch/x86/events/amd/core.c | 12 +-- arch/x86/events/amd/ibs.c | 26 ++--- arch/x86/events/amd/lbr.c | 20 ++-- arch/x86/events/amd/power.c | 10 +- arch/x86/events/amd/uncore.c | 12 +-- arch/x86/events/core.c | 42 ++++---- arch/x86/events/intel/core.c | 66 ++++++------- arch/x86/events/intel/cstate.c | 2 +- arch/x86/events/intel/ds.c | 10 +- arch/x86/events/intel/knc.c | 16 +-- arch/x86/events/intel/lbr.c | 44 ++++----- arch/x86/events/intel/p4.c | 24 ++--- arch/x86/events/intel/p6.c | 12 +-- arch/x86/events/intel/pt.c | 32 +++--- arch/x86/events/intel/uncore.c | 2 +- arch/x86/events/intel/uncore_discovery.c | 10 +- arch/x86/events/intel/uncore_nhmex.c | 70 ++++++------- arch/x86/events/intel/uncore_snb.c | 42 ++++---- arch/x86/events/intel/uncore_snbep.c | 50 +++++----- arch/x86/events/msr.c | 2 +- arch/x86/events/perf_event.h | 26 ++--- arch/x86/events/probe.c | 2 +- arch/x86/events/rapl.c | 8 +- arch/x86/events/zhaoxin/core.c | 16 +-- arch/x86/hyperv/hv_apic.c | 4 +- arch/x86/hyperv/hv_init.c | 66 ++++++------- arch/x86/hyperv/hv_spinlock.c | 6 +- arch/x86/hyperv/ivm.c | 2 +- arch/x86/include/asm/apic.h | 8 +- arch/x86/include/asm/debugreg.h | 4 +- arch/x86/include/asm/fsgsbase.h | 4 +- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/include/asm/microcode.h | 2 +- arch/x86/include/asm/msr-index.h | 12 +-- arch/x86/include/asm/msr.h | 73 +++++++------- arch/x86/include/asm/paravirt.h | 8 +- arch/x86/include/asm/spec-ctrl.h | 2 +- arch/x86/kernel/acpi/cppc.c | 8 +- arch/x86/kernel/amd_nb.c | 2 +- arch/x86/kernel/apic/apic.c | 16 +-- arch/x86/kernel/apic/apic_numachip.c | 6 +- arch/x86/kernel/cet.c | 2 +- arch/x86/kernel/cpu/amd.c | 28 +++--- arch/x86/kernel/cpu/aperfmperf.c | 28 +++--- arch/x86/kernel/cpu/bugs.c | 24 ++--- arch/x86/kernel/cpu/bus_lock.c | 18 ++-- arch/x86/kernel/cpu/common.c | 68 ++++++------- arch/x86/kernel/cpu/feat_ctl.c | 4 +- arch/x86/kernel/cpu/hygon.c | 6 +- arch/x86/kernel/cpu/intel.c | 10 +- arch/x86/kernel/cpu/intel_epb.c | 12 +-- arch/x86/kernel/cpu/mce/amd.c | 22 ++--- arch/x86/kernel/cpu/mce/core.c | 58 +++++------ arch/x86/kernel/cpu/mce/inject.c | 32 +++--- arch/x86/kernel/cpu/mce/intel.c | 32 +++--- arch/x86/kernel/cpu/mce/internal.h | 2 +- arch/x86/kernel/cpu/microcode/amd.c | 2 +- arch/x86/kernel/cpu/microcode/intel.c | 2 +- arch/x86/kernel/cpu/mshyperv.c | 12 +-- arch/x86/kernel/cpu/resctrl/core.c | 10 +- arch/x86/kernel/cpu/resctrl/monitor.c | 2 +- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 2 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 6 +- arch/x86/kernel/cpu/sgx/main.c | 2 +- arch/x86/kernel/cpu/topology.c | 2 +- arch/x86/kernel/cpu/topology_amd.c | 4 +- arch/x86/kernel/cpu/tsx.c | 20 ++-- arch/x86/kernel/cpu/umwait.c | 2 +- arch/x86/kernel/fpu/core.c | 2 +- arch/x86/kernel/fpu/xstate.c | 10 +- arch/x86/kernel/fpu/xstate.h | 2 +- arch/x86/kernel/fred.c | 20 ++-- arch/x86/kernel/hpet.c | 2 +- arch/x86/kernel/kvm.c | 28 +++--- arch/x86/kernel/kvmclock.c | 4 +- arch/x86/kernel/mmconf-fam10h_64.c | 8 +- arch/x86/kernel/process.c | 16 +-- arch/x86/kernel/process_64.c | 20 ++-- arch/x86/kernel/reboot_fixups_32.c | 2 +- arch/x86/kernel/shstk.c | 18 ++-- arch/x86/kernel/traps.c | 10 +- arch/x86/kernel/tsc.c | 2 +- arch/x86/kernel/tsc_sync.c | 14 +-- arch/x86/kvm/svm/avic.c | 2 +- arch/x86/kvm/svm/sev.c | 2 +- arch/x86/kvm/svm/svm.c | 16 +-- arch/x86/kvm/vmx/nested.c | 4 +- arch/x86/kvm/vmx/pmu_intel.c | 4 +- arch/x86/kvm/vmx/sgx.c | 8 +- arch/x86/kvm/vmx/vmx.c | 66 ++++++------- arch/x86/kvm/x86.c | 38 ++++---- arch/x86/lib/insn-eval.c | 6 +- arch/x86/lib/msr-smp.c | 16 +-- arch/x86/lib/msr.c | 12 +-- arch/x86/mm/pat/memtype.c | 4 +- arch/x86/mm/tlb.c | 2 +- arch/x86/pci/amd_bus.c | 10 +- arch/x86/platform/olpc/olpc-xo1-rtc.c | 6 +- arch/x86/platform/olpc/olpc-xo1-sci.c | 2 +- arch/x86/power/cpu.c | 26 ++--- arch/x86/realmode/init.c | 2 +- arch/x86/virt/svm/sev.c | 20 ++-- arch/x86/xen/suspend.c | 6 +- drivers/acpi/acpi_extlog.c | 2 +- drivers/acpi/acpi_lpit.c | 2 +- drivers/cpufreq/acpi-cpufreq.c | 8 +- drivers/cpufreq/amd-pstate-ut.c | 6 +- drivers/cpufreq/amd-pstate.c | 22 ++--- drivers/cpufreq/amd_freq_sensitivity.c | 2 +- drivers/cpufreq/e_powersaver.c | 6 +- drivers/cpufreq/intel_pstate.c | 108 ++++++++++----------- drivers/cpufreq/longhaul.c | 24 ++--- drivers/cpufreq/powernow-k7.c | 14 +-- drivers/crypto/ccp/sev-dev.c | 2 +- drivers/edac/amd64_edac.c | 6 +- drivers/gpu/drm/i915/selftests/librapl.c | 4 +- drivers/hwmon/fam15h_power.c | 6 +- drivers/idle/intel_idle.c | 34 +++---- drivers/mtd/nand/raw/cs553x_nand.c | 6 +- drivers/platform/x86/intel/ifs/core.c | 4 +- drivers/platform/x86/intel/ifs/load.c | 20 ++-- drivers/platform/x86/intel/ifs/runtest.c | 16 +-- drivers/platform/x86/intel/pmc/cnp.c | 6 +- drivers/platform/x86/intel/pmc/core.c | 8 +- .../x86/intel/speed_select_if/isst_if_common.c | 18 ++-- .../x86/intel/speed_select_if/isst_if_mbox_msr.c | 14 +-- .../x86/intel/speed_select_if/isst_tpmi_core.c | 2 +- drivers/platform/x86/intel/tpmi_power_domains.c | 4 +- drivers/platform/x86/intel/turbo_max_3.c | 4 +- .../x86/intel/uncore-frequency/uncore-frequency.c | 10 +- drivers/platform/x86/intel_ips.c | 36 +++---- drivers/powercap/intel_rapl_msr.c | 6 +- .../int340x_thermal/processor_thermal_device.c | 2 +- drivers/thermal/intel/intel_hfi.c | 14 +-- drivers/thermal/intel/intel_powerclamp.c | 4 +- drivers/thermal/intel/intel_tcc_cooling.c | 4 +- drivers/thermal/intel/therm_throt.c | 10 +- drivers/video/fbdev/geode/gxfb_core.c | 2 +- drivers/video/fbdev/geode/lxfb_ops.c | 22 ++--- drivers/video/fbdev/geode/suspend_gx.c | 10 +- drivers/video/fbdev/geode/video_gx.c | 16 +-- include/hyperv/hvgdk_mini.h | 2 +- 144 files changed, 1049 insertions(+), 1050 deletions(-)
Signature · 1 line
2.45.2
PATCH 1/20 x86/msr: Standardize on u64 in <asm/msr.h>
There's 9 uses of 'unsigned long long' in <asm/msr.h>, which is really the same as 'u64', which is used 34 times.
Standardize on u64.
--- arch/x86/include/asm/msr.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
arch/x86/include/asm/msr.h +9 -9
@@ -48,7 +48,7 @@ struct saved_msrs {#define EAX_EDX_VAL (val, low, high) ((low) | (high) << 32)#define EAX_EDX_RET (val, low, high) "=a" (low), "=d" (high)#else -#define DECLARE_ARGS (val, low, high) unsigned long long val +#define DECLARE_ARGS (val, low, high) u64 val#define EAX_EDX_VAL (val, low, high) (val)#define EAX_EDX_RET (val, low, high) "=A" (val)#endif
@@ -79,7 +79,7 @@ static inline void do_trace_rdpmc(unsigned int msr, u64 val, int failed) {}* think of extending them - you will be slapped with a stinking trout or a frozen * shark will reach you, wherever you are! You've been warned. */ -static __always_inline unsigned long long __rdmsr (unsigned int msr) +static __always_inline u64 __rdmsr(unsigned int msr) {DECLARE_ARGS (val, low, high);
@@ -113,9 +113,9 @@ do { \__wrmsr ((msr), (u32)((u64)(val)), \ (u32)((u64)(val) >> 32)) -static inline unsigned long long native_read_msr (unsigned int msr) +static inline u64 native_read_msr (unsigned int msr) { -unsigned long long val; +u64 val; val =__rdmsr (msr);
@@ -125,7 +125,7 @@ static inline unsigned long long native_read_msr(unsigned int msr)return val; } -static inline unsigned long long native_read_msr_safe (unsigned int msr, +static inline u64 native_read_msr_safe (unsigned int msr,int *err) {DECLARE_ARGS (val, low, high);
@@ -179,7 +179,7 @@ extern int wrmsr_safe_regs(u32 regs[8]);* CPU can and will speculatively execute that RDTSC, though, so the * results can be non-monotonic if compared on different CPUs. */ -static __always_inline unsigned long long rdtsc (void ) +static __always_inline u64 rdtsc(void) {DECLARE_ARGS (val, low, high);
@@ -196,7 +196,7 @@ static __always_inline unsigned long long rdtsc(void)* be impossible to observe non-monotonic rdtsc_unordered() behavior * across multiple CPUs as long as the TSC is synced. */ -static __always_inline unsigned long long rdtsc_ordered (void ) +static __always_inline u64 rdtsc_ordered(void) {DECLARE_ARGS (val, low, high);
@@ -224,7 +224,7 @@ static __always_inline unsigned long long rdtsc_ordered(void)return EAX_EDX_VAL (val, low, high); } -static inline unsigned long long native_read_pmc (int counter) +static inline u64 native_read_pmc (int counter) {DECLARE_ARGS (val, low, high);
@@ -280,7 +280,7 @@ static inline int wrmsr_safe(unsigned int msr, u32 low, u32 high) __err; \ }) -static inline int rdmsrl_safe (unsigned int msr,unsigned long long *p) +static inline int rdmsrl_safe (unsigned int msr,u64 *p) {int err;
Signature · 1 line
2.45.2
PATCH 2/20 x86/msr: Standardize on u64 in <asm/msr-index.h>
In reply to Ingo MolnarAlso fix some nearby whitespace damage while at it.
--- arch/x86/include/asm/msr-index.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/x86/include/asm/msr-index.h +6 -6
@@ -525,7 +525,7 @@#define MSR_HWP_CAPABILITIES 0x00000771#define MSR_HWP_REQUEST_PKG 0x00000772#define MSR_HWP_INTERRUPT 0x00000773 -#define MSR_HWP_REQUEST 0x00000774 +#define MSR_HWP_REQUEST 0x00000774#define MSR_HWP_STATUS 0x00000777/* CPUID.6.EAX */
@@ -542,16 +542,16 @@#define HWP_LOWEST_PERF (x) (((x) >> 24) & 0xff)/* IA32_HWP_REQUEST */ -#define HWP_MIN_PERF (x) (x & 0xff) -#define HWP_MAX_PERF (x) ((x & 0xff) << 8) +#define HWP_MIN_PERF (x) (x & 0xff) +#define HWP_MAX_PERF (x) ((x & 0xff) << 8)#define HWP_DESIRED_PERF (x) ((x & 0xff) << 16) -#define HWP_ENERGY_PERF_PREFERENCE (x) (((unsigned long long) x & 0xff) << 24) +#define HWP_ENERGY_PERF_PREFERENCE (x) (((u64)x & 0xff) << 24)#define HWP_EPP_PERFORMANCE 0x00#define HWP_EPP_BALANCE_PERFORMANCE 0x80#define HWP_EPP_BALANCE_POWERSAVE 0xC0#define HWP_EPP_POWERSAVE 0xFF -#define HWP_ACTIVITY_WINDOW (x) ((unsigned long long)(x & 0xff3) << 32) -#define HWP_PACKAGE_CONTROL (x) ((unsigned long long)(x & 0x1) << 42) +#define HWP_ACTIVITY_WINDOW (x) ((u64)(x & 0xff3) << 32) +#define HWP_PACKAGE_CONTROL (x) ((u64)(x & 0x1) << 42)/* IA32_HWP_STATUS */ #define HWP_GUARANTEED_CHANGE (x) (x & 0x1)
Signature · 1 line
2.45.2
PATCH 3/20 x86/msr: Use u64 in rdmsrl_amd_safe() and wrmsrl_amd_safe()
In reply to Ingo Molnar--- arch/x86/kernel/cpu/amd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/amd.c +2 -2
@@ -31,7 +31,7 @@u16 invlpgb_count_max__ro_after_init ; -static inline int rdmsrl_amd_safe (unsigned msr,unsigned long long *p) +static inline int rdmsrl_amd_safe (unsigned msr,u64 *p) {u32 gprs[8 ] = {0 };int err;
@@ -49,7 +49,7 @@ static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p)return err; } -static inline int wrmsrl_amd_safe (unsigned msr,unsigned long long val) +static inline int wrmsrl_amd_safe (unsigned msr,u64 val) {u32 gprs[8 ] = {0 };
Signature · 1 line
2.45.2
PATCH 4/20 x86/msr: Use u64 in rdmsrl_safe() and paravirt_read_pmc()
In reply to Ingo MolnarThe paravirt_read_pmc() result is in fact only loaded into an u64 variable.
--- arch/x86/include/asm/paravirt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/paravirt.h +2 -2
@@ -231,7 +231,7 @@ static inline void wrmsrl(unsigned msr, u64 val) _err; \ }) -static inline int rdmsrl_safe (unsigned msr,unsigned long long *p) +static inline int rdmsrl_safe (unsigned msr,u64 *p) {int err;
@@ -239,7 +239,7 @@ static inline int rdmsrl_safe(unsigned msr, unsigned long long *p)return err; } -static inline unsigned long long paravirt_read_pmc (int counter) +static inline u64 paravirt_read_pmc (int counter) {return PVOP_CALL1 (u64, cpu.read_pmc, counter); }
Signature · 1 line
2.45.2
PATCH 5/20 x86/msr: Harmonize the prototype and definition of do_trace_rdpmc()
In reply to Ingo MolnarIn <asm/msr.h> the first parameter of do_trace_rdpmc() is named 'msr':
extern void do_trace_rdpmc(unsigned int msr, u64 val, int failed);
But in the definition it's 'counter':
void do_trace_rdpmc(unsigned counter, u64 val, int failed)
Use 'msr' in both cases, and change the type to u32.
--- arch/x86/include/asm/msr.h | 4 ++-- arch/x86/lib/msr.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/include/asm/msr.h +2 -2
@@ -65,11 +65,11 @@ DECLARE_TRACEPOINT(write_msr);DECLARE_TRACEPOINT (rdpmc);extern void do_trace_write_msr (unsigned int msr,u64 val,int failed);extern void do_trace_read_msr (unsigned int msr,u64 val,int failed); -extern void do_trace_rdpmc (unsigned int msr,u64 val,int failed); +extern void do_trace_rdpmc (u32 msr,u64 val,int failed);#else static inline void do_trace_write_msr (unsigned int msr,u64 val,int failed) {}static inline void do_trace_read_msr (unsigned int msr,u64 val,int failed) {} -static inline void do_trace_rdpmc (unsigned int msr,u64 val,int failed) {} +static inline void do_trace_rdpmc (u32 msr,u64 val,int failed) {}#endif /*
arch/x86/lib/msr.c +2 -2
@@ -136,9 +136,9 @@ void do_trace_read_msr(unsigned int msr, u64 val, int failed)EXPORT_SYMBOL (do_trace_read_msr);EXPORT_TRACEPOINT_SYMBOL (read_msr); -void do_trace_rdpmc (unsigned counter,u64 val,int failed) +void do_trace_rdpmc (u32 msr,u64 val,int failed) { -trace_rdpmc (counter, val, failed); +trace_rdpmc (msr, val, failed); }EXPORT_SYMBOL (do_trace_rdpmc);EXPORT_TRACEPOINT_SYMBOL (rdpmc);
Signature · 1 line
2.45.2
PATCH 6/20 x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
In reply to Ingo MolnarThis is the customary type used for hardware ABIs.
--- arch/x86/include/asm/msr.h | 29 ++++++++++++++--------------- arch/x86/lib/msr.c | 4 ++-- 2 files changed, 16 insertions(+), 17 deletions(-)
arch/x86/include/asm/msr.h +14 -15
@@ -63,12 +63,12 @@ struct saved_msrs {DECLARE_TRACEPOINT (read_msr);DECLARE_TRACEPOINT (write_msr);DECLARE_TRACEPOINT (rdpmc); -extern void do_trace_write_msr (unsigned int msr,u64 val,int failed); -extern void do_trace_read_msr (unsigned int msr,u64 val,int failed); +extern void do_trace_write_msr (u32 msr,u64 val,int failed); +extern void do_trace_read_msr (u32 msr,u64 val,int failed);extern void do_trace_rdpmc (u32 msr,u64 val,int failed);#else -static inline void do_trace_write_msr (unsigned int msr,u64 val,int failed) {} -static inline void do_trace_read_msr (unsigned int msr,u64 val,int failed) {} +static inline void do_trace_write_msr (u32 msr,u64 val,int failed) {} +static inline void do_trace_read_msr (u32 msr,u64 val,int failed) {}static inline void do_trace_rdpmc (u32 msr,u64 val,int failed) {}#endif
@@ -79,7 +79,7 @@ static inline void do_trace_rdpmc(u32 msr, u64 val, int failed) {}* think of extending them - you will be slapped with a stinking trout or a frozen * shark will reach you, wherever you are! You've been warned. */ -static __always_inline u64 __rdmsr(unsigned int msr) +static __always_inline u64 __rdmsr(u32 msr) {DECLARE_ARGS (val, low, high);
@@ -91,7 +91,7 @@ static __always_inline u64 __rdmsr(unsigned int msr)return EAX_EDX_VAL (val, low, high); } -static __always_inline void __wrmsr(unsigned int msr, u32 low, u32 high) +static __always_inline void __wrmsr(u32 msr, u32 low, u32 high) { asmvolatile ("1: wrmsr\n" "2:\n"
@@ -113,7 +113,7 @@ do { \__wrmsr ((msr), (u32)((u64)(val)), \ (u32)((u64)(val) >> 32)) -static inline u64 native_read_msr (unsigned int msr) +static inline u64 native_read_msr (u32 msr) {u64 val;
@@ -125,8 +125,7 @@ static inline u64 native_read_msr(unsigned int msr)return val; } -static inline u64 native_read_msr_safe (unsigned int msr, -int *err) +static inline u64 native_read_msr_safe (u32 msr,int *err) {DECLARE_ARGS (val, low, high);
@@ -142,7 +141,7 @@ static inline u64 native_read_msr_safe(unsigned int msr,/* Can be uninlined because referenced by paravirt */ static inline void notrace -native_write_msr (unsigned int msr,u32 low,u32 high) +native_write_msr (u32 msr,u32 low,u32 high) {__wrmsr (msr, low, high);
@@ -152,7 +151,7 @@ native_write_msr(unsigned int msr, u32 low, u32 high)/* Can be uninlined because referenced by paravirt */ static inline int notrace -native_write_msr_safe (unsigned int msr,u32 low,u32 high) +native_write_msr_safe (u32 msr,u32 low,u32 high) {int err;
@@ -251,7 +250,7 @@ do { \ (void )((high) = (u32)(__val >>32 )); \ }while (0 ) -static inline void wrmsr(unsigned int msr, u32 low, u32 high) +static inline void wrmsr(u32 msr, u32 low, u32 high) {native_write_msr (msr, low, high); }
@@ -259,13 +258,13 @@ static inline void wrmsr(unsigned int msr, u32 low, u32 high)#define rdmsrl (msr, val) \ ((val) = native_read_msr((msr))) -static inline void wrmsrl (unsigned int msr,u64 val) +static inline void wrmsrl (u32 msr,u64 val) {native_write_msr (msr, (u32)(val &0xffffffffULL ), (u32)(val >>32 )); }/* wrmsr with exception handling */ -static inline int wrmsr_safe (unsigned int msr,u32 low,u32 high) +static inline int wrmsr_safe (u32 msr,u32 low,u32 high) {return native_write_msr_safe (msr, low, high); }
@@ -280,7 +279,7 @@ static inline int wrmsr_safe(unsigned int msr, u32 low, u32 high) __err; \ }) -static inline int rdmsrl_safe (unsigned int msr,u64 *p) +static inline int rdmsrl_safe (u32 msr,u64 *p) {int err;
arch/x86/lib/msr.c +2 -2
@@ -122,14 +122,14 @@ int msr_clear_bit(u32 msr, u8 bit)EXPORT_SYMBOL_GPL (msr_clear_bit);#ifdef CONFIG_TRACEPOINTS -void do_trace_write_msr (unsigned int msr,u64 val,int failed) +void do_trace_write_msr (u32 msr,u64 val,int failed) {trace_write_msr (msr, val, failed); }EXPORT_SYMBOL (do_trace_write_msr);EXPORT_TRACEPOINT_SYMBOL (write_msr); -void do_trace_read_msr (unsigned int msr,u64 val,int failed) +void do_trace_read_msr (u32 msr,u64 val,int failed) {trace_read_msr (msr, val, failed); }
Signature · 1 line
2.45.2
PATCH 7/20 x86/msr: Rename 'rdmsrl()' to 'rdmsrq()'
In reply to Ingo Molnar--- arch/x86/coco/sev/core.c | 2 +- arch/x86/events/amd/brs.c | 4 +-- arch/x86/events/amd/core.c | 4 +-- arch/x86/events/amd/ibs.c | 18 ++++++------ arch/x86/events/amd/lbr.c | 8 +++--- arch/x86/events/amd/power.c | 8 +++--- arch/x86/events/amd/uncore.c | 2 +- arch/x86/events/core.c | 20 +++++++------- arch/x86/events/intel/core.c | 10 +++---- arch/x86/events/intel/cstate.c | 2 +- arch/x86/events/intel/knc.c | 6 ++-- arch/x86/events/intel/lbr.c | 14 +++++----- arch/x86/events/intel/p4.c | 4 +-- arch/x86/events/intel/p6.c | 4 +-- arch/x86/events/intel/pt.c | 12 ++++---- arch/x86/events/intel/uncore.c | 2 +- arch/x86/events/intel/uncore_nhmex.c | 4 +-- arch/x86/events/intel/uncore_snb.c | 2 +- arch/x86/events/intel/uncore_snbep.c | 6 ++-- arch/x86/events/msr.c | 2 +- arch/x86/events/perf_event.h | 6 ++-- arch/x86/events/rapl.c | 6 ++-- arch/x86/events/zhaoxin/core.c | 6 ++-- arch/x86/hyperv/hv_apic.c | 2 +- arch/x86/hyperv/hv_init.c | 26 +++++++++--------- arch/x86/hyperv/hv_spinlock.c | 6 ++-- arch/x86/include/asm/apic.h | 4 +-- arch/x86/include/asm/debugreg.h | 2 +- arch/x86/include/asm/fsgsbase.h | 2 +- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/include/asm/msr.h | 4 +-- arch/x86/include/asm/paravirt.h | 2 +- arch/x86/kernel/apic/apic.c | 6 ++-- arch/x86/kernel/apic/apic_numachip.c | 6 ++-- arch/x86/kernel/cet.c | 2 +- arch/x86/kernel/cpu/amd.c | 8 +++--- arch/x86/kernel/cpu/aperfmperf.c | 8 +++--- arch/x86/kernel/cpu/bugs.c | 12 ++++---- arch/x86/kernel/cpu/bus_lock.c | 8 +++--- arch/x86/kernel/cpu/common.c | 10 +++---- arch/x86/kernel/cpu/hygon.c | 4 +-- arch/x86/kernel/cpu/intel.c | 4 +-- arch/x86/kernel/cpu/intel_epb.c | 4 +-- arch/x86/kernel/cpu/mce/amd.c | 14 +++++----- arch/x86/kernel/cpu/mce/core.c | 6 ++-- arch/x86/kernel/cpu/mce/inject.c | 2 +- arch/x86/kernel/cpu/mce/intel.c | 18 ++++++------ arch/x86/kernel/cpu/mshyperv.c | 6 ++-- arch/x86/kernel/cpu/resctrl/core.c | 2 +- arch/x86/kernel/cpu/resctrl/monitor.c | 2 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +- arch/x86/kernel/cpu/topology.c | 2 +- arch/x86/kernel/cpu/topology_amd.c | 4 +-- arch/x86/kernel/cpu/tsx.c | 10 +++---- arch/x86/kernel/cpu/umwait.c | 2 +- arch/x86/kernel/fpu/core.c | 2 +- arch/x86/kernel/hpet.c | 2 +- arch/x86/kernel/kvm.c | 2 +- arch/x86/kernel/mmconf-fam10h_64.c | 6 ++-- arch/x86/kernel/process.c | 2 +- arch/x86/kernel/process_64.c | 14 +++++----- arch/x86/kernel/shstk.c | 4 +-- arch/x86/kernel/traps.c | 4 +-- arch/x86/kernel/tsc.c | 2 +- arch/x86/kernel/tsc_sync.c | 6 ++-- arch/x86/kvm/svm/svm.c | 6 ++-- arch/x86/kvm/vmx/nested.c | 4 +-- arch/x86/kvm/vmx/pmu_intel.c | 2 +- arch/x86/kvm/vmx/sgx.c | 6 ++-- arch/x86/kvm/vmx/vmx.c | 32 +++++++++++----------- arch/x86/kvm/x86.c | 4 +-- arch/x86/lib/insn-eval.c | 6 ++-- arch/x86/mm/pat/memtype.c | 2 +- arch/x86/pci/amd_bus.c | 8 +++--- arch/x86/platform/olpc/olpc-xo1-rtc.c | 6 ++-- arch/x86/power/cpu.c | 10 +++---- arch/x86/realmode/init.c | 2 +- arch/x86/virt/svm/sev.c | 16 +++++------ arch/x86/xen/suspend.c | 2 +- drivers/cpufreq/acpi-cpufreq.c | 2 +- drivers/cpufreq/amd-pstate.c | 4 +-- drivers/cpufreq/e_powersaver.c | 4 +-- drivers/cpufreq/intel_pstate.c | 28 +++++++++---------- drivers/cpufreq/longhaul.c | 8 +++--- drivers/cpufreq/powernow-k7.c | 10 +++---- drivers/edac/amd64_edac.c | 6 ++-- drivers/idle/intel_idle.c | 24 ++++++++-------- drivers/mtd/nand/raw/cs553x_nand.c | 6 ++-- drivers/platform/x86/intel/ifs/load.c | 10 +++---- drivers/platform/x86/intel/ifs/runtest.c | 8 +++--- drivers/platform/x86/intel/pmc/cnp.c | 2 +- .../x86/intel/speed_select_if/isst_if_mbox_msr.c | 6 ++-- .../x86/intel/speed_select_if/isst_tpmi_core.c | 2 +- drivers/platform/x86/intel_ips.c | 20 +++++++------- drivers/thermal/intel/intel_hfi.c | 8 +++--- drivers/thermal/intel/therm_throt.c | 6 ++-- drivers/video/fbdev/geode/gxfb_core.c | 2 +- drivers/video/fbdev/geode/lxfb_ops.c | 12 ++++---- drivers/video/fbdev/geode/suspend_gx.c | 8 +++--- drivers/video/fbdev/geode/video_gx.c | 8 +++--- include/hyperv/hvgdk_mini.h | 2 +- 101 files changed, 340 insertions(+), 340 deletions(-)
arch/x86/coco/sev/core.c +1 -1
@@ -3278,7 +3278,7 @@ void __init snp_secure_tsc_init(void)return ;setup_force_cpu_cap (X86_FEATURE_TSC_KNOWN_FREQ ); -rdmsrl (MSR_AMD64_GUEST_TSC_FREQ , tsc_freq_mhz); +rdmsrq (MSR_AMD64_GUEST_TSC_FREQ , tsc_freq_mhz); snp_tsc_freq_khz = (unsigned long )(tsc_freq_mhz *1000 ); x86_platform.calibrate_cpu = securetsc_get_tsc_khz;
arch/x86/events/amd/brs.c +2 -2
@@ -325,7 +325,7 @@ void amd_brs_drain(void)u32 brs_idx = tos - i;u64 from, to; -rdmsrl (brs_to (brs_idx), to); +rdmsrq (brs_to (brs_idx), to);/* Entry does not belong to us (as marked by kernel) */ if (to ==BRS_POISON )
@@ -341,7 +341,7 @@ void amd_brs_drain(void)if (!amd_brs_match_plm (event, to))continue ; -rdmsrl (brs_from (brs_idx), from); +rdmsrq (brs_from (brs_idx), from);perf_clear_branch_entry_bitfields (br+nr);
arch/x86/events/amd/core.c +2 -2
@@ -659,7 +659,7 @@ static inline u64 amd_pmu_get_global_status(void)u64 status;/* PerfCntrGlobalStatus is read-only */ -rdmsrl (MSR_AMD64_PERF_CNTR_GLOBAL_STATUS , status); +rdmsrq (MSR_AMD64_PERF_CNTR_GLOBAL_STATUS , status);return status; }
@@ -679,7 +679,7 @@ static bool amd_pmu_test_overflow_topbit(int idx) {u64 counter; -rdmsrl (x86_pmu_event_addr (idx), counter); +rdmsrq (x86_pmu_event_addr (idx), counter);return !(counter &BIT_ULL (x86_pmu.cntval_bits -1 )); }
arch/x86/events/amd/ibs.c +9 -9
@@ -424,7 +424,7 @@ perf_ibs_event_update(struct perf_ibs *perf_ibs, struct perf_event *event,* prev count manually on overflow. */ while (!perf_event_try_update (event, count,64 )) { -rdmsrl (event->hw.config_base, *config); +rdmsrq (event->hw.config_base, *config); count = perf_ibs->get_count (*config); } }
@@ -513,7 +513,7 @@ static void perf_ibs_stop(struct perf_event *event, int flags)if (!stopping && (hwc->state &PERF_HES_UPTODATE ))return ; -rdmsrl (hwc->config_base, config); +rdmsrq (hwc->config_base, config);if (stopping) {/*
@@ -1256,7 +1256,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs) hwc = &event->hw; msr = hwc->config_base; buf = ibs_data.regs; -rdmsrl (msr, *buf); +rdmsrq (msr, *buf);if (!(*buf++ & perf_ibs->valid_mask)) goto fail;
@@ -1274,7 +1274,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs) offset_max =perf_ibs_get_offset_max (perf_ibs, event, check_rip); do { - rdmsrl(msr + offset, *buf++); + rdmsrq(msr + offset, *buf++); size++; offset = find_next_bit(perf_ibs->offset_mask, perf_ibs->offset_max,
@@ -1304,17 +1304,17 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)if (event->attr.sample_type &PERF_SAMPLE_RAW ) {if (perf_ibs == &perf_ibs_op) {if (ibs_caps &IBS_CAPS_BRNTRGT ) { -rdmsrl (MSR_AMD64_IBSBRTARGET , *buf++); +rdmsrq (MSR_AMD64_IBSBRTARGET , *buf++); br_target_idx = size; size++; }if (ibs_caps &IBS_CAPS_OPDATA4 ) { -rdmsrl (MSR_AMD64_IBSOPDATA4 , *buf++); +rdmsrq (MSR_AMD64_IBSOPDATA4 , *buf++); size++; } }if (perf_ibs == &perf_ibs_fetch && (ibs_caps &IBS_CAPS_FETCHCTLEXTD )) { -rdmsrl (MSR_AMD64_ICIBSEXTDCTL , *buf++); +rdmsrq (MSR_AMD64_ICIBSEXTDCTL , *buf++); size++; } }
@@ -1565,7 +1565,7 @@ static inline int ibs_eilvt_valid(void)preempt_disable (); -rdmsrl (MSR_AMD64_IBSCTL , val); +rdmsrq (MSR_AMD64_IBSCTL , val); offset = val &IBSCTL_LVT_OFFSET_MASK ;if (!(val &IBSCTL_LVT_OFFSET_VALID )) {
@@ -1680,7 +1680,7 @@ static inline int get_ibs_lvt_offset(void) {u64 val; -rdmsrl (MSR_AMD64_IBSCTL , val); +rdmsrq (MSR_AMD64_IBSCTL , val);if (!(val &IBSCTL_LVT_OFFSET_VALID ))return -EINVAL ;
arch/x86/events/amd/lbr.c +4 -4
@@ -73,7 +73,7 @@ static __always_inline u64 amd_pmu_lbr_get_from(unsigned int idx) {u64 val; -rdmsrl (MSR_AMD_SAMP_BR_FROM + idx *2 , val); +rdmsrq (MSR_AMD_SAMP_BR_FROM + idx *2 , val);return val; }
@@ -82,7 +82,7 @@ static __always_inline u64 amd_pmu_lbr_get_to(unsigned int idx) {u64 val; -rdmsrl (MSR_AMD_SAMP_BR_FROM + idx *2 +1 , val); +rdmsrq (MSR_AMD_SAMP_BR_FROM + idx *2 +1 , val);return val; }
@@ -400,11 +400,11 @@ void amd_pmu_lbr_enable_all(void) }if (cpu_feature_enabled (X86_FEATURE_AMD_LBR_PMC_FREEZE )) { -rdmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl); +rdmsrq (MSR_IA32_DEBUGCTLMSR , dbg_ctl);wrmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl |DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); } -rdmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg); +rdmsrq (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg);wrmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg |DBG_EXTN_CFG_LBRV2EN ); }
arch/x86/events/amd/power.c +4 -4
@@ -48,8 +48,8 @@ static void event_update(struct perf_event *event) prev_pwr_acc = hwc->pwr_acc; prev_ptsc = hwc->ptsc; -rdmsrl (MSR_F15H_CU_PWR_ACCUMULATOR , new_pwr_acc); -rdmsrl (MSR_F15H_PTSC , new_ptsc); +rdmsrq (MSR_F15H_CU_PWR_ACCUMULATOR , new_pwr_acc); +rdmsrq (MSR_F15H_PTSC , new_ptsc);/* * Calculate the CU power consumption over a time period, the unit of
@@ -75,8 +75,8 @@ static void __pmu_event_start(struct perf_event *event) event->hw.state =0 ; -rdmsrl (MSR_F15H_PTSC , event->hw.ptsc); -rdmsrl (MSR_F15H_CU_PWR_ACCUMULATOR , event->hw.pwr_acc); +rdmsrq (MSR_F15H_PTSC , event->hw.ptsc); +rdmsrq (MSR_F15H_CU_PWR_ACCUMULATOR , event->hw.pwr_acc); }static void pmu_event_start (struct perf_event *event,int mode)
arch/x86/events/amd/uncore.c +1 -1
@@ -106,7 +106,7 @@ static void amd_uncore_read(struct perf_event *event)* read counts directly from the corresponding PERF_CTR. */ if (hwc->event_base_rdpmc <0 ) -rdmsrl (hwc->event_base, new); +rdmsrq (hwc->event_base, new);else rdpmcl (hwc->event_base_rdpmc, new);
arch/x86/events/core.c +10 -10
@@ -693,7 +693,7 @@ void x86_pmu_disable_all(void)if (!test_bit (idx, cpuc->active_mask))continue ; -rdmsrl (x86_pmu_config_addr (idx), val); +rdmsrq (x86_pmu_config_addr (idx), val);if (!(val &ARCH_PERFMON_EVENTSEL_ENABLE ))continue ; val &= ~ARCH_PERFMON_EVENTSEL_ENABLE ;
@@ -1550,10 +1550,10 @@ void perf_event_print_debug(void)return ;if (x86_pmu.version >=2 ) { -rdmsrl (MSR_CORE_PERF_GLOBAL_CTRL , ctrl); -rdmsrl (MSR_CORE_PERF_GLOBAL_STATUS , status); -rdmsrl (MSR_CORE_PERF_GLOBAL_OVF_CTRL , overflow); -rdmsrl (MSR_ARCH_PERFMON_FIXED_CTR_CTRL , fixed); +rdmsrq (MSR_CORE_PERF_GLOBAL_CTRL , ctrl); +rdmsrq (MSR_CORE_PERF_GLOBAL_STATUS , status); +rdmsrq (MSR_CORE_PERF_GLOBAL_OVF_CTRL , overflow); +rdmsrq (MSR_ARCH_PERFMON_FIXED_CTR_CTRL , fixed);pr_info ("\n" );pr_info ("CPU#%d: ctrl: %016llx\n" , cpu, ctrl);
@@ -1561,19 +1561,19 @@ void perf_event_print_debug(void)pr_info ("CPU#%d: overflow: %016llx\n" , cpu, overflow);pr_info ("CPU#%d: fixed: %016llx\n" , cpu, fixed);if (pebs_constraints) { -rdmsrl (MSR_IA32_PEBS_ENABLE , pebs); +rdmsrq (MSR_IA32_PEBS_ENABLE , pebs);pr_info ("CPU#%d: pebs: %016llx\n" , cpu, pebs); }if (x86_pmu.lbr_nr) { -rdmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); +rdmsrq (MSR_IA32_DEBUGCTLMSR , debugctl);pr_info ("CPU#%d: debugctl: %016llx\n" , cpu, debugctl); } }pr_info ("CPU#%d: active: %016llx\n" , cpu, *(u64 *)cpuc->active_mask);for_each_set_bit (idx, cntr_mask,X86_PMC_IDX_MAX ) { -rdmsrl (x86_pmu_config_addr (idx), pmc_ctrl); -rdmsrl (x86_pmu_event_addr (idx), pmc_count); +rdmsrq (x86_pmu_config_addr (idx), pmc_ctrl); +rdmsrq (x86_pmu_event_addr (idx), pmc_count); prev_left =per_cpu (pmc_prev_left[idx], cpu);
@@ -1587,7 +1587,7 @@ void perf_event_print_debug(void)for_each_set_bit (idx, fixed_cntr_mask,X86_PMC_IDX_MAX ) {if (fixed_counter_disabled (idx, cpuc->pmu))continue ; -rdmsrl (x86_pmu_fixed_ctr_addr (idx), pmc_count); +rdmsrq (x86_pmu_fixed_ctr_addr (idx), pmc_count);pr_info ("CPU#%d: fixed-PMC%d count: %016llx\n" , cpu, idx, pmc_count);
arch/x86/events/intel/core.c +5 -5
@@ -2489,7 +2489,7 @@ static inline u64 intel_pmu_get_status(void) {u64 status; -rdmsrl (MSR_CORE_PERF_GLOBAL_STATUS , status); +rdmsrq (MSR_CORE_PERF_GLOBAL_STATUS , status);return status; }
@@ -5054,7 +5054,7 @@ static void update_pmu_cap(struct x86_hybrid_pmu *pmu)if (!intel_pmu_broken_perf_cap ()) {/* Perf Metric (Bit 15) and PEBS via PT (Bit 16) are hybrid enumeration */ -rdmsrl (MSR_IA32_PERF_CAPABILITIES , pmu->intel_cap.capabilities); +rdmsrq (MSR_IA32_PERF_CAPABILITIES , pmu->intel_cap.capabilities); } }
@@ -5202,7 +5202,7 @@ static void intel_pmu_cpu_starting(int cpu)if (!is_hybrid () && x86_pmu.intel_cap.perf_metrics) {union perf_capabilities perf_cap; -rdmsrl (MSR_IA32_PERF_CAPABILITIES , perf_cap.capabilities); +rdmsrq (MSR_IA32_PERF_CAPABILITIES , perf_cap.capabilities);if (!perf_cap.perf_metrics) { x86_pmu.intel_cap.perf_metrics =0 ; x86_pmu.intel_ctrl &= ~(1ULL <<GLOBAL_CTRL_EN_PERF_METRICS );
@@ -5627,7 +5627,7 @@ static bool check_msr(unsigned long msr, u64 mask)/* * Quirk only affects validation in wrmsr(), so wrmsrl()'s value -* should equal rdmsrl()'s even with the quirk. +* should equal rdmsrq()'s even with the quirk. */ if (val_new != val_tmp)return false;
@@ -6642,7 +6642,7 @@ __init int intel_pmu_init(void)if (boot_cpu_has (X86_FEATURE_PDCM )) {u64 capabilities; -rdmsrl (MSR_IA32_PERF_CAPABILITIES , capabilities); +rdmsrq (MSR_IA32_PERF_CAPABILITIES , capabilities); x86_pmu.intel_cap.capabilities = capabilities; }
arch/x86/events/intel/cstate.c +1 -1
@@ -320,7 +320,7 @@ static inline u64 cstate_pmu_read_counter(struct perf_event *event) {u64 val; -rdmsrl (event->hw.event_base, val); +rdmsrq (event->hw.event_base, val);return val; }
arch/x86/events/intel/knc.c +3 -3
@@ -159,7 +159,7 @@ static void knc_pmu_disable_all(void) {u64 val; -rdmsrl (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); +rdmsrq (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); val &= ~(KNC_ENABLE_COUNTER0 |KNC_ENABLE_COUNTER1 );wrmsrl (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); }
@@ -168,7 +168,7 @@ static void knc_pmu_enable_all(int added) {u64 val; -rdmsrl (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); +rdmsrq (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); val |= (KNC_ENABLE_COUNTER0 |KNC_ENABLE_COUNTER1 );wrmsrl (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); }
@@ -200,7 +200,7 @@ static inline u64 knc_pmu_get_status(void) {u64 status; -rdmsrl (MSR_KNC_IA32_PERF_GLOBAL_STATUS , status); +rdmsrq (MSR_KNC_IA32_PERF_GLOBAL_STATUS , status);return status; }
arch/x86/events/intel/lbr.c +7 -7
@@ -139,7 +139,7 @@ static void __intel_pmu_lbr_enable(bool pmi)if (!static_cpu_has (X86_FEATURE_ARCH_LBR ) && !pmi && cpuc->lbr_sel)wrmsrl (MSR_LBR_SELECT , lbr_select); -rdmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); +rdmsrq (MSR_IA32_DEBUGCTLMSR , debugctl); orig_debugctl = debugctl;if (!static_cpu_has (X86_FEATURE_ARCH_LBR ))
@@ -209,7 +209,7 @@ static inline u64 intel_pmu_lbr_tos(void) {u64 tos; -rdmsrl (x86_pmu.lbr_tos, tos); +rdmsrq (x86_pmu.lbr_tos, tos);return tos; }
@@ -302,7 +302,7 @@ static __always_inline u64 rdlbr_from(unsigned int idx, struct lbr_entry *lbr)if (lbr)return lbr->from; -rdmsrl (x86_pmu.lbr_from + idx, val); +rdmsrq (x86_pmu.lbr_from + idx, val);return lbr_from_signext_quirk_rd (val); }
@@ -314,7 +314,7 @@ static __always_inline u64 rdlbr_to(unsigned int idx, struct lbr_entry *lbr)if (lbr)return lbr->to; -rdmsrl (x86_pmu.lbr_to + idx, val); +rdmsrq (x86_pmu.lbr_to + idx, val);return val; }
@@ -326,7 +326,7 @@ static __always_inline u64 rdlbr_info(unsigned int idx, struct lbr_entry *lbr)if (lbr)return lbr->info; -rdmsrl (x86_pmu.lbr_info + idx, val); +rdmsrq (x86_pmu.lbr_info + idx, val);return val; }
@@ -475,7 +475,7 @@ void intel_pmu_lbr_save(void *ctx) task_ctx->tos = tos;if (cpuc->lbr_select) -rdmsrl (MSR_LBR_SELECT , task_ctx->lbr_sel); +rdmsrq (MSR_LBR_SELECT , task_ctx->lbr_sel); }static void intel_pmu_arch_lbr_save (void *ctx)
@@ -752,7 +752,7 @@ void intel_pmu_lbr_read_32(struct cpu_hw_events *cpuc)u64 lbr; } msr_lastbranch; -rdmsrl (x86_pmu.lbr_from + lbr_idx, msr_lastbranch.lbr); +rdmsrq (x86_pmu.lbr_from + lbr_idx, msr_lastbranch.lbr);perf_clear_branch_entry_bitfields (br);
arch/x86/events/intel/p4.c +2 -2
@@ -859,7 +859,7 @@ static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc)u64 v;/* an official way for overflow indication */ -rdmsrl (hwc->config_base, v); +rdmsrq (hwc->config_base, v);if (v &P4_CCCR_OVF ) {wrmsrl (hwc->config_base, v & ~P4_CCCR_OVF );return 1 ;
@@ -872,7 +872,7 @@ static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc)* the counter has reached zero value and continued counting before * real NMI signal was received: */ -rdmsrl (hwc->event_base, v); +rdmsrq (hwc->event_base, v);if (!(v &ARCH_P4_UNFLAGGED_BIT ))return 1 ;
arch/x86/events/intel/p6.c +2 -2
@@ -142,7 +142,7 @@ static void p6_pmu_disable_all(void)u64 val;/* p6 only has one enable register */ -rdmsrl (MSR_P6_EVNTSEL0 , val); +rdmsrq (MSR_P6_EVNTSEL0 , val); val &= ~ARCH_PERFMON_EVENTSEL_ENABLE ;wrmsrl (MSR_P6_EVNTSEL0 , val); }
@@ -152,7 +152,7 @@ static void p6_pmu_enable_all(int added)unsigned long val;/* p6 only has one enable register */ -rdmsrl (MSR_P6_EVNTSEL0 , val); +rdmsrq (MSR_P6_EVNTSEL0 , val); val |=ARCH_PERFMON_EVENTSEL_ENABLE ;wrmsrl (MSR_P6_EVNTSEL0 , val); }
arch/x86/events/intel/pt.c +6 -6
@@ -194,7 +194,7 @@ static int __init pt_pmu_hw_init(void)int ret;long i; -rdmsrl (MSR_PLATFORM_INFO , reg); +rdmsrq (MSR_PLATFORM_INFO , reg); pt_pmu.max_nonturbo_ratio = (reg &0xff00 ) >>8 ;/*
@@ -230,7 +230,7 @@ static int __init pt_pmu_hw_init(void)* "IA32_VMX_MISC[bit 14]" being 1 means PT can trace * post-VMXON. */ -rdmsrl (MSR_IA32_VMX_MISC , reg); +rdmsrq (MSR_IA32_VMX_MISC , reg);if (reg &BIT (14 )) pt_pmu.vmx = true; }
@@ -926,7 +926,7 @@ static void pt_handle_status(struct pt *pt)int advance =0 ;u64 status; -rdmsrl (MSR_IA32_RTIT_STATUS , status); +rdmsrq (MSR_IA32_RTIT_STATUS , status);if (status &RTIT_STATUS_ERROR ) {pr_err_ratelimited ("ToPA ERROR encountered, trying to recover\n" );
@@ -985,12 +985,12 @@ static void pt_read_offset(struct pt_buffer *buf)struct topa_page *tp;if (!buf->single) { -rdmsrl (MSR_IA32_RTIT_OUTPUT_BASE , pt->output_base); +rdmsrq (MSR_IA32_RTIT_OUTPUT_BASE , pt->output_base); tp =phys_to_virt (pt->output_base); buf->cur = &tp->topa; } -rdmsrl (MSR_IA32_RTIT_OUTPUT_MASK , pt->output_mask); +rdmsrq (MSR_IA32_RTIT_OUTPUT_MASK , pt->output_mask);/* offset within current output region */ buf->output_off = pt->output_mask >>32 ;/* index of current output region within this table */
@@ -1611,7 +1611,7 @@ static void pt_event_start(struct perf_event *event, int mode)* PMI might have just cleared these, so resume_allowed * must be checked again also. */ -rdmsrl (MSR_IA32_RTIT_STATUS , status); +rdmsrq (MSR_IA32_RTIT_STATUS , status); if (!(status & (RTIT_STATUS_TRIGGEREN | RTIT_STATUS_ERROR | RTIT_STATUS_STOPPED)) &&
arch/x86/events/intel/uncore.c +1 -1
@@ -150,7 +150,7 @@ u64 uncore_msr_read_counter(struct intel_uncore_box *box, struct perf_event *eve {u64 count; -rdmsrl (event->hw.event_base, count); +rdmsrq (event->hw.event_base, count);return count; }
arch/x86/events/intel/uncore_nhmex.c +2 -2
@@ -214,7 +214,7 @@ static void nhmex_uncore_msr_disable_box(struct intel_uncore_box *box)u64 config;if (msr) { -rdmsrl (msr, config); +rdmsrq (msr, config); config &= ~((1ULL <<uncore_num_counters (box)) -1 );/* WBox has a fixed counter */ if (uncore_msr_fixed_ctl (box))
@@ -229,7 +229,7 @@ static void nhmex_uncore_msr_enable_box(struct intel_uncore_box *box)u64 config;if (msr) { -rdmsrl (msr, config); +rdmsrq (msr, config); config |= (1ULL <<uncore_num_counters (box)) -1 ;/* WBox has a fixed counter */ if (uncore_msr_fixed_ctl (box))
arch/x86/events/intel/uncore_snb.c +1 -1
@@ -504,7 +504,7 @@ static int icl_get_cbox_num(void) {u64 num_boxes; -rdmsrl (ICL_UNC_CBO_CONFIG , num_boxes); +rdmsrq (ICL_UNC_CBO_CONFIG , num_boxes);return num_boxes &ICL_UNC_NUM_CBO_MASK ; }
arch/x86/events/intel/uncore_snbep.c +3 -3
@@ -618,7 +618,7 @@ static void snbep_uncore_msr_disable_box(struct intel_uncore_box *box) msr =uncore_msr_box_ctl (box);if (msr) { -rdmsrl (msr, config); +rdmsrq (msr, config); config |=SNBEP_PMON_BOX_CTL_FRZ ;wrmsrl (msr, config); }
@@ -631,7 +631,7 @@ static void snbep_uncore_msr_enable_box(struct intel_uncore_box *box) msr =uncore_msr_box_ctl (box);if (msr) { -rdmsrl (msr, config); +rdmsrq (msr, config); config &= ~SNBEP_PMON_BOX_CTL_FRZ ;wrmsrl (msr, config); }
@@ -6572,7 +6572,7 @@ void spr_uncore_cpu_init(void)* of UNCORE_SPR_CHA) is incorrect on some SPR variants because of a * firmware bug. Using the value from SPR_MSR_UNC_CBO_CONFIG to replace it. */ -rdmsrl (SPR_MSR_UNC_CBO_CONFIG , num_cbo); +rdmsrq (SPR_MSR_UNC_CBO_CONFIG , num_cbo);/* * The MSR doesn't work on the EMR XCC, but the firmware bug doesn't impact * the EMR XCC. Don't let the value from the MSR replace the existing value.
arch/x86/events/msr.c +1 -1
@@ -231,7 +231,7 @@ static inline u64 msr_read_counter(struct perf_event *event)u64 now;if (event->hw.event_base) -rdmsrl (event->hw.event_base, now); +rdmsrq (event->hw.event_base, now);else now =rdtsc_ordered ();
arch/x86/events/perf_event.h +3 -3
@@ -1394,11 +1394,11 @@ static __always_inline void __amd_pmu_lbr_disable(void) {u64 dbg_ctl, dbg_extn_cfg; -rdmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg); +rdmsrq (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg);wrmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg & ~DBG_EXTN_CFG_LBRV2EN );if (cpu_feature_enabled (X86_FEATURE_AMD_LBR_PMC_FREEZE )) { -rdmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl); +rdmsrq (MSR_IA32_DEBUGCTLMSR , dbg_ctl);wrmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl & ~DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); } }
@@ -1543,7 +1543,7 @@ static __always_inline void __intel_pmu_lbr_disable(void) {u64 debugctl; -rdmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); +rdmsrq (MSR_IA32_DEBUGCTLMSR , debugctl); debugctl &= ~(DEBUGCTLMSR_LBR |DEBUGCTLMSR_FREEZE_LBRS_ON_PMI );wrmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); }
arch/x86/events/rapl.c +3 -3
@@ -192,7 +192,7 @@ static inline unsigned int get_rapl_pmu_idx(int cpu, int scope)static inline u64 rapl_read_counter (struct perf_event *event) {u64 raw; -rdmsrl (event->hw.event_base, raw); +rdmsrq (event->hw.event_base, raw);return raw; }
@@ -221,7 +221,7 @@ static u64 rapl_event_update(struct perf_event *event) prev_raw_count =local64_read (&hwc->prev_count);do { -rdmsrl (event->hw.event_base, new_raw_count); +rdmsrq (event->hw.event_base, new_raw_count); }while (!local64_try_cmpxchg (&hwc->prev_count, &prev_raw_count, new_raw_count));
@@ -610,7 +610,7 @@ static int rapl_check_hw_unit(void)u64 msr_rapl_power_unit_bits;int i; -/* protect rdmsrl() to handle virtualization */ +/* protect rdmsrq() to handle virtualization */ if (rdmsrl_safe (rapl_model->msr_power_unit, &msr_rapl_power_unit_bits))return -1 ;for (i =0 ; i <NR_RAPL_PKG_DOMAINS ; i++)
arch/x86/events/zhaoxin/core.c +3 -3
@@ -266,7 +266,7 @@ static inline u64 zhaoxin_pmu_get_status(void) {u64 status; -rdmsrl (MSR_CORE_PERF_GLOBAL_STATUS , status); +rdmsrq (MSR_CORE_PERF_GLOBAL_STATUS , status);return status; }
@@ -293,7 +293,7 @@ static void zhaoxin_pmu_disable_fixed(struct hw_perf_event *hwc) mask =0xfULL << (idx *4 ); -rdmsrl (hwc->config_base, ctrl_val); +rdmsrq (hwc->config_base, ctrl_val); ctrl_val &= ~mask;wrmsrl (hwc->config_base, ctrl_val); }
@@ -329,7 +329,7 @@ static void zhaoxin_pmu_enable_fixed(struct hw_perf_event *hwc) bits <<= (idx *4 ); mask =0xfULL << (idx *4 ); -rdmsrl (hwc->config_base, ctrl_val); +rdmsrq (hwc->config_base, ctrl_val); ctrl_val &= ~mask; ctrl_val |= bits;wrmsrl (hwc->config_base, ctrl_val);
arch/x86/hyperv/hv_apic.c +1 -1
@@ -37,7 +37,7 @@ static u64 hv_apic_icr_read(void) {u64 reg_val; -rdmsrl (HV_X64_MSR_ICR , reg_val); +rdmsrq (HV_X64_MSR_ICR , reg_val);return reg_val; }
arch/x86/hyperv/hv_init.c +13 -13
@@ -62,7 +62,7 @@ static int hyperv_init_ghcb(void)* returned by MSR_AMD64_SEV_ES_GHCB is above shared * memory boundary and map it here. */ -rdmsrl (MSR_AMD64_SEV_ES_GHCB , ghcb_gpa); +rdmsrq (MSR_AMD64_SEV_ES_GHCB , ghcb_gpa);/* Mask out vTOM bit. ioremap_cache() maps decrypted */ ghcb_gpa &= ~ms_hyperv.shared_gpa_boundary;
@@ -95,7 +95,7 @@ static int hv_cpu_init(unsigned int cpu)* For root partition we get the hypervisor provided VP assist * page, instead of allocating a new page. */ -rdmsrl (HV_X64_MSR_VP_ASSIST_PAGE , msr.as_uint64); +rdmsrq (HV_X64_MSR_VP_ASSIST_PAGE , msr.as_uint64); *hvp =memremap (msr.pfn <<HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_SHIFT ,PAGE_SIZE ,MEMREMAP_WB ); }else {
@@ -140,7 +140,7 @@ static void hv_reenlightenment_notify(struct work_struct *dummy) {struct hv_tsc_emulation_status emu_status; -rdmsrl (HV_X64_MSR_TSC_EMULATION_STATUS , *(u64 *)&emu_status); +rdmsrq (HV_X64_MSR_TSC_EMULATION_STATUS , *(u64 *)&emu_status);/* Don't issue the callback if TSC accesses are not emulated */ if (hv_reenlightenment_cb && emu_status.inprogress)
@@ -153,11 +153,11 @@ void hyperv_stop_tsc_emulation(void)u64 freq;struct hv_tsc_emulation_status emu_status; -rdmsrl (HV_X64_MSR_TSC_EMULATION_STATUS , *(u64 *)&emu_status); +rdmsrq (HV_X64_MSR_TSC_EMULATION_STATUS , *(u64 *)&emu_status); emu_status.inprogress =0 ;wrmsrl (HV_X64_MSR_TSC_EMULATION_STATUS , *(u64 *)&emu_status); -rdmsrl (HV_X64_MSR_TSC_FREQUENCY , freq); +rdmsrq (HV_X64_MSR_TSC_FREQUENCY , freq); tsc_khz =div64_u64 (freq,1000 ); }EXPORT_SYMBOL_GPL (hyperv_stop_tsc_emulation);
@@ -217,7 +217,7 @@ void clear_hv_tscchange_cb(void)if (!hv_reenlightenment_available ())return ; -rdmsrl (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *(u64 *)&re_ctrl); +rdmsrq (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *(u64 *)&re_ctrl); re_ctrl.enabled =0 ;wrmsrl (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *(u64 *)&re_ctrl);
@@ -251,7 +251,7 @@ static int hv_cpu_die(unsigned int cpu)*/ memunmap (hv_vp_assist_page[cpu]); hv_vp_assist_page[cpu] =NULL ; -rdmsrl (HV_X64_MSR_VP_ASSIST_PAGE , msr.as_uint64); +rdmsrq (HV_X64_MSR_VP_ASSIST_PAGE , msr.as_uint64); msr.enable =0 ; }wrmsrl (HV_X64_MSR_VP_ASSIST_PAGE , msr.as_uint64);
@@ -260,7 +260,7 @@ static int hv_cpu_die(unsigned int cpu)if (hv_reenlightenment_cb ==NULL )return 0 ; -rdmsrl (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *((u64 *)&re_ctrl)); +rdmsrq (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *((u64 *)&re_ctrl));if (re_ctrl.target_vp == hv_vp_index[cpu]) {/* * Reassign reenlightenment notifications to some other online
@@ -331,7 +331,7 @@ static int hv_suspend(void) hv_hypercall_pg =NULL ;/* Disable the hypercall page in the hypervisor */ -rdmsrl (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); +rdmsrq (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); hypercall_msr.enable =0 ;wrmsrl (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64);
@@ -348,7 +348,7 @@ static void hv_resume(void)WARN_ON (ret);/* Re-enable the hypercall page */ -rdmsrl (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); +rdmsrq (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); hypercall_msr.enable =1 ; hypercall_msr.guest_physical_address =vmalloc_to_pfn (hv_hypercall_pg_saved);
@@ -515,7 +515,7 @@ void __init hyperv_init(void)if (hv_hypercall_pg ==NULL ) goto clean_guest_os_id; -rdmsrl (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); +rdmsrq (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); hypercall_msr.enable =1 ;if (hv_root_partition ()) {
@@ -667,7 +667,7 @@ void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die)return ; panic_reported = true; -rdmsrl (HV_X64_MSR_GUEST_OS_ID , guest_id); +rdmsrq (HV_X64_MSR_GUEST_OS_ID , guest_id);wrmsrl (HV_X64_MSR_CRASH_P0 , err);wrmsrl (HV_X64_MSR_CRASH_P1 , guest_id);
@@ -701,7 +701,7 @@ bool hv_is_hyperv_initialized(void)* that the hypercall page is setup */ hypercall_msr.as_uint64 =0 ; -rdmsrl (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); +rdmsrq (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64);return hypercall_msr.enable; }
arch/x86/hyperv/hv_spinlock.c +3 -3
@@ -39,18 +39,18 @@ static void hv_qlock_wait(u8 *byte, u8 val)* To prevent a race against the unlock path it is required to * disable interrupts before accessing the HV_X64_MSR_GUEST_IDLE * MSR. Otherwise, if the IPI from hv_qlock_kick() arrives between -* the lock value check and the rdmsrl() then the vCPU might be put +* the lock value check and the rdmsrq() then the vCPU might be put * into 'idle' state by the hypervisor and kept in that state for * an unspecified amount of time. */ local_irq_save (flags);/* -* Only issue the rdmsrl() when the lock state has not changed. +* Only issue the rdmsrq() when the lock state has not changed. */ if (READ_ONCE (*byte) == val) {unsigned long msr_val; -rdmsrl (HV_X64_MSR_GUEST_IDLE , msr_val); +rdmsrq (HV_X64_MSR_GUEST_IDLE , msr_val); (void )msr_val; }
arch/x86/include/asm/apic.h +2 -2
@@ -224,7 +224,7 @@ static inline u32 native_apic_msr_read(u32 reg)if (reg ==APIC_DFR )return -1 ; -rdmsrl (APIC_BASE_MSR + (reg >>4 ), msr); +rdmsrq (APIC_BASE_MSR + (reg >>4 ), msr);return (u32 )msr; }
@@ -237,7 +237,7 @@ static inline u64 native_x2apic_icr_read(void) {unsigned long val; -rdmsrl (APIC_BASE_MSR + (APIC_ICR >>4 ), val); +rdmsrq (APIC_BASE_MSR + (APIC_ICR >>4 ), val);return val; }
arch/x86/include/asm/debugreg.h +1 -1
@@ -169,7 +169,7 @@ static inline unsigned long get_debugctlmsr(void)if (boot_cpu_data.x86 <6 )return 0 ;#endif -rdmsrl (MSR_IA32_DEBUGCTLMSR , debugctlmsr); +rdmsrq (MSR_IA32_DEBUGCTLMSR , debugctlmsr);return debugctlmsr; }
arch/x86/include/asm/fsgsbase.h +1 -1
@@ -60,7 +60,7 @@ static inline unsigned long x86_fsbase_read_cpu(void)if (boot_cpu_has (X86_FEATURE_FSGSBASE )) fsbase =rdfsbase ();else -rdmsrl (MSR_FS_BASE , fsbase); +rdmsrq (MSR_FS_BASE , fsbase);return fsbase; }
arch/x86/include/asm/kvm_host.h +1 -1
@@ -2272,7 +2272,7 @@ static inline unsigned long read_msr(unsigned long msr) {u64 value; -rdmsrl (msr, value); +rdmsrq (msr, value);return value; }#endif
arch/x86/include/asm/msr.h +2 -2
@@ -255,7 +255,7 @@ static inline void wrmsr(u32 msr, u32 low, u32 high)native_write_msr (msr, low, high); } -#define rdmsrl (msr, val) \ +#define rdmsrq (msr, val) \ ((val) = native_read_msr((msr)))static inline void wrmsrl (u32 msr,u64 val)
@@ -352,7 +352,7 @@ static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) }static inline int rdmsrl_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) { -rdmsrl (msr_no, *q); +rdmsrq (msr_no, *q);return 0 ; }static inline int wrmsrl_on_cpu (unsigned int cpu,u32 msr_no,u64 q)
arch/x86/include/asm/paravirt.h +1 -1
@@ -209,7 +209,7 @@ do { \paravirt_write_msr (msr, val1, val2); \ } while (0) -#define rdmsrl (msr, val) \ +#define rdmsrq (msr, val) \ do { \ val = paravirt_read_msr(msr); \ } while (0)
arch/x86/kernel/apic/apic.c +3 -3
@@ -1694,7 +1694,7 @@ static bool x2apic_hw_locked(void) x86_arch_cap_msr =x86_read_arch_cap_msr ();if (x86_arch_cap_msr &ARCH_CAP_XAPIC_DISABLE ) { -rdmsrl (MSR_IA32_XAPIC_DISABLE_STATUS , msr); +rdmsrq (MSR_IA32_XAPIC_DISABLE_STATUS , msr);return (msr &LEGACY_XAPIC_DISABLED ); }return false;
@@ -1707,7 +1707,7 @@ static void __x2apic_disable(void)if (!boot_cpu_has (X86_FEATURE_APIC ))return ; -rdmsrl (MSR_IA32_APICBASE , msr); +rdmsrq (MSR_IA32_APICBASE , msr);if (!(msr &X2APIC_ENABLE ))return ;/* Disable xapic and x2apic first and then reenable xapic mode */
@@ -1720,7 +1720,7 @@ static void __x2apic_enable(void) {u64 msr; -rdmsrl (MSR_IA32_APICBASE , msr); +rdmsrq (MSR_IA32_APICBASE , msr);if (msr &X2APIC_ENABLE )return ;wrmsrl (MSR_IA32_APICBASE , msr |X2APIC_ENABLE );
arch/x86/kernel/apic/apic_numachip.c +3 -3
@@ -31,7 +31,7 @@ static u32 numachip1_get_apic_id(u32 x)unsigned int id = (x >>24 ) &0xff ;if (static_cpu_has (X86_FEATURE_NODEID_MSR )) { -rdmsrl (MSR_FAM10H_NODE_ID , value); +rdmsrq (MSR_FAM10H_NODE_ID , value); id |= (value <<2 ) &0xff00 ; }
@@ -42,7 +42,7 @@ static u32 numachip2_get_apic_id(u32 x) {u64 mcfg; -rdmsrl (MSR_FAM10H_MMIO_CONF_BASE , mcfg); +rdmsrq (MSR_FAM10H_MMIO_CONF_BASE , mcfg);return ((mcfg >> (28 -8 )) &0xfff00 ) | (x >>24 ); }
@@ -150,7 +150,7 @@ static void fixup_cpu_id(struct cpuinfo_x86 *c, int node)/* Account for nodes per socket in multi-core-module processors */ if (boot_cpu_has (X86_FEATURE_NODEID_MSR )) { -rdmsrl (MSR_FAM10H_NODE_ID , val); +rdmsrq (MSR_FAM10H_NODE_ID , val); nodes = ((val >>3 ) &7 ) +1 ; }
arch/x86/kernel/cet.c +1 -1
@@ -55,7 +55,7 @@ static void do_user_cp_fault(struct pt_regs *regs, unsigned long error_code)* will be whatever is live in userspace. So read the SSP before enabling * interrupts so locking the fpregs to do it later is not required. */ -rdmsrl (MSR_IA32_PL3_SSP , ssp); +rdmsrq (MSR_IA32_PL3_SSP , ssp);cond_local_irq_enable (regs);
arch/x86/kernel/cpu/amd.c +4 -4
@@ -383,7 +383,7 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) (c->x86 == 0x10 && c->x86_model >= 0x2)) {u64 val; -rdmsrl (MSR_K7_HWCR , val); +rdmsrq (MSR_K7_HWCR , val);if (!(val &BIT (24 )))pr_warn (FW_BUG "TSC doesn't count with P0 frequency!\n" ); }
@@ -508,7 +508,7 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)*/ if (cpu_has (c,X86_FEATURE_SME ) ||cpu_has (c,X86_FEATURE_SEV )) {/* Check if memory encryption is enabled */ -rdmsrl (MSR_AMD64_SYSCFG , msr); +rdmsrq (MSR_AMD64_SYSCFG , msr);if (!(msr &MSR_AMD64_SYSCFG_MEM_ENCRYPT )) goto clear_all;
@@ -525,7 +525,7 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)if (!sme_me_mask)setup_clear_cpu_cap (X86_FEATURE_SME ); -rdmsrl (MSR_K7_HWCR , msr); +rdmsrq (MSR_K7_HWCR , msr);if (!(msr &MSR_K7_HWCR_SMMLOCK )) goto clear_sev;
@@ -1014,7 +1014,7 @@ static void init_amd(struct cpuinfo_x86 *c)init_amd_cacheinfo (c);if (cpu_has (c,X86_FEATURE_SVM )) { -rdmsrl (MSR_VM_CR , vm_cr); +rdmsrq (MSR_VM_CR , vm_cr);if (vm_cr &SVM_VM_CR_SVM_DIS_MASK ) {pr_notice_once ("SVM disabled (by BIOS) in MSR_VM_CR\n" );clear_cpu_cap (c,X86_FEATURE_SVM );
arch/x86/kernel/cpu/aperfmperf.c +4 -4
@@ -40,8 +40,8 @@ static void init_counter_refs(void) {u64 aperf, mperf; -rdmsrl (MSR_IA32_APERF , aperf); -rdmsrl (MSR_IA32_MPERF , mperf); +rdmsrq (MSR_IA32_APERF , aperf); +rdmsrq (MSR_IA32_MPERF , mperf);this_cpu_write (cpu_samples.aperf, aperf);this_cpu_write (cpu_samples.mperf, mperf);
@@ -474,8 +474,8 @@ void arch_scale_freq_tick(void)if (!cpu_feature_enabled (X86_FEATURE_APERFMPERF ))return ; -rdmsrl (MSR_IA32_APERF , aperf); -rdmsrl (MSR_IA32_MPERF , mperf); +rdmsrq (MSR_IA32_APERF , aperf); +rdmsrq (MSR_IA32_MPERF , mperf); acnt = aperf - s->aperf; mcnt = mperf - s->mperf;
arch/x86/kernel/cpu/bugs.c +6 -6
@@ -140,7 +140,7 @@ void __init cpu_select_mitigations(void)* init code as it is not enumerated and depends on the family. */ if (cpu_feature_enabled (X86_FEATURE_MSR_SPEC_CTRL )) { -rdmsrl (MSR_IA32_SPEC_CTRL , x86_spec_ctrl_base); +rdmsrq (MSR_IA32_SPEC_CTRL , x86_spec_ctrl_base);/* * Previously running kernel (kexec), may have some controls
@@ -656,7 +656,7 @@ void update_srbds_msr(void)if (!boot_cpu_has (X86_FEATURE_SRBDS_CTRL ))return ; -rdmsrl (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl); +rdmsrq (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl);switch (srbds_mitigation) {case SRBDS_MITIGATION_OFF :
@@ -776,7 +776,7 @@ void update_gds_msr(void)switch (gds_mitigation) {case GDS_MITIGATION_OFF : -rdmsrl (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl); +rdmsrq (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl); mcu_ctrl |=GDS_MITG_DIS ;break ;case GDS_MITIGATION_FULL_LOCKED :
@@ -786,7 +786,7 @@ void update_gds_msr(void)* CPUs. */ case GDS_MITIGATION_FULL : -rdmsrl (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl); +rdmsrq (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl); mcu_ctrl &= ~GDS_MITG_DIS ;break ;case GDS_MITIGATION_FORCE :
@@ -802,7 +802,7 @@ void update_gds_msr(void)* GDS_MITG_DIS will be ignored if this processor is locked but the boot * processor was not. */ -rdmsrl (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl_after); +rdmsrq (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl_after);WARN_ON_ONCE (mcu_ctrl != mcu_ctrl_after); }
@@ -841,7 +841,7 @@ static void __init gds_select_mitigation(void)if (gds_mitigation ==GDS_MITIGATION_FORCE ) gds_mitigation =GDS_MITIGATION_FULL ; -rdmsrl (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl); +rdmsrq (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl);if (mcu_ctrl &GDS_MITG_LOCKED ) {if (gds_mitigation ==GDS_MITIGATION_OFF )pr_warn ("Mitigation locked. Disable failed.\n" );
arch/x86/kernel/cpu/bus_lock.c +4 -4
@@ -103,7 +103,7 @@ static bool split_lock_verify_msr(bool on) ctrl &= ~MSR_TEST_CTRL_SPLIT_LOCK_DETECT ;if (wrmsrl_safe (MSR_TEST_CTRL , ctrl))return false; -rdmsrl (MSR_TEST_CTRL , tmp); +rdmsrq (MSR_TEST_CTRL , tmp);return ctrl == tmp; }
@@ -137,7 +137,7 @@ static void __init __split_lock_setup(void)return ; } -rdmsrl (MSR_TEST_CTRL , msr_test_ctrl_cache); +rdmsrq (MSR_TEST_CTRL , msr_test_ctrl_cache);if (!split_lock_verify_msr (true)) {pr_info ("MSR access failed: Disabled\n" );
@@ -297,7 +297,7 @@ void bus_lock_init(void)if (!boot_cpu_has (X86_FEATURE_BUS_LOCK_DETECT ))return ; -rdmsrl (MSR_IA32_DEBUGCTLMSR , val); +rdmsrq (MSR_IA32_DEBUGCTLMSR , val); if ((boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT) && (sld_state == sld_warn || sld_state == sld_fatal)) ||
@@ -375,7 +375,7 @@ static void __init split_lock_setup(struct cpuinfo_x86 *c)* MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT is. All CPUs that set * it have split lock detection. */ -rdmsrl (MSR_IA32_CORE_CAPS , ia32_core_caps); +rdmsrq (MSR_IA32_CORE_CAPS , ia32_core_caps);if (ia32_core_caps &MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT ) goto supported;
arch/x86/kernel/cpu/common.c +5 -5
@@ -562,7 +562,7 @@ __noendbr u64 ibt_save(bool disable)u64 msr =0 ;if (cpu_feature_enabled (X86_FEATURE_IBT )) { -rdmsrl (MSR_IA32_S_CET , msr); +rdmsrq (MSR_IA32_S_CET , msr);if (disable)wrmsrl (MSR_IA32_S_CET , msr & ~CET_ENDBR_EN ); }
@@ -575,7 +575,7 @@ __noendbr void ibt_restore(u64 save)u64 msr;if (cpu_feature_enabled (X86_FEATURE_IBT )) { -rdmsrl (MSR_IA32_S_CET , msr); +rdmsrq (MSR_IA32_S_CET , msr); msr &= ~CET_ENDBR_EN ; msr |= (save &CET_ENDBR_EN );wrmsrl (MSR_IA32_S_CET , msr);
@@ -1288,7 +1288,7 @@ u64 x86_read_arch_cap_msr(void)u64 x86_arch_cap_msr =0 ;if (boot_cpu_has (X86_FEATURE_ARCH_CAPABILITIES )) -rdmsrl (MSR_IA32_ARCH_CAPABILITIES , x86_arch_cap_msr); +rdmsrq (MSR_IA32_ARCH_CAPABILITIES , x86_arch_cap_msr);return x86_arch_cap_msr; }
@@ -1749,10 +1749,10 @@ static bool detect_null_seg_behavior(void)*/ unsigned long old_base, tmp; -rdmsrl (MSR_FS_BASE , old_base); +rdmsrq (MSR_FS_BASE , old_base);wrmsrl (MSR_FS_BASE ,1 );loadsegment (fs,0 ); -rdmsrl (MSR_FS_BASE , tmp); +rdmsrq (MSR_FS_BASE , tmp);wrmsrl (MSR_FS_BASE , old_base);return tmp ==0 ; }
arch/x86/kernel/cpu/hygon.c +2 -2
@@ -96,7 +96,7 @@ static void bsp_init_hygon(struct cpuinfo_x86 *c)if (cpu_has (c,X86_FEATURE_CONSTANT_TSC )) {u64 val; -rdmsrl (MSR_K7_HWCR , val); +rdmsrq (MSR_K7_HWCR , val);if (!(val &BIT (24 )))pr_warn (FW_BUG "TSC doesn't count with P0 frequency!\n" ); }
@@ -194,7 +194,7 @@ static void init_hygon(struct cpuinfo_x86 *c)init_hygon_cacheinfo (c);if (cpu_has (c,X86_FEATURE_SVM )) { -rdmsrl (MSR_VM_CR , vm_cr); +rdmsrq (MSR_VM_CR , vm_cr);if (vm_cr &SVM_VM_CR_SVM_DIS_MASK ) {pr_notice_once ("SVM disabled (by BIOS) in MSR_VM_CR\n" );clear_cpu_cap (c,X86_FEATURE_SVM );
arch/x86/kernel/cpu/intel.c +2 -2
@@ -157,7 +157,7 @@ static void detect_tme_early(struct cpuinfo_x86 *c)u64 tme_activate;int keyid_bits; -rdmsrl (MSR_IA32_TME_ACTIVATE , tme_activate); +rdmsrq (MSR_IA32_TME_ACTIVATE , tme_activate);if (!TME_ACTIVATE_LOCKED (tme_activate) || !TME_ACTIVATE_ENABLED (tme_activate)) {pr_info_once ("x86/tme: not enabled by BIOS\n" );
@@ -299,7 +299,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)* string flag and enhanced fast string capabilities accordingly. */ if (c->x86_vfm >=INTEL_PENTIUM_M_DOTHAN ) { -rdmsrl (MSR_IA32_MISC_ENABLE , misc_enable); +rdmsrq (MSR_IA32_MISC_ENABLE , misc_enable);if (misc_enable &MSR_IA32_MISC_ENABLE_FAST_STRING ) {/* X86_FEATURE_ERMS is set based on CPUID */ set_cpu_cap (c,X86_FEATURE_REP_GOOD );
arch/x86/kernel/cpu/intel_epb.c +2 -2
@@ -79,7 +79,7 @@ static int intel_epb_save(void) {u64 epb; -rdmsrl (MSR_IA32_ENERGY_PERF_BIAS , epb); +rdmsrq (MSR_IA32_ENERGY_PERF_BIAS , epb);/* * Ensure that saved_epb will always be nonzero after this write even if * the EPB value read from the MSR is 0.
@@ -94,7 +94,7 @@ static void intel_epb_restore(void)u64 val =this_cpu_read (saved_epb);u64 epb; -rdmsrl (MSR_IA32_ENERGY_PERF_BIAS , epb); +rdmsrq (MSR_IA32_ENERGY_PERF_BIAS , epb);if (val) { val &=EPB_MASK ; }else {
arch/x86/kernel/cpu/mce/amd.c +7 -7
@@ -662,7 +662,7 @@ static void disable_err_thresholding(struct cpuinfo_x86 *c, unsigned int bank)return ; } -rdmsrl (MSR_K7_HWCR , hwcr); +rdmsrq (MSR_K7_HWCR , hwcr);/* McStatusWrEn has to be set */ need_toggle = !(hwcr &BIT (18 ));
@@ -805,12 +805,12 @@ static void __log_error(unsigned int bank, u64 status, u64 addr, u64 misc) }if (mce_flags.smca) { -rdmsrl (MSR_AMD64_SMCA_MCx_IPID (bank), m->ipid); +rdmsrq (MSR_AMD64_SMCA_MCx_IPID (bank), m->ipid);if (m->status &MCI_STATUS_SYNDV ) { -rdmsrl (MSR_AMD64_SMCA_MCx_SYND (bank), m->synd); -rdmsrl (MSR_AMD64_SMCA_MCx_SYND1 (bank), err.vendor.amd.synd1); -rdmsrl (MSR_AMD64_SMCA_MCx_SYND2 (bank), err.vendor.amd.synd2); +rdmsrq (MSR_AMD64_SMCA_MCx_SYND (bank), m->synd); +rdmsrq (MSR_AMD64_SMCA_MCx_SYND1 (bank), err.vendor.amd.synd1); +rdmsrq (MSR_AMD64_SMCA_MCx_SYND2 (bank), err.vendor.amd.synd2); } }
@@ -834,12 +834,12 @@ _log_error_bank(unsigned int bank, u32 msr_stat, u32 msr_addr, u64 misc) {u64 status, addr =0 ; -rdmsrl (msr_stat, status); +rdmsrq (msr_stat, status);if (!(status &MCI_STATUS_VAL ))return false;if (status &MCI_STATUS_ADDRV ) -rdmsrl (msr_addr, addr); +rdmsrq (msr_addr, addr);__log_error (bank, status, addr, misc);
arch/x86/kernel/cpu/mce/core.c +3 -3
@@ -1822,7 +1822,7 @@ static void __mcheck_cpu_cap_init(void)u64 cap;u8 b; -rdmsrl (MSR_IA32_MCG_CAP , cap); +rdmsrq (MSR_IA32_MCG_CAP , cap); b = cap &MCG_BANKCNT_MASK ;
@@ -1863,7 +1863,7 @@ static void __mcheck_cpu_init_generic(void)cr4_set_bits (X86_CR4_MCE ); -rdmsrl (MSR_IA32_MCG_CAP , cap); +rdmsrq (MSR_IA32_MCG_CAP , cap);if (cap &MCG_CTL_P )wrmsr (MSR_IA32_MCG_CTL ,0xffffffff ,0xffffffff ); }
@@ -1905,7 +1905,7 @@ static void __mcheck_cpu_check_banks(void)if (!b->init)continue ; -rdmsrl (mca_msr_reg (i,MCA_CTL ), msrval); +rdmsrq (mca_msr_reg (i,MCA_CTL ), msrval); b->init = !!msrval; } }
arch/x86/kernel/cpu/mce/inject.c +1 -1
@@ -741,7 +741,7 @@ static void check_hw_inj_possible(void)u64 status =MCI_STATUS_VAL , ipid;/* Check whether bank is populated */ -rdmsrl (MSR_AMD64_SMCA_MCx_IPID (bank), ipid); +rdmsrq (MSR_AMD64_SMCA_MCx_IPID (bank), ipid);if (!ipid)continue ;
arch/x86/kernel/cpu/mce/intel.c +9 -9
@@ -94,7 +94,7 @@ static bool cmci_supported(int *banks)if (!boot_cpu_has (X86_FEATURE_APIC ) ||lapic_get_maxlvt () <6 )return false; -rdmsrl (MSR_IA32_MCG_CAP , cap); +rdmsrq (MSR_IA32_MCG_CAP , cap); *banks =min_t (unsigned,MAX_NR_BANKS , cap &MCG_BANKCNT_MASK );return !!(cap &MCG_CMCI_P ); }
@@ -106,7 +106,7 @@ static bool lmce_supported(void)if (mca_cfg.lmce_disabled)return false; -rdmsrl (MSR_IA32_MCG_CAP , tmp); +rdmsrq (MSR_IA32_MCG_CAP , tmp);/* * LMCE depends on recovery support in the processor. Hence both
@@ -123,7 +123,7 @@ static bool lmce_supported(void)* WARN if the MSR isn't locked as init_ia32_feat_ctl() unconditionally * locks the MSR in the event that it wasn't already locked by BIOS. */ -rdmsrl (MSR_IA32_FEAT_CTL , tmp); +rdmsrq (MSR_IA32_FEAT_CTL , tmp);if (WARN_ON_ONCE (!(tmp &FEAT_CTL_LOCKED )))return false;
@@ -141,7 +141,7 @@ static void cmci_set_threshold(int bank, int thresh)u64 val;raw_spin_lock_irqsave (&cmci_discover_lock, flags); -rdmsrl (MSR_IA32_MCx_CTL2 (bank), val); +rdmsrq (MSR_IA32_MCx_CTL2 (bank), val); val &= ~MCI_CTL2_CMCI_THRESHOLD_MASK ;wrmsrl (MSR_IA32_MCx_CTL2 (bank), val | thresh);raw_spin_unlock_irqrestore (&cmci_discover_lock, flags);
@@ -184,7 +184,7 @@ static bool cmci_skip_bank(int bank, u64 *val)if (test_bit (bank, mce_banks_ce_disabled))return true; -rdmsrl (MSR_IA32_MCx_CTL2 (bank), *val); +rdmsrq (MSR_IA32_MCx_CTL2 (bank), *val);/* Already owned by someone else? */ if (*val &MCI_CTL2_CMCI_EN ) {
@@ -233,7 +233,7 @@ static void cmci_claim_bank(int bank, u64 val, int bios_zero_thresh, int *bios_w val |=MCI_CTL2_CMCI_EN ;wrmsrl (MSR_IA32_MCx_CTL2 (bank), val); -rdmsrl (MSR_IA32_MCx_CTL2 (bank), val); +rdmsrq (MSR_IA32_MCx_CTL2 (bank), val);/* If the enable bit did not stick, this bank should be polled. */ if (!(val &MCI_CTL2_CMCI_EN )) {
@@ -324,7 +324,7 @@ static void __cmci_disable_bank(int bank)if (!test_bit (bank,this_cpu_ptr (mce_banks_owned)))return ; -rdmsrl (MSR_IA32_MCx_CTL2 (bank), val); +rdmsrq (MSR_IA32_MCx_CTL2 (bank), val); val &= ~MCI_CTL2_CMCI_EN ;wrmsrl (MSR_IA32_MCx_CTL2 (bank), val);__clear_bit (bank,this_cpu_ptr (mce_banks_owned));
@@ -430,7 +430,7 @@ void intel_init_lmce(void)if (!lmce_supported ())return ; -rdmsrl (MSR_IA32_MCG_EXT_CTL , val); +rdmsrq (MSR_IA32_MCG_EXT_CTL , val);if (!(val &MCG_EXT_CTL_LMCE_EN ))wrmsrl (MSR_IA32_MCG_EXT_CTL , val |MCG_EXT_CTL_LMCE_EN );
@@ -443,7 +443,7 @@ void intel_clear_lmce(void)if (!lmce_supported ())return ; -rdmsrl (MSR_IA32_MCG_EXT_CTL , val); +rdmsrq (MSR_IA32_MCG_EXT_CTL , val); val &= ~MCG_EXT_CTL_LMCE_EN ;wrmsrl (MSR_IA32_MCG_EXT_CTL , val); }
arch/x86/kernel/cpu/mshyperv.c +3 -3
@@ -70,7 +70,7 @@ u64 hv_get_non_nested_msr(unsigned int reg)if (hv_is_synic_msr (reg) && ms_hyperv.paravisor_present)hv_ivm_msr_read (reg, &value);else -rdmsrl (reg, value); +rdmsrq (reg, value);return value; }EXPORT_SYMBOL_GPL (hv_get_non_nested_msr);
@@ -345,7 +345,7 @@ static unsigned long hv_get_tsc_khz(void) {unsigned long freq; -rdmsrl (HV_X64_MSR_TSC_FREQUENCY , freq); +rdmsrq (HV_X64_MSR_TSC_FREQUENCY , freq);return freq /1000 ; }
@@ -541,7 +541,7 @@ static void __init ms_hyperv_init_platform(void)*/ u64 hv_lapic_frequency; -rdmsrl (HV_X64_MSR_APIC_FREQUENCY , hv_lapic_frequency); +rdmsrq (HV_X64_MSR_APIC_FREQUENCY , hv_lapic_frequency); hv_lapic_frequency =div_u64 (hv_lapic_frequency,HZ ); lapic_timer_period = hv_lapic_frequency; pr_info("Hyper-V: LAPIC Timer Frequency: %#x\n",
arch/x86/kernel/cpu/resctrl/core.c +1 -1
@@ -148,7 +148,7 @@ static inline void cache_alloc_hsw_probe(void)if (wrmsrl_safe (MSR_IA32_L3_CBM_BASE , max_cbm))return ; -rdmsrl (MSR_IA32_L3_CBM_BASE , l3_cbm_0); +rdmsrq (MSR_IA32_L3_CBM_BASE , l3_cbm_0);/* If all the bits were set in MSR, return success */ if (l3_cbm_0 != max_cbm)
arch/x86/kernel/cpu/resctrl/monitor.c +1 -1
@@ -238,7 +238,7 @@ static int __rmid_read_phys(u32 prmid, enum resctrl_event_id eventid, u64 *val)* are error bits. */ wrmsr (MSR_IA32_QM_EVTSEL , eventid, prmid); -rdmsrl (MSR_IA32_QM_CTR , msr_val); +rdmsrq (MSR_IA32_QM_CTR , msr_val);if (msr_val &RMID_VAL_ERROR )return -EIO ;
arch/x86/kernel/cpu/resctrl/rdtgroup.c +1 -1
@@ -1635,7 +1635,7 @@ void resctrl_arch_mon_event_config_read(void *_config_info)pr_warn_once ("Invalid event id %d\n" , config_info->evtid);return ; } -rdmsrl (MSR_IA32_EVT_CFG_BASE + index, msrval); +rdmsrq (MSR_IA32_EVT_CFG_BASE + index, msrval);/* Report only the valid event configuration bits */ config_info->mon_config = msrval &MAX_EVT_CONFIG_BITS ;
arch/x86/kernel/cpu/topology.c +1 -1
@@ -154,7 +154,7 @@ static __init bool check_for_real_bsp(u32 apic_id)* kernel must rely on the firmware enumeration order. */ if (has_apic_base) { -rdmsrl (MSR_IA32_APICBASE , msr); +rdmsrq (MSR_IA32_APICBASE , msr); is_bsp = !!(msr &MSR_IA32_APICBASE_BSP ); }
arch/x86/kernel/cpu/topology_amd.c +2 -2
@@ -133,7 +133,7 @@ static void parse_fam10h_node_id(struct topo_scan *tscan)if (!boot_cpu_has (X86_FEATURE_NODEID_MSR ))return ; -rdmsrl (MSR_FAM10H_NODE_ID , nid.msr); +rdmsrq (MSR_FAM10H_NODE_ID , nid.msr);store_node (tscan, nid.nodes_per_pkg +1 , nid.node_id); tscan->c->topo.llc_id = nid.node_id; }
@@ -160,7 +160,7 @@ static void topoext_fixup(struct topo_scan *tscan)if (msr_set_bit (0xc0011005 ,54 ) <=0 )return ; -rdmsrl (0xc0011005 , msrval); +rdmsrq (0xc0011005 , msrval);if (msrval &BIT_64 (54 )) {set_cpu_cap (c,X86_FEATURE_TOPOEXT );pr_info_once (FW_INFO "CPU: Re-enabling disabled Topology Extensions Support.\n" );
arch/x86/kernel/cpu/tsx.c +5 -5
@@ -24,7 +24,7 @@ static void tsx_disable(void) {u64 tsx; -rdmsrl (MSR_IA32_TSX_CTRL , tsx); +rdmsrq (MSR_IA32_TSX_CTRL , tsx);/* Force all transactions to immediately abort */ tsx |=TSX_CTRL_RTM_DISABLE ;
@@ -44,7 +44,7 @@ static void tsx_enable(void) {u64 tsx; -rdmsrl (MSR_IA32_TSX_CTRL , tsx); +rdmsrq (MSR_IA32_TSX_CTRL , tsx);/* Enable the RTM feature in the cpu */ tsx &= ~TSX_CTRL_RTM_DISABLE ;
@@ -115,11 +115,11 @@ static void tsx_clear_cpuid(void)*/ if (boot_cpu_has (X86_FEATURE_RTM_ALWAYS_ABORT ) &&boot_cpu_has (X86_FEATURE_TSX_FORCE_ABORT )) { -rdmsrl (MSR_TSX_FORCE_ABORT , msr); +rdmsrq (MSR_TSX_FORCE_ABORT , msr); msr |=MSR_TFA_TSX_CPUID_CLEAR ;wrmsrl (MSR_TSX_FORCE_ABORT , msr); }else if (cpu_feature_enabled (X86_FEATURE_MSR_TSX_CTRL )) { -rdmsrl (MSR_IA32_TSX_CTRL , msr); +rdmsrq (MSR_IA32_TSX_CTRL , msr); msr |=TSX_CTRL_CPUID_CLEAR ;wrmsrl (MSR_IA32_TSX_CTRL , msr); }
@@ -146,7 +146,7 @@ static void tsx_dev_mode_disable(void) !cpu_feature_enabled(X86_FEATURE_SRBDS_CTRL)) return; -rdmsrl (MSR_IA32_MCU_OPT_CTRL , mcu_opt_ctrl); +rdmsrq (MSR_IA32_MCU_OPT_CTRL , mcu_opt_ctrl);if (mcu_opt_ctrl &RTM_ALLOW ) { mcu_opt_ctrl &= ~RTM_ALLOW ;
arch/x86/kernel/cpu/umwait.c +1 -1
@@ -214,7 +214,7 @@ static int __init umwait_init(void)* changed. This is the only place where orig_umwait_control_cached * is modified. */ -rdmsrl (MSR_IA32_UMWAIT_CONTROL , orig_umwait_control_cached); +rdmsrq (MSR_IA32_UMWAIT_CONTROL , orig_umwait_control_cached); ret =cpuhp_setup_state (CPUHP_AP_ONLINE_DYN ,"umwait:online" , umwait_cpu_online, umwait_cpu_offline);
arch/x86/kernel/fpu/core.c +1 -1
@@ -327,7 +327,7 @@ void fpu_sync_guest_vmexit_xfd_state(void)lockdep_assert_irqs_disabled ();if (fpu_state_size_dynamic ()) { -rdmsrl (MSR_IA32_XFD , fps->xfd); +rdmsrq (MSR_IA32_XFD , fps->xfd);__this_cpu_write (xfd_state, fps->xfd); } }
arch/x86/kernel/hpet.c +1 -1
@@ -970,7 +970,7 @@ static bool __init hpet_is_pc10_damaged(void)return false;/* Check whether PC10 is enabled in PKG C-state limit */ -rdmsrl (MSR_PKG_CST_CONFIG_CONTROL , pcfg); +rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , pcfg);if ((pcfg &0xF ) <8 )return false;
arch/x86/kernel/kvm.c +1 -1
@@ -728,7 +728,7 @@ static int kvm_suspend(void)#ifdef CONFIG_ARCH_CPUIDLE_HALTPOLL if (kvm_para_has_feature (KVM_FEATURE_POLL_CONTROL )) -rdmsrl (MSR_KVM_POLL_CONTROL , val); +rdmsrq (MSR_KVM_POLL_CONTROL , val); has_guest_poll = !(val &1 );#endif return 0 ;
arch/x86/kernel/mmconf-fam10h_64.c +3 -3
@@ -97,7 +97,7 @@ static void get_fam10h_pci_mmconf_base(void)/* SYS_CFG */ address =MSR_AMD64_SYSCFG ; -rdmsrl (address, val); +rdmsrq (address, val);/* TOP_MEM2 is not enabled? */ if (!(val & (1 <<21 ))) {
@@ -105,7 +105,7 @@ static void get_fam10h_pci_mmconf_base(void) }else {/* TOP_MEM2 */ address =MSR_K8_TOP_MEM2 ; -rdmsrl (address, val); +rdmsrq (address, val); tom2 =max (val &0xffffff800000ULL ,1ULL <<32 ); }
@@ -177,7 +177,7 @@ void fam10h_check_enable_mmcfg(void)return ; address =MSR_FAM10H_MMIO_CONF_BASE ; -rdmsrl (address, val); +rdmsrq (address, val);/* try to make sure that AP's setting is identical to BSP setting */ if (val &FAM10H_MMIO_CONF_ENABLE ) {
arch/x86/kernel/process.c +1 -1
@@ -710,7 +710,7 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p) arch_has_block_step()) {unsigned long debugctl, msk; -rdmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); +rdmsrq (MSR_IA32_DEBUGCTLMSR , debugctl); debugctl &= ~DEBUGCTLMSR_BTF ; msk = tifn & _TIF_BLOCKSTEP; debugctl |= (msk >>TIF_BLOCKSTEP ) <<DEBUGCTLMSR_BTF_SHIFT ;
arch/x86/kernel/process_64.c +7 -7
@@ -95,8 +95,8 @@ void __show_regs(struct pt_regs *regs, enum show_regs_mode mode,return ;if (mode ==SHOW_REGS_USER ) { -rdmsrl (MSR_FS_BASE , fs); -rdmsrl (MSR_KERNEL_GS_BASE , shadowgs); +rdmsrq (MSR_FS_BASE , fs); +rdmsrq (MSR_KERNEL_GS_BASE , shadowgs);printk ("%sFS: %016lx GS: %016lx\n" , log_lvl, fs, shadowgs);return ;
@@ -107,9 +107,9 @@ void __show_regs(struct pt_regs *regs, enum show_regs_mode mode, asm("movl %%fs,%0" :"=r" (fsindex)); asm("movl %%gs,%0" :"=r" (gsindex)); -rdmsrl (MSR_FS_BASE , fs); -rdmsrl (MSR_GS_BASE , gs); -rdmsrl (MSR_KERNEL_GS_BASE , shadowgs); +rdmsrq (MSR_FS_BASE , fs); +rdmsrq (MSR_GS_BASE , gs); +rdmsrq (MSR_KERNEL_GS_BASE , shadowgs); cr0 =read_cr0 (); cr2 =read_cr2 ();
@@ -195,7 +195,7 @@ static noinstr unsigned long __rdgsbase_inactive(void)native_swapgs (); }else {instrumentation_begin (); -rdmsrl (MSR_KERNEL_GS_BASE , gsbase); +rdmsrq (MSR_KERNEL_GS_BASE , gsbase);instrumentation_end (); }
@@ -463,7 +463,7 @@ unsigned long x86_gsbase_read_cpu_inactive(void) gsbase =__rdgsbase_inactive ();local_irq_restore (flags); }else { -rdmsrl (MSR_KERNEL_GS_BASE , gsbase); +rdmsrq (MSR_KERNEL_GS_BASE , gsbase); }return gsbase;
arch/x86/kernel/shstk.c +2 -2
@@ -239,7 +239,7 @@ static unsigned long get_user_shstk_addr(void)fpregs_lock_and_load (); -rdmsrl (MSR_IA32_PL3_SSP , ssp); +rdmsrq (MSR_IA32_PL3_SSP , ssp);fpregs_unlock ();
@@ -460,7 +460,7 @@ static int wrss_control(bool enable)return 0 ;fpregs_lock_and_load (); -rdmsrl (MSR_IA32_U_CET , msrval); +rdmsrq (MSR_IA32_U_CET , msrval);if (enable) {features_set (ARCH_SHSTK_WRSS );
arch/x86/kernel/traps.c +2 -2
@@ -1120,7 +1120,7 @@ static noinstr void exc_debug_kernel(struct pt_regs *regs, unsigned long dr6)*/ unsigned long debugctl; -rdmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); +rdmsrq (MSR_IA32_DEBUGCTLMSR , debugctl); debugctl |=DEBUGCTLMSR_BTF ;wrmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); }
@@ -1386,7 +1386,7 @@ static bool handle_xfd_event(struct pt_regs *regs)if (!IS_ENABLED (CONFIG_X86_64 ) || !cpu_feature_enabled (X86_FEATURE_XFD ))return false; -rdmsrl (MSR_IA32_XFD_ERR , xfd_err); +rdmsrq (MSR_IA32_XFD_ERR , xfd_err);if (!xfd_err)return false;
arch/x86/kernel/tsc.c +1 -1
@@ -1098,7 +1098,7 @@ static void __init detect_art(void)if (art_base_clk.denominator <ART_MIN_DENOMINATOR )return ; -rdmsrl (MSR_IA32_TSC_ADJUST , art_base_clk.offset); +rdmsrq (MSR_IA32_TSC_ADJUST , art_base_clk.offset);/* Make this sticky over multiple CPU init calls */ setup_force_cpu_cap (X86_FEATURE_ART );
arch/x86/kernel/tsc_sync.c +3 -3
@@ -65,7 +65,7 @@ void tsc_verify_tsc_adjust(bool resume) adj->nextcheck = jiffies +HZ ; -rdmsrl (MSR_IA32_TSC_ADJUST , curval); +rdmsrq (MSR_IA32_TSC_ADJUST , curval);if (adj->adjusted == curval)return ;
@@ -165,7 +165,7 @@ bool __init tsc_store_and_check_tsc_adjust(bool bootcpu)if (check_tsc_unstable ())return false; -rdmsrl (MSR_IA32_TSC_ADJUST , bootval); +rdmsrq (MSR_IA32_TSC_ADJUST , bootval); cur->bootval = bootval; cur->nextcheck = jiffies +HZ ;tsc_sanitize_first_cpu (cur, bootval,smp_processor_id (), bootcpu);
@@ -187,7 +187,7 @@ bool tsc_store_and_check_tsc_adjust(bool bootcpu)if (!boot_cpu_has (X86_FEATURE_TSC_ADJUST ))return false; -rdmsrl (MSR_IA32_TSC_ADJUST , bootval); +rdmsrq (MSR_IA32_TSC_ADJUST , bootval); cur->bootval = bootval; cur->nextcheck = jiffies +HZ ; cur->warned = false;
arch/x86/kvm/svm/svm.c +3 -3
@@ -580,7 +580,7 @@ static inline void kvm_cpu_svm_disable(void)uint64_t efer;wrmsrl (MSR_VM_HSAVE_PA ,0 ); -rdmsrl (MSR_EFER , efer); +rdmsrq (MSR_EFER , efer);if (efer &EFER_SVME ) {/* * Force GIF=1 prior to disabling SVM, e.g. to ensure INIT and
@@ -619,7 +619,7 @@ static int svm_enable_virtualization_cpu(void)uint64_t efer;int me =raw_smp_processor_id (); -rdmsrl (MSR_EFER , efer); +rdmsrq (MSR_EFER , efer);if (efer &EFER_SVME )return -EBUSY ;
@@ -5232,7 +5232,7 @@ static __init void svm_adjust_mmio_mask(void)return ;/* If memory encryption is not enabled, use existing mask */ -rdmsrl (MSR_AMD64_SYSCFG , msr); +rdmsrq (MSR_AMD64_SYSCFG , msr);if (!(msr &MSR_AMD64_SYSCFG_MEM_ENCRYPT ))return ;
arch/x86/kvm/vmx/nested.c +2 -2
@@ -7202,8 +7202,8 @@ static void nested_vmx_setup_cr_fixed(struct nested_vmx_msrs *msrs) msrs->cr4_fixed0 =VMXON_CR4_ALWAYSON ;/* These MSRs specify bits which the guest must keep fixed off. */ -rdmsrl (MSR_IA32_VMX_CR0_FIXED1 , msrs->cr0_fixed1); -rdmsrl (MSR_IA32_VMX_CR4_FIXED1 , msrs->cr4_fixed1); +rdmsrq (MSR_IA32_VMX_CR0_FIXED1 , msrs->cr0_fixed1); +rdmsrq (MSR_IA32_VMX_CR4_FIXED1 , msrs->cr4_fixed1);if (vmx_umip_emulated ()) msrs->cr4_fixed1 |=X86_CR4_UMIP ;
arch/x86/kvm/vmx/pmu_intel.c +1 -1
@@ -279,7 +279,7 @@ static bool intel_pmu_handle_lbr_msrs_access(struct kvm_vcpu *vcpu,local_irq_disable ();if (lbr_desc->event->state ==PERF_EVENT_STATE_ACTIVE ) {if (read) -rdmsrl (index, msr_info->data); +rdmsrq (index, msr_info->data);else wrmsrl (index, msr_info->data);__set_bit (INTEL_PMC_IDX_FIXED_VLBR ,vcpu_to_pmu (vcpu)->pmc_in_use);
arch/x86/kvm/vmx/sgx.c +3 -3
@@ -418,9 +418,9 @@ void setup_default_sgx_lepubkeyhash(void) sgx_pubkey_hash[3 ] =0xd4f8c05909f9bb3bULL ; }else {/* MSR_IA32_SGXLEPUBKEYHASH0 is read above */ -rdmsrl (MSR_IA32_SGXLEPUBKEYHASH1 , sgx_pubkey_hash[1 ]); -rdmsrl (MSR_IA32_SGXLEPUBKEYHASH2 , sgx_pubkey_hash[2 ]); -rdmsrl (MSR_IA32_SGXLEPUBKEYHASH3 , sgx_pubkey_hash[3 ]); +rdmsrq (MSR_IA32_SGXLEPUBKEYHASH1 , sgx_pubkey_hash[1 ]); +rdmsrq (MSR_IA32_SGXLEPUBKEYHASH2 , sgx_pubkey_hash[2 ]); +rdmsrq (MSR_IA32_SGXLEPUBKEYHASH3 , sgx_pubkey_hash[3 ]); } }
arch/x86/kvm/vmx/vmx.c +16 -16
@@ -1206,13 +1206,13 @@ static inline void pt_save_msr(struct pt_ctx *ctx, u32 addr_range) {u32 i; -rdmsrl (MSR_IA32_RTIT_STATUS , ctx->status); -rdmsrl (MSR_IA32_RTIT_OUTPUT_BASE , ctx->output_base); -rdmsrl (MSR_IA32_RTIT_OUTPUT_MASK , ctx->output_mask); -rdmsrl (MSR_IA32_RTIT_CR3_MATCH , ctx->cr3_match); +rdmsrq (MSR_IA32_RTIT_STATUS , ctx->status); +rdmsrq (MSR_IA32_RTIT_OUTPUT_BASE , ctx->output_base); +rdmsrq (MSR_IA32_RTIT_OUTPUT_MASK , ctx->output_mask); +rdmsrq (MSR_IA32_RTIT_CR3_MATCH , ctx->cr3_match);for (i =0 ; i < addr_range; i++) { -rdmsrl (MSR_IA32_RTIT_ADDR0_A + i *2 , ctx->addr_a[i]); -rdmsrl (MSR_IA32_RTIT_ADDR0_B + i *2 , ctx->addr_b[i]); +rdmsrq (MSR_IA32_RTIT_ADDR0_A + i *2 , ctx->addr_a[i]); +rdmsrq (MSR_IA32_RTIT_ADDR0_B + i *2 , ctx->addr_b[i]); } }
@@ -1225,7 +1225,7 @@ static void pt_guest_enter(struct vcpu_vmx *vmx)* GUEST_IA32_RTIT_CTL is already set in the VMCS. * Save host state before VM entry. */ -rdmsrl (MSR_IA32_RTIT_CTL , vmx->pt_desc.host.ctl); +rdmsrq (MSR_IA32_RTIT_CTL , vmx->pt_desc.host.ctl);if (vmx->pt_desc.guest.ctl &RTIT_CTL_TRACEEN ) {wrmsrl (MSR_IA32_RTIT_CTL ,0 );pt_save_msr (&vmx->pt_desc.host, vmx->pt_desc.num_address_ranges);
@@ -1362,7 +1362,7 @@ static void vmx_prepare_switch_to_host(struct vcpu_vmx *vmx) ++vmx->vcpu.stat.host_state_reload;#ifdef CONFIG_X86_64 -rdmsrl (MSR_KERNEL_GS_BASE , vmx->msr_guest_kernel_gs_base); +rdmsrq (MSR_KERNEL_GS_BASE , vmx->msr_guest_kernel_gs_base);#endif if (host_state->ldt_sel || (host_state->gs_sel &7 )) {kvm_load_ldt (host_state->ldt_sel);
@@ -1394,7 +1394,7 @@ static u64 vmx_read_guest_kernel_gs_base(struct vcpu_vmx *vmx) {preempt_disable ();if (vmx->guest_state_loaded) -rdmsrl (MSR_KERNEL_GS_BASE , vmx->msr_guest_kernel_gs_base); +rdmsrq (MSR_KERNEL_GS_BASE , vmx->msr_guest_kernel_gs_base);preempt_enable ();return vmx->msr_guest_kernel_gs_base; }
@@ -2574,7 +2574,7 @@ static u64 adjust_vmx_controls64(u64 ctl_opt, u32 msr) {u64 allowed; -rdmsrl (msr, allowed); +rdmsrq (msr, allowed);return ctl_opt & allowed; }
@@ -2746,7 +2746,7 @@ static int setup_vmcs_config(struct vmcs_config *vmcs_conf,break ; } -rdmsrl (MSR_IA32_VMX_BASIC , basic_msr); +rdmsrq (MSR_IA32_VMX_BASIC , basic_msr);/* IA-32 SDM Vol 3B: VMCS size is never greater than 4kB. */ if (vmx_basic_vmcs_size (basic_msr) >PAGE_SIZE )
@@ -2766,7 +2766,7 @@ static int setup_vmcs_config(struct vmcs_config *vmcs_conf,if (vmx_basic_vmcs_mem_type (basic_msr) !=X86_MEMTYPE_WB )return -EIO ; -rdmsrl (MSR_IA32_VMX_MISC , misc_msr); +rdmsrq (MSR_IA32_VMX_MISC , misc_msr); vmcs_conf->basic = basic_msr; vmcs_conf->pin_based_exec_ctrl = _pin_based_exec_control;
@@ -4391,7 +4391,7 @@ void vmx_set_constant_host_state(struct vcpu_vmx *vmx)if (!IS_ENABLED (CONFIG_IA32_EMULATION ) && !IS_ENABLED (CONFIG_X86_32 ))vmcs_writel (HOST_IA32_SYSENTER_ESP ,0 ); -rdmsrl (MSR_IA32_SYSENTER_EIP , tmpl); +rdmsrq (MSR_IA32_SYSENTER_EIP , tmpl);vmcs_writel (HOST_IA32_SYSENTER_EIP , tmpl);/* 22.2.3 */ if (vmcs_config.vmexit_ctrl &VM_EXIT_LOAD_IA32_PAT ) {
@@ -7052,7 +7052,7 @@ static void handle_nm_fault_irqoff(struct kvm_vcpu *vcpu)* the #NM exception. */ if (is_xfd_nm_fault (vcpu)) -rdmsrl (MSR_IA32_XFD_ERR , vcpu->arch.guest_fpu.xfd_err); +rdmsrq (MSR_IA32_XFD_ERR , vcpu->arch.guest_fpu.xfd_err); }static void handle_exception_irqoff (struct kvm_vcpu *vcpu,u32 intr_info)
@@ -7959,7 +7959,7 @@ static __init u64 vmx_get_perf_capabilities(void)return 0 ;if (boot_cpu_has (X86_FEATURE_PDCM )) -rdmsrl (MSR_IA32_PERF_CAPABILITIES , host_perf_cap); +rdmsrq (MSR_IA32_PERF_CAPABILITIES , host_perf_cap);if (!cpu_feature_enabled (X86_FEATURE_ARCH_LBR )) {x86_perf_get_lbr (&vmx_lbr_caps);
@@ -8508,7 +8508,7 @@ __init int vmx_hardware_setup(void)kvm_enable_efer_bits (EFER_NX );if (boot_cpu_has (X86_FEATURE_MPX )) { -rdmsrl (MSR_IA32_BNDCFGS , host_bndcfgs); +rdmsrq (MSR_IA32_BNDCFGS , host_bndcfgs);WARN_ONCE (host_bndcfgs,"BNDCFGS in host will be lost" ); }
arch/x86/kvm/x86.c +2 -2
@@ -9773,12 +9773,12 @@ int kvm_x86_vendor_init(struct kvm_x86_init_ops *ops)rdmsrl_safe (MSR_EFER , &kvm_host.efer);if (boot_cpu_has (X86_FEATURE_XSAVES )) -rdmsrl (MSR_IA32_XSS , kvm_host.xss); +rdmsrq (MSR_IA32_XSS , kvm_host.xss);kvm_init_pmu_capability (ops->pmu_ops);if (boot_cpu_has (X86_FEATURE_ARCH_CAPABILITIES )) -rdmsrl (MSR_IA32_ARCH_CAPABILITIES , kvm_host.arch_capabilities); +rdmsrq (MSR_IA32_ARCH_CAPABILITIES , kvm_host.arch_capabilities); r = ops->hardware_setup ();if (r !=0 )
arch/x86/lib/insn-eval.c +3 -3
@@ -702,16 +702,16 @@ unsigned long insn_get_seg_base(struct pt_regs *regs, int seg_reg_idx)unsigned long base;if (seg_reg_idx ==INAT_SEG_REG_FS ) { -rdmsrl (MSR_FS_BASE , base); +rdmsrq (MSR_FS_BASE , base); }else if (seg_reg_idx ==INAT_SEG_REG_GS ) {/* * swapgs was called at the kernel entry point. Thus, * MSR_KERNEL_GS_BASE will have the user-space GS base. */ if (user_mode (regs)) -rdmsrl (MSR_KERNEL_GS_BASE , base); +rdmsrq (MSR_KERNEL_GS_BASE , base);else -rdmsrl (MSR_GS_BASE , base); +rdmsrq (MSR_GS_BASE , base); }else { base =0 ; }
arch/x86/mm/pat/memtype.c +1 -1
@@ -256,7 +256,7 @@ void __init pat_bp_init(void)if (!cpu_feature_enabled (X86_FEATURE_PAT ))pat_disable ("PAT not supported by the CPU." );else -rdmsrl (MSR_IA32_CR_PAT , pat_msr_val); +rdmsrq (MSR_IA32_CR_PAT , pat_msr_val);if (!pat_msr_val) {pat_disable ("PAT support disabled by the firmware." );
arch/x86/pci/amd_bus.c +4 -4
@@ -202,7 +202,7 @@ static int __init early_root_info_init(void)/* need to take out [0, TOM) for RAM*/ address =MSR_K8_TOP_MEM1 ; -rdmsrl (address, val); +rdmsrq (address, val); end = (val &0xffffff800000ULL );printk (KERN_INFO "TOM: %016llx aka %lldM\n" , end, end>>20 );if (end < (1ULL <<32 ))
@@ -293,12 +293,12 @@ static int __init early_root_info_init(void)/* need to take out [4G, TOM2) for RAM*/ /* SYS_CFG */ address =MSR_AMD64_SYSCFG ; -rdmsrl (address, val); +rdmsrq (address, val);/* TOP_MEM2 is enabled? */ if (val & (1 <<21 )) {/* TOP_MEM2 */ address =MSR_K8_TOP_MEM2 ; -rdmsrl (address, val); +rdmsrq (address, val); end = (val &0xffffff800000ULL );printk (KERN_INFO "TOM2: %016llx aka %lldM\n" , end, end>>20 );subtract_range (range,RANGE_NUM ,1ULL <<32 , end);
@@ -341,7 +341,7 @@ static int amd_bus_cpu_online(unsigned int cpu) {u64 reg; -rdmsrl (MSR_AMD64_NB_CFG , reg); +rdmsrq (MSR_AMD64_NB_CFG , reg);if (!(reg &ENABLE_CF8_EXT_CFG )) { reg |=ENABLE_CF8_EXT_CFG ;wrmsrl (MSR_AMD64_NB_CFG , reg);
arch/x86/platform/olpc/olpc-xo1-rtc.c +3 -3
@@ -64,9 +64,9 @@ static int __init xo1_rtc_init(void)of_node_put (node);pr_info ("olpc-xo1-rtc: Initializing OLPC XO-1 RTC\n" ); -rdmsrl (MSR_RTC_DOMA_OFFSET , rtc_info.rtc_day_alarm); -rdmsrl (MSR_RTC_MONA_OFFSET , rtc_info.rtc_mon_alarm); -rdmsrl (MSR_RTC_CEN_OFFSET , rtc_info.rtc_century); +rdmsrq (MSR_RTC_DOMA_OFFSET , rtc_info.rtc_day_alarm); +rdmsrq (MSR_RTC_MONA_OFFSET , rtc_info.rtc_mon_alarm); +rdmsrq (MSR_RTC_CEN_OFFSET , rtc_info.rtc_century); r =platform_device_register (&xo1_rtc_device);if (r)
arch/x86/power/cpu.c +5 -5
@@ -44,7 +44,7 @@ static void msr_save_context(struct saved_context *ctxt)while (msr < end) {if (msr->valid) -rdmsrl (msr->info.msr_no, msr->info.reg.q); +rdmsrq (msr->info.msr_no, msr->info.reg.q); msr++; } }
@@ -110,12 +110,12 @@ static void __save_processor_state(struct saved_context *ctxt)savesegment (ds, ctxt->ds);savesegment (es, ctxt->es); -rdmsrl (MSR_FS_BASE , ctxt->fs_base); -rdmsrl (MSR_GS_BASE , ctxt->kernelmode_gs_base); -rdmsrl (MSR_KERNEL_GS_BASE , ctxt->usermode_gs_base); +rdmsrq (MSR_FS_BASE , ctxt->fs_base); +rdmsrq (MSR_GS_BASE , ctxt->kernelmode_gs_base); +rdmsrq (MSR_KERNEL_GS_BASE , ctxt->usermode_gs_base);mtrr_save_fixed_ranges (NULL ); -rdmsrl (MSR_EFER , ctxt->efer); +rdmsrq (MSR_EFER , ctxt->efer);#endif /*
arch/x86/realmode/init.c +1 -1
@@ -145,7 +145,7 @@ static void __init setup_real_mode(void)* Some AMD processors will #GP(0) if EFER.LMA is set in WRMSR * so we need to mask it out. */ -rdmsrl (MSR_EFER , efer); +rdmsrq (MSR_EFER , efer); trampoline_header->efer = efer & ~EFER_LMA ; trampoline_header->start = (u64 ) secondary_startup_64;
arch/x86/virt/svm/sev.c +8 -8
@@ -136,7 +136,7 @@ static int __mfd_enable(unsigned int cpu)if (!cc_platform_has (CC_ATTR_HOST_SEV_SNP ))return 0 ; -rdmsrl (MSR_AMD64_SYSCFG , val); +rdmsrq (MSR_AMD64_SYSCFG , val); val |=MSR_AMD64_SYSCFG_MFDM ;
@@ -157,7 +157,7 @@ static int __snp_enable(unsigned int cpu)if (!cc_platform_has (CC_ATTR_HOST_SEV_SNP ))return 0 ; -rdmsrl (MSR_AMD64_SYSCFG , val); +rdmsrq (MSR_AMD64_SYSCFG , val); val |=MSR_AMD64_SYSCFG_SNP_EN ; val |=MSR_AMD64_SYSCFG_SNP_VMPL_EN ;
@@ -522,7 +522,7 @@ int __init snp_rmptable_init(void)* Check if SEV-SNP is already enabled, this can happen in case of * kexec boot. */ -rdmsrl (MSR_AMD64_SYSCFG , val); +rdmsrq (MSR_AMD64_SYSCFG , val);if (val &MSR_AMD64_SYSCFG_SNP_EN ) goto skip_enable;
@@ -576,8 +576,8 @@ static bool probe_contiguous_rmptable_info(void) {u64 rmp_sz, rmp_base, rmp_end; -rdmsrl (MSR_AMD64_RMP_BASE , rmp_base); -rdmsrl (MSR_AMD64_RMP_END , rmp_end); +rdmsrq (MSR_AMD64_RMP_BASE , rmp_base); +rdmsrq (MSR_AMD64_RMP_END , rmp_end);if (!(rmp_base &RMP_ADDR_MASK ) || !(rmp_end &RMP_ADDR_MASK )) {pr_err ("Memory for the RMP table has not been reserved by BIOS\n" );
@@ -610,13 +610,13 @@ static bool probe_segmented_rmptable_info(void)unsigned int eax, ebx, segment_shift, segment_shift_min, segment_shift_max;u64 rmp_base, rmp_end; -rdmsrl (MSR_AMD64_RMP_BASE , rmp_base); +rdmsrq (MSR_AMD64_RMP_BASE , rmp_base);if (!(rmp_base &RMP_ADDR_MASK )) {pr_err ("Memory for the RMP table has not been reserved by BIOS\n" );return false; } -rdmsrl (MSR_AMD64_RMP_END , rmp_end); +rdmsrq (MSR_AMD64_RMP_END , rmp_end);WARN_ONCE (rmp_end &RMP_ADDR_MASK ,"Segmented RMP enabled but RMP_END MSR is non-zero\n" );
@@ -652,7 +652,7 @@ static bool probe_segmented_rmptable_info(void)bool snp_probe_rmptable_info (void ) {if (cpu_feature_enabled (X86_FEATURE_SEGMENTED_RMP )) -rdmsrl (MSR_AMD64_RMP_CFG , rmp_cfg); +rdmsrq (MSR_AMD64_RMP_CFG , rmp_cfg);if (rmp_cfg &MSR_AMD64_SEG_RMP_ENABLED )return probe_segmented_rmptable_info ();
arch/x86/xen/suspend.c +1 -1
@@ -55,7 +55,7 @@ static void xen_vcpu_notify_suspend(void *data)tick_suspend_local ();if (xen_pv_domain () &&boot_cpu_has (X86_FEATURE_SPEC_CTRL )) { -rdmsrl (MSR_IA32_SPEC_CTRL , tmp); +rdmsrq (MSR_IA32_SPEC_CTRL , tmp);this_cpu_write (spec_ctrl, tmp);wrmsrl (MSR_IA32_SPEC_CTRL ,0 ); }
drivers/cpufreq/acpi-cpufreq.c +1 -1
@@ -110,7 +110,7 @@ static int boost_set_msr(bool enable)return -EINVAL ; } -rdmsrl (msr_addr, val); +rdmsrq (msr_addr, val);if (enable) val &= ~msr_mask;
drivers/cpufreq/amd-pstate.c +2 -2
@@ -518,8 +518,8 @@ static inline bool amd_pstate_sample(struct amd_cpudata *cpudata)unsigned long flags;local_irq_save (flags); -rdmsrl (MSR_IA32_APERF , aperf); -rdmsrl (MSR_IA32_MPERF , mperf); +rdmsrq (MSR_IA32_APERF , aperf); +rdmsrq (MSR_IA32_MPERF , mperf); tsc =rdtsc ();if (cpudata->prev.mperf == mperf || cpudata->prev.tsc == tsc) {
drivers/cpufreq/e_powersaver.c +2 -2
@@ -225,12 +225,12 @@ static int eps_cpu_init(struct cpufreq_policy *policy)return -ENODEV ; }/* Enable Enhanced PowerSaver */ -rdmsrl (MSR_IA32_MISC_ENABLE , val); +rdmsrq (MSR_IA32_MISC_ENABLE , val);if (!(val &MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP )) { val |=MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP ;wrmsrl (MSR_IA32_MISC_ENABLE , val);/* Can be locked at 0 */ -rdmsrl (MSR_IA32_MISC_ENABLE , val); +rdmsrq (MSR_IA32_MISC_ENABLE , val);if (!(val &MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP )) {pr_info ("Can't enable Enhanced PowerSaver\n" );return -ENODEV ;
drivers/cpufreq/intel_pstate.c +14 -14
@@ -598,7 +598,7 @@ static bool turbo_is_disabled(void) {u64 misc_en; -rdmsrl (MSR_IA32_MISC_ENABLE , misc_en); +rdmsrq (MSR_IA32_MISC_ENABLE , misc_en);return !!(misc_en &MSR_IA32_MISC_ENABLE_TURBO_DISABLE ); }
@@ -1285,7 +1285,7 @@ static void set_power_ctl_ee_state(bool input)u64 power_ctl;mutex_lock (&intel_pstate_driver_lock); -rdmsrl (MSR_IA32_POWER_CTL , power_ctl); +rdmsrq (MSR_IA32_POWER_CTL , power_ctl);if (input) { power_ctl &= ~BIT (MSR_IA32_POWER_CTL_BIT_EE ); power_ctl_ee_state =POWER_CTL_EE_ENABLE ;
@@ -1703,7 +1703,7 @@ static ssize_t show_energy_efficiency(struct kobject *kobj, struct kobj_attributu64 power_ctl;int enable; -rdmsrl (MSR_IA32_POWER_CTL , power_ctl); +rdmsrq (MSR_IA32_POWER_CTL , power_ctl); enable = !!(power_ctl &BIT (MSR_IA32_POWER_CTL_BIT_EE ));return sprintf (buf,"%d\n" , !enable); }
@@ -1990,7 +1990,7 @@ static int atom_get_min_pstate(int not_used) {u64 value; -rdmsrl (MSR_ATOM_CORE_RATIOS , value); +rdmsrq (MSR_ATOM_CORE_RATIOS , value);return (value >>8 ) &0x7F ; }
@@ -1998,7 +1998,7 @@ static int atom_get_max_pstate(int not_used) {u64 value; -rdmsrl (MSR_ATOM_CORE_RATIOS , value); +rdmsrq (MSR_ATOM_CORE_RATIOS , value);return (value >>16 ) &0x7F ; }
@@ -2006,7 +2006,7 @@ static int atom_get_turbo_pstate(int not_used) {u64 value; -rdmsrl (MSR_ATOM_CORE_TURBO_RATIOS , value); +rdmsrq (MSR_ATOM_CORE_TURBO_RATIOS , value);return value &0x7F ; }
@@ -2041,7 +2041,7 @@ static int silvermont_get_scaling(void)static int silvermont_freq_table[] = {83300 ,100000 ,133300 ,116700 ,80000 }; -rdmsrl (MSR_FSB_FREQ , value); +rdmsrq (MSR_FSB_FREQ , value); i = value &0x7 ;WARN_ON (i >4 );
@@ -2057,7 +2057,7 @@ static int airmont_get_scaling(void)83300 ,100000 ,133300 ,116700 ,80000 , 93300, 90000, 88900, 87500}; -rdmsrl (MSR_FSB_FREQ , value); +rdmsrq (MSR_FSB_FREQ , value); i = value &0xF ;WARN_ON (i >8 );
@@ -2068,7 +2068,7 @@ static void atom_get_vid(struct cpudata *cpudata) {u64 value; -rdmsrl (MSR_ATOM_CORE_VIDS , value); +rdmsrq (MSR_ATOM_CORE_VIDS , value); cpudata->vid.min =int_tofp ((value >>8 ) &0x7f ); cpudata->vid.max =int_tofp ((value >>16 ) &0x7f ); cpudata->vid.ratio = div_fp(
@@ -2076,7 +2076,7 @@ static void atom_get_vid(struct cpudata *cpudata)int_tofp (cpudata->pstate.max_pstate - cpudata->pstate.min_pstate)); -rdmsrl (MSR_ATOM_CORE_TURBO_VIDS , value); +rdmsrq (MSR_ATOM_CORE_TURBO_VIDS , value); cpudata->vid.turbo = value &0x7f ; }
@@ -2425,8 +2425,8 @@ static inline bool intel_pstate_sample(struct cpudata *cpu, u64 time)u64 tsc;local_irq_save (flags); -rdmsrl (MSR_IA32_APERF , aperf); -rdmsrl (MSR_IA32_MPERF , mperf); +rdmsrq (MSR_IA32_APERF , aperf); +rdmsrq (MSR_IA32_MPERF , mperf); tsc =rdtsc ();if (cpu->prev_mperf == mperf || cpu->prev_tsc == tsc) {local_irq_restore (flags);
@@ -3573,7 +3573,7 @@ static bool __init intel_pstate_platform_pwr_mgmt_exists(void) id =x86_match_cpu (intel_pstate_cpu_oob_ids);if (id) { -rdmsrl (MSR_MISC_PWR_MGMT , misc_pwr); +rdmsrq (MSR_MISC_PWR_MGMT , misc_pwr);if (misc_pwr &BITMASK_OOB ) {pr_debug ("Bit 8 or 18 in the MISC_PWR_MGMT MSR set\n" );pr_debug ("P states are controlled in Out of Band mode by the firmware/hardware\n" );
@@ -3629,7 +3629,7 @@ static bool intel_pstate_hwp_is_enabled(void) {u64 value; -rdmsrl (MSR_PM_ENABLE , value); +rdmsrq (MSR_PM_ENABLE , value);return !!(value &0x1 ); }
drivers/cpufreq/longhaul.c +4 -4
@@ -136,7 +136,7 @@ static void do_longhaul1(unsigned int mults_index) {union msr_bcr2 bcr2; -rdmsrl (MSR_VIA_BCR2 , bcr2.val); +rdmsrq (MSR_VIA_BCR2 , bcr2.val);/* Enable software clock multiplier */ bcr2.bits.ESOFTBF =1 ; bcr2.bits.CLOCKMUL = mults_index &0xff ;
@@ -151,7 +151,7 @@ static void do_longhaul1(unsigned int mults_index)/* Disable software clock multiplier */ local_irq_disable (); -rdmsrl (MSR_VIA_BCR2 , bcr2.val); +rdmsrq (MSR_VIA_BCR2 , bcr2.val); bcr2.bits.ESOFTBF =0 ;wrmsrl (MSR_VIA_BCR2 , bcr2.val); }
@@ -164,7 +164,7 @@ static void do_powersaver(int cx_address, unsigned int mults_index,union msr_longhaul longhaul;u32 t; -rdmsrl (MSR_VIA_LONGHAUL , longhaul.val); +rdmsrq (MSR_VIA_LONGHAUL , longhaul.val);/* Setup new frequency */ if (!revid_errata) longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
@@ -534,7 +534,7 @@ static void longhaul_setup_voltagescaling(void)unsigned int j, speed, pos, kHz_step, numvscales;int min_vid_speed; -rdmsrl (MSR_VIA_LONGHAUL , longhaul.val); +rdmsrq (MSR_VIA_LONGHAUL , longhaul.val);if (!(longhaul.bits.RevisionID &1 )) {pr_info ("Voltage scaling not supported by CPU\n" );return ;
drivers/cpufreq/powernow-k7.c +5 -5
@@ -219,7 +219,7 @@ static void change_FID(int fid) {union msr_fidvidctl fidvidctl; -rdmsrl (MSR_K7_FID_VID_CTL , fidvidctl.val); +rdmsrq (MSR_K7_FID_VID_CTL , fidvidctl.val);if (fidvidctl.bits.FID != fid) { fidvidctl.bits.SGTC = latency; fidvidctl.bits.FID = fid;
@@ -234,7 +234,7 @@ static void change_VID(int vid) {union msr_fidvidctl fidvidctl; -rdmsrl (MSR_K7_FID_VID_CTL , fidvidctl.val); +rdmsrq (MSR_K7_FID_VID_CTL , fidvidctl.val);if (fidvidctl.bits.VID != vid) { fidvidctl.bits.SGTC = latency; fidvidctl.bits.VID = vid;
@@ -260,7 +260,7 @@ static int powernow_target(struct cpufreq_policy *policy, unsigned int index) fid = powernow_table[index].driver_data &0xFF ; vid = (powernow_table[index].driver_data &0xFF00 ) >>8 ; -rdmsrl (MSR_K7_FID_VID_STATUS , fidvidstatus.val); +rdmsrq (MSR_K7_FID_VID_STATUS , fidvidstatus.val); cfid = fidvidstatus.bits.CFID; freqs.old = fsb * fid_codes[cfid] /10 ;
@@ -557,7 +557,7 @@ static unsigned int powernow_get(unsigned int cpu)if (cpu)return 0 ; -rdmsrl (MSR_K7_FID_VID_STATUS , fidvidstatus.val); +rdmsrq (MSR_K7_FID_VID_STATUS , fidvidstatus.val); cfid = fidvidstatus.bits.CFID;return fsb * fid_codes[cfid] /10 ;
@@ -598,7 +598,7 @@ static int powernow_cpu_init(struct cpufreq_policy *policy)if (policy->cpu !=0 )return -ENODEV ; -rdmsrl (MSR_K7_FID_VID_STATUS , fidvidstatus.val); +rdmsrq (MSR_K7_FID_VID_STATUS , fidvidstatus.val);recalibrate_cpu_khz ();
drivers/edac/amd64_edac.c +3 -3
@@ -2942,13 +2942,13 @@ static void dct_read_mc_regs(struct amd64_pvt *pvt)* Retrieve TOP_MEM and TOP_MEM2; no masking off of reserved bits since * those are Read-As-Zero. */ -rdmsrl (MSR_K8_TOP_MEM1 , pvt->top_mem); +rdmsrq (MSR_K8_TOP_MEM1 , pvt->top_mem);edac_dbg (0 ," TOP_MEM: 0x%016llx\n" , pvt->top_mem);/* Check first whether TOP_MEM2 is enabled: */ -rdmsrl (MSR_AMD64_SYSCFG , msr_val); +rdmsrq (MSR_AMD64_SYSCFG , msr_val);if (msr_val &BIT (21 )) { -rdmsrl (MSR_K8_TOP_MEM2 , pvt->top_mem2); +rdmsrq (MSR_K8_TOP_MEM2 , pvt->top_mem2);edac_dbg (0 ," TOP_MEM2: 0x%016llx\n" , pvt->top_mem2); }else {edac_dbg (0 ," TOP_MEM2 disabled\n" );
drivers/idle/intel_idle.c +12 -12
@@ -1928,35 +1928,35 @@ static void __init bxt_idle_state_table_update(void)unsigned long long msr;unsigned int usec; -rdmsrl (MSR_PKGC6_IRTL , msr); +rdmsrq (MSR_PKGC6_IRTL , msr); usec =irtl_2_usec (msr);if (usec) { bxt_cstates[2 ].exit_latency = usec; bxt_cstates[2 ].target_residency = usec; } -rdmsrl (MSR_PKGC7_IRTL , msr); +rdmsrq (MSR_PKGC7_IRTL , msr); usec =irtl_2_usec (msr);if (usec) { bxt_cstates[3 ].exit_latency = usec; bxt_cstates[3 ].target_residency = usec; } -rdmsrl (MSR_PKGC8_IRTL , msr); +rdmsrq (MSR_PKGC8_IRTL , msr); usec =irtl_2_usec (msr);if (usec) { bxt_cstates[4 ].exit_latency = usec; bxt_cstates[4 ].target_residency = usec; } -rdmsrl (MSR_PKGC9_IRTL , msr); +rdmsrq (MSR_PKGC9_IRTL , msr); usec =irtl_2_usec (msr);if (usec) { bxt_cstates[5 ].exit_latency = usec; bxt_cstates[5 ].target_residency = usec; } -rdmsrl (MSR_PKGC10_IRTL , msr); +rdmsrq (MSR_PKGC10_IRTL , msr); usec =irtl_2_usec (msr);if (usec) { bxt_cstates[6 ].exit_latency = usec;
@@ -1984,7 +1984,7 @@ static void __init sklh_idle_state_table_update(void)if ((mwait_substates & (0xF <<28 )) ==0 )return ; -rdmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr); +rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr);/* PC10 is not enabled in PKG C-state limit */ if ((msr &0xF ) !=8 )
@@ -1996,7 +1996,7 @@ static void __init sklh_idle_state_table_update(void)/* if SGX is present */ if (ebx & (1 <<2 )) { -rdmsrl (MSR_IA32_FEAT_CTL , msr); +rdmsrq (MSR_IA32_FEAT_CTL , msr);/* if SGX is enabled */ if (msr & (1 <<18 ))
@@ -2015,7 +2015,7 @@ static void __init skx_idle_state_table_update(void) {unsigned long long msr; -rdmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr); +rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr);/* * 000b: C0/C1 (no package C-state support)
@@ -2068,7 +2068,7 @@ static void __init spr_idle_state_table_update(void)* C6. However, if PC6 is disabled, we update the numbers to match * core C6. */ -rdmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr); +rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr);/* Limit value 2 and above allow for PC6. */ if ((msr &0x7 ) <2 ) {
@@ -2241,7 +2241,7 @@ static void auto_demotion_disable(void) {unsigned long long msr_bits; -rdmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr_bits); +rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr_bits); msr_bits &= ~auto_demotion_disable_flags;wrmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr_bits); }
@@ -2250,7 +2250,7 @@ static void c1e_promotion_enable(void) {unsigned long long msr_bits; -rdmsrl (MSR_IA32_POWER_CTL , msr_bits); +rdmsrq (MSR_IA32_POWER_CTL , msr_bits); msr_bits |=0x2 ;wrmsrl (MSR_IA32_POWER_CTL , msr_bits); }
@@ -2259,7 +2259,7 @@ static void c1e_promotion_disable(void) {unsigned long long msr_bits; -rdmsrl (MSR_IA32_POWER_CTL , msr_bits); +rdmsrq (MSR_IA32_POWER_CTL , msr_bits); msr_bits &= ~0x2 ;wrmsrl (MSR_IA32_POWER_CTL , msr_bits); }
drivers/mtd/nand/raw/cs553x_nand.c +3 -3
@@ -351,20 +351,20 @@ static int __init cs553x_init(void)return -ENXIO ;/* If it doesn't have the CS553[56], abort */ -rdmsrl (MSR_DIVIL_GLD_CAP , val); +rdmsrq (MSR_DIVIL_GLD_CAP , val); val &= ~0xFFULL ;if (val !=CAP_CS5535 && val !=CAP_CS5536 )return -ENXIO ;/* If it doesn't have the NAND controller enabled, abort */ -rdmsrl (MSR_DIVIL_BALL_OPTS , val); +rdmsrq (MSR_DIVIL_BALL_OPTS , val);if (val &PIN_OPT_IDE ) {pr_info ("CS553x NAND controller: Flash I/O not enabled in MSR_DIVIL_BALL_OPTS.\n" );return -ENXIO ; }for (i =0 ; i <NR_CS553X_CONTROLLERS ; i++) { -rdmsrl (MSR_DIVIL_LBAR_FLSH0 + i, val); +rdmsrq (MSR_DIVIL_LBAR_FLSH0 + i, val);if ((val & (FLSH_LBAR_EN |FLSH_NOR_NAND )) == (FLSH_LBAR_EN |FLSH_NOR_NAND )) err =cs553x_init_one (i, !!(val &FLSH_MEM_IO ), val &0xFFFFFFFF );
drivers/platform/x86/intel/ifs/load.c +5 -5
@@ -128,7 +128,7 @@ static void copy_hashes_authenticate_chunks(struct work_struct *work) msrs =ifs_get_test_msrs (dev);/* run scan hash copy */ wrmsrl (msrs->copy_hashes, ifs_hash_ptr); -rdmsrl (msrs->copy_hashes_status, hashes_status.data); +rdmsrq (msrs->copy_hashes_status, hashes_status.data);/* enumerate the scan image information */ num_chunks = hashes_status.num_chunks;
@@ -150,7 +150,7 @@ static void copy_hashes_authenticate_chunks(struct work_struct *work) linear_addr |= i;wrmsrl (msrs->copy_chunks, linear_addr); -rdmsrl (msrs->copy_chunks_status, chunk_status.data); +rdmsrq (msrs->copy_chunks_status, chunk_status.data); ifsd->valid_chunks = chunk_status.valid_chunks; err_code = chunk_status.error_code;
@@ -196,7 +196,7 @@ static int copy_hashes_authenticate_chunks_gen2(struct device *dev)if (need_copy_scan_hashes (ifsd)) {wrmsrl (msrs->copy_hashes, ifs_hash_ptr); -rdmsrl (msrs->copy_hashes_status, hashes_status.data); +rdmsrq (msrs->copy_hashes_status, hashes_status.data);/* enumerate the scan image information */ chunk_size = hashes_status.chunk_size *SZ_1K ;
@@ -217,7 +217,7 @@ static int copy_hashes_authenticate_chunks_gen2(struct device *dev)if (ifsd->generation >=IFS_GEN_STRIDE_AWARE ) {wrmsrl (msrs->test_ctrl,INVALIDATE_STRIDE ); -rdmsrl (msrs->copy_chunks_status, chunk_status.data); +rdmsrq (msrs->copy_chunks_status, chunk_status.data);if (chunk_status.valid_chunks !=0 ) {dev_err (dev,"Couldn't invalidate installed stride - %d\n" , chunk_status.valid_chunks);
@@ -240,7 +240,7 @@ static int copy_hashes_authenticate_chunks_gen2(struct device *dev)local_irq_disable ();wrmsrl (msrs->copy_chunks, (u64 )chunk_table);local_irq_enable (); -rdmsrl (msrs->copy_chunks_status, chunk_status.data); +rdmsrq (msrs->copy_chunks_status, chunk_status.data); err_code = chunk_status.error_code; }while (err_code ==AUTH_INTERRUPTED_ERROR && --retry_count);
drivers/platform/x86/intel/ifs/runtest.c +4 -4
@@ -210,7 +210,7 @@ static int doscan(void *data)* are processed in a single pass) before it retires. */ wrmsrl (MSR_ACTIVATE_SCAN , params->activate->data); -rdmsrl (MSR_SCAN_STATUS , status.data); +rdmsrq (MSR_SCAN_STATUS , status.data);trace_ifs_status (ifsd->cur_batch, start, stop, status.data);
@@ -323,7 +323,7 @@ static int do_array_test(void *data)if (cpu == first) {wrmsrl (MSR_ARRAY_BIST , command->data);/* Pass back the result of the test */ -rdmsrl (MSR_ARRAY_BIST , command->data); +rdmsrq (MSR_ARRAY_BIST , command->data); }return 0 ;
@@ -375,7 +375,7 @@ static int do_array_test_gen1(void *status)if (cpu == first) {wrmsrl (MSR_ARRAY_TRIGGER ,ARRAY_GEN1_TEST_ALL_ARRAYS ); -rdmsrl (MSR_ARRAY_STATUS , *((u64 *)status)); +rdmsrq (MSR_ARRAY_STATUS , *((u64 *)status)); }return 0 ;
@@ -527,7 +527,7 @@ static int dosbaf(void *data)* during the "execution" of the WRMSR. */ wrmsrl (MSR_ACTIVATE_SBAF , run_params->activate->data); -rdmsrl (MSR_SBAF_STATUS , status.data); +rdmsrq (MSR_SBAF_STATUS , status.data);trace_ifs_sbaf (ifsd->cur_batch, *run_params->activate, status);/* Pass back the result of the test */
drivers/platform/x86/intel/pmc/cnp.c +1 -1
@@ -227,7 +227,7 @@ static void disable_c1_auto_demote(void *unused)int cpunum =smp_processor_id ();u64 val; -rdmsrl (MSR_PKG_CST_CONFIG_CONTROL , val); +rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , val);per_cpu (pkg_cst_config, cpunum) = val; val &= ~NHM_C1_AUTO_DEMOTE ;wrmsrl (MSR_PKG_CST_CONFIG_CONTROL , val);
drivers/platform/x86/intel/speed_select_if/isst_if_mbox_msr.c +3 -3
@@ -39,7 +39,7 @@ static int isst_if_send_mbox_cmd(u8 command, u8 sub_command, u32 parameter,/* Poll for rb bit == 0 */ retries =OS_MAILBOX_RETRY_COUNT ; do { - rdmsrl(MSR_OS_MAILBOX_INTERFACE, data); + rdmsrq(MSR_OS_MAILBOX_INTERFACE, data); if (data & BIT_ULL(MSR_OS_MAILBOX_BUSY_BIT)) { ret = -EBUSY; continue;
@@ -64,7 +64,7 @@ static int isst_if_send_mbox_cmd(u8 command, u8 sub_command, u32 parameter,/* Poll for rb bit == 0 */ retries =OS_MAILBOX_RETRY_COUNT ; do { - rdmsrl(MSR_OS_MAILBOX_INTERFACE, data); + rdmsrq(MSR_OS_MAILBOX_INTERFACE, data); if (data & BIT_ULL(MSR_OS_MAILBOX_BUSY_BIT)) { ret = -EBUSY; continue;
@@ -74,7 +74,7 @@ static int isst_if_send_mbox_cmd(u8 command, u8 sub_command, u32 parameter,return -ENXIO ;if (response_data) { -rdmsrl (MSR_OS_MAILBOX_DATA , data); +rdmsrq (MSR_OS_MAILBOX_DATA , data); *response_data = data; } ret =0 ;
drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c +1 -1
@@ -556,7 +556,7 @@ static bool disable_dynamic_sst_features(void) {u64 value; -rdmsrl (MSR_PM_ENABLE , value); +rdmsrq (MSR_PM_ENABLE , value);return !(value &0x1 ); }
drivers/platform/x86/intel_ips.c +10 -10
@@ -370,7 +370,7 @@ static void ips_cpu_raise(struct ips_driver *ips)if (!ips->cpu_turbo_enabled)return ; -rdmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_override); +rdmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_override); cur_tdp_limit = turbo_override &TURBO_TDP_MASK ; new_tdp_limit = cur_tdp_limit +8 ;/* 1W increase */
@@ -405,7 +405,7 @@ static void ips_cpu_lower(struct ips_driver *ips)u64 turbo_override;u16 cur_limit, new_limit; -rdmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_override); +rdmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_override); cur_limit = turbo_override &TURBO_TDP_MASK ; new_limit = cur_limit -8 ;/* 1W decrease */
@@ -437,7 +437,7 @@ static void do_enable_cpu_turbo(void *data) {u64 perf_ctl; -rdmsrl (IA32_PERF_CTL , perf_ctl); +rdmsrq (IA32_PERF_CTL , perf_ctl);if (perf_ctl &IA32_PERF_TURBO_DIS ) { perf_ctl &= ~IA32_PERF_TURBO_DIS ;wrmsrl (IA32_PERF_CTL , perf_ctl);
@@ -475,7 +475,7 @@ static void do_disable_cpu_turbo(void *data) {u64 perf_ctl; -rdmsrl (IA32_PERF_CTL , perf_ctl); +rdmsrq (IA32_PERF_CTL , perf_ctl);if (!(perf_ctl &IA32_PERF_TURBO_DIS )) { perf_ctl |=IA32_PERF_TURBO_DIS ;wrmsrl (IA32_PERF_CTL , perf_ctl);
@@ -1215,7 +1215,7 @@ static int cpu_clamp_show(struct seq_file *m, void *data)u64 turbo_override;int tdp, tdc; -rdmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_override); +rdmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_override); tdp = (int )(turbo_override &TURBO_TDP_MASK ); tdc = (int )((turbo_override &TURBO_TDC_MASK ) >>TURBO_TDC_SHIFT );
@@ -1290,7 +1290,7 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips)return NULL ; } -rdmsrl (IA32_MISC_ENABLE , misc_en); +rdmsrq (IA32_MISC_ENABLE , misc_en);/* * If the turbo enable bit isn't set, we shouldn't try to enable/disable * turbo manually or we'll get an illegal MSR access, even though
@@ -1312,7 +1312,7 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips)return NULL ; } -rdmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_power); +rdmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_power); tdp = turbo_power &TURBO_TDP_MASK ;/* Sanity check TDP against CPU */
@@ -1496,7 +1496,7 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id)* Check PLATFORM_INFO MSR to make sure this chip is * turbo capable. */ -rdmsrl (PLATFORM_INFO , platform_info); +rdmsrq (PLATFORM_INFO , platform_info);if (!(platform_info &PLATFORM_TDP )) {dev_err (&dev->dev,"platform indicates TDP override unavailable, aborting\n" );return -ENODEV ;
@@ -1529,7 +1529,7 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) ips->mgta_val =thm_readw (THM_MGTA );/* Save turbo limits & ratios */ -rdmsrl (TURBO_POWER_CURRENT_LIMIT , ips->orig_turbo_limit); +rdmsrq (TURBO_POWER_CURRENT_LIMIT , ips->orig_turbo_limit);ips_disable_cpu_turbo (ips); ips->cpu_turbo_enabled = false;
@@ -1596,7 +1596,7 @@ static void ips_remove(struct pci_dev *dev)if (ips->gpu_turbo_disable)symbol_put (i915_gpu_turbo_disable); -rdmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_override); +rdmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_override); turbo_override &= ~(TURBO_TDC_OVR_EN |TURBO_TDP_OVR_EN );wrmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_override);wrmsrl (TURBO_POWER_CURRENT_LIMIT , ips->orig_turbo_limit);
drivers/thermal/intel/intel_hfi.c +4 -4
@@ -284,7 +284,7 @@ void intel_hfi_process_event(__u64 pkg_therm_status_msr_val)if (!raw_spin_trylock (&hfi_instance->event_lock))return ; -rdmsrl (MSR_IA32_PACKAGE_THERM_STATUS , msr); +rdmsrq (MSR_IA32_PACKAGE_THERM_STATUS , msr); hfi = msr &PACKAGE_THERM_STATUS_HFI_UPDATED ;if (!hfi) {raw_spin_unlock (&hfi_instance->event_lock);
@@ -356,7 +356,7 @@ static void hfi_enable(void) {u64 msr_val; -rdmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); +rdmsrq (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); msr_val |=HW_FEEDBACK_CONFIG_HFI_ENABLE_BIT ;wrmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); }
@@ -377,7 +377,7 @@ static void hfi_disable(void)u64 msr_val;int i; -rdmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); +rdmsrq (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); msr_val &= ~HW_FEEDBACK_CONFIG_HFI_ENABLE_BIT ;wrmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val);
@@ -388,7 +388,7 @@ static void hfi_disable(void)* memory. */ for (i =0 ; i <2000 ; i++) { -rdmsrl (MSR_IA32_PACKAGE_THERM_STATUS , msr_val); +rdmsrq (MSR_IA32_PACKAGE_THERM_STATUS , msr_val);if (msr_val &PACKAGE_THERM_STATUS_HFI_UPDATED )break ;
drivers/thermal/intel/therm_throt.c +3 -3
@@ -287,7 +287,7 @@ static void get_therm_status(int level, bool *proc_hot, u8 *temp)else msr =MSR_IA32_PACKAGE_THERM_STATUS ; -rdmsrl (msr, msr_val); +rdmsrq (msr, msr_val);if (msr_val &THERM_STATUS_PROCHOT_LOG ) *proc_hot = true;else
@@ -654,7 +654,7 @@ void intel_thermal_interrupt(void)if (static_cpu_has (X86_FEATURE_HWP ))notify_hwp_interrupt (); -rdmsrl (MSR_IA32_THERM_STATUS , msr_val); +rdmsrq (MSR_IA32_THERM_STATUS , msr_val);/* Check for violation of core thermal thresholds*/ notify_thresholds (msr_val);
@@ -669,7 +669,7 @@ void intel_thermal_interrupt(void) CORE_LEVEL);if (this_cpu_has (X86_FEATURE_PTS )) { -rdmsrl (MSR_IA32_PACKAGE_THERM_STATUS , msr_val); +rdmsrq (MSR_IA32_PACKAGE_THERM_STATUS , msr_val);/* check violations of package thermal thresholds */ notify_package_thresholds (msr_val); therm_throt_process(msr_val & PACKAGE_THERM_STATUS_PROCHOT,
drivers/video/fbdev/geode/gxfb_core.c +1 -1
@@ -377,7 +377,7 @@ static int gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)/* Figure out if this is a TFT or CRT part */ -rdmsrl (MSR_GX_GLD_MSR_CONFIG , val); +rdmsrq (MSR_GX_GLD_MSR_CONFIG , val);if ((val &MSR_GX_GLD_MSR_CONFIG_FP ) ==MSR_GX_GLD_MSR_CONFIG_FP ) par->enable_crt =0 ;
drivers/video/fbdev/geode/lxfb_ops.c +6 -6
@@ -358,7 +358,7 @@ void lx_set_mode(struct fb_info *info)/* Set output mode */ -rdmsrl (MSR_LX_GLD_MSR_CONFIG , msrval); +rdmsrq (MSR_LX_GLD_MSR_CONFIG , msrval); msrval &= ~MSR_LX_GLD_MSR_CONFIG_FMT ;if (par->output &OUTPUT_PANEL ) {
@@ -419,7 +419,7 @@ void lx_set_mode(struct fb_info *info)/* Set default watermark values */ -rdmsrl (MSR_LX_SPARE_MSR , msrval); +rdmsrq (MSR_LX_SPARE_MSR , msrval); msrval &= ~(MSR_LX_SPARE_MSR_DIS_CFIFO_HGO | MSR_LX_SPARE_MSR_VFIFO_ARB_SEL
@@ -591,10 +591,10 @@ static void lx_save_regs(struct lxfb_par *par) }while ((i &GP_BLT_STATUS_PB ) || !(i &GP_BLT_STATUS_CE ));/* save MSRs */ -rdmsrl (MSR_LX_MSR_PADSEL , par->msr.padsel); -rdmsrl (MSR_GLCP_DOTPLL , par->msr.dotpll); -rdmsrl (MSR_LX_GLD_MSR_CONFIG , par->msr.dfglcfg); -rdmsrl (MSR_LX_SPARE_MSR , par->msr.dcspare); +rdmsrq (MSR_LX_MSR_PADSEL , par->msr.padsel); +rdmsrq (MSR_GLCP_DOTPLL , par->msr.dotpll); +rdmsrq (MSR_LX_GLD_MSR_CONFIG , par->msr.dfglcfg); +rdmsrq (MSR_LX_SPARE_MSR , par->msr.dcspare);write_dc (par,DC_UNLOCK ,DC_UNLOCK_UNLOCK );
drivers/video/fbdev/geode/suspend_gx.c +4 -4
@@ -21,8 +21,8 @@ static void gx_save_regs(struct gxfb_par *par) }while (i & (GP_BLT_STATUS_BLT_PENDING |GP_BLT_STATUS_BLT_BUSY ));/* save MSRs */ -rdmsrl (MSR_GX_MSR_PADSEL , par->msr.padsel); -rdmsrl (MSR_GLCP_DOTPLL , par->msr.dotpll); +rdmsrq (MSR_GX_MSR_PADSEL , par->msr.padsel); +rdmsrq (MSR_GLCP_DOTPLL , par->msr.dotpll);write_dc (par,DC_UNLOCK ,DC_UNLOCK_UNLOCK );
@@ -43,14 +43,14 @@ static void gx_set_dotpll(uint32_t dotpll_hi)uint32_t dotpll_lo;int i; -rdmsrl (MSR_GLCP_DOTPLL , dotpll_lo); +rdmsrq (MSR_GLCP_DOTPLL , dotpll_lo); dotpll_lo |=MSR_GLCP_DOTPLL_DOTRESET ; dotpll_lo &= ~MSR_GLCP_DOTPLL_BYPASS ;wrmsr (MSR_GLCP_DOTPLL , dotpll_lo, dotpll_hi);/* wait for the PLL to lock */ for (i =0 ; i <200 ; i++) { -rdmsrl (MSR_GLCP_DOTPLL , dotpll_lo); +rdmsrq (MSR_GLCP_DOTPLL , dotpll_lo);if (dotpll_lo &MSR_GLCP_DOTPLL_LOCK )break ;udelay (1 );
drivers/video/fbdev/geode/video_gx.c +4 -4
@@ -142,8 +142,8 @@ void gx_set_dclk_frequency(struct fb_info *info) } } -rdmsrl (MSR_GLCP_SYS_RSTPLL , sys_rstpll); -rdmsrl (MSR_GLCP_DOTPLL , dotpll); +rdmsrq (MSR_GLCP_SYS_RSTPLL , sys_rstpll); +rdmsrq (MSR_GLCP_DOTPLL , dotpll);/* Program new M, N and P. */ dotpll &=0x00000000ffffffffull ;
@@ -167,7 +167,7 @@ void gx_set_dclk_frequency(struct fb_info *info)/* Wait for LOCK bit. */ do { -rdmsrl (MSR_GLCP_DOTPLL , dotpll); +rdmsrq (MSR_GLCP_DOTPLL , dotpll); }while (timeout-- && !(dotpll &MSR_GLCP_DOTPLL_LOCK )); }
@@ -180,7 +180,7 @@ gx_configure_tft(struct fb_info *info)/* Set up the DF pad select MSR */ -rdmsrl (MSR_GX_MSR_PADSEL , val); +rdmsrq (MSR_GX_MSR_PADSEL , val); val &= ~MSR_GX_MSR_PADSEL_MASK ; val |=MSR_GX_MSR_PADSEL_TFT ;wrmsrl (MSR_GX_MSR_PADSEL , val);
include/hyperv/hvgdk_mini.h +1 -1
@@ -1013,7 +1013,7 @@ enum hv_register_name {/* * To support arch-generic code calling hv_set/get_register: -* - On x86, HV_MSR_ indicates an MSR accessed via rdmsrl/wrmsrl +* - On x86, HV_MSR_ indicates an MSR accessed via rdmsrq/wrmsrl * - On ARM, HV_MSR_ indicates a VP register accessed via hypercall */ #define HV_MSR_CRASH_P0 (HV_X64_MSR_CRASH_P0)
Signature · 1 line
2.45.2
PATCH 8/20 x86/msr: Rename 'wrmsrl()' to 'wrmsrq()'
In reply to Ingo Molnar--- arch/x86/events/amd/brs.c | 4 +- arch/x86/events/amd/core.c | 8 +-- arch/x86/events/amd/ibs.c | 8 +-- arch/x86/events/amd/lbr.c | 12 ++-- arch/x86/events/amd/uncore.c | 10 ++-- arch/x86/events/core.c | 12 ++-- arch/x86/events/intel/core.c | 44 +++++++-------- arch/x86/events/intel/ds.c | 10 ++-- arch/x86/events/intel/knc.c | 6 +- arch/x86/events/intel/lbr.c | 28 ++++----- arch/x86/events/intel/p4.c | 4 +- arch/x86/events/intel/p6.c | 4 +- arch/x86/events/intel/pt.c | 18 +++--- arch/x86/events/intel/uncore_discovery.c | 10 ++-- arch/x86/events/intel/uncore_nhmex.c | 66 +++++++++++----------- arch/x86/events/intel/uncore_snb.c | 40 ++++++------- arch/x86/events/intel/uncore_snbep.c | 42 +++++++------- arch/x86/events/perf_event.h | 20 +++---- arch/x86/events/zhaoxin/core.c | 10 ++-- arch/x86/hyperv/hv_apic.c | 2 +- arch/x86/hyperv/hv_init.c | 40 ++++++------- arch/x86/include/asm/apic.h | 2 +- arch/x86/include/asm/debugreg.h | 2 +- arch/x86/include/asm/fsgsbase.h | 2 +- arch/x86/include/asm/msr.h | 4 +- arch/x86/include/asm/paravirt.h | 2 +- arch/x86/kernel/apic/apic.c | 10 ++-- arch/x86/kernel/cpu/bugs.c | 12 ++-- arch/x86/kernel/cpu/bus_lock.c | 6 +- arch/x86/kernel/cpu/common.c | 34 +++++------ arch/x86/kernel/cpu/feat_ctl.c | 2 +- arch/x86/kernel/cpu/intel.c | 2 +- arch/x86/kernel/cpu/intel_epb.c | 2 +- arch/x86/kernel/cpu/mce/amd.c | 8 +-- arch/x86/kernel/cpu/mce/core.c | 8 +-- arch/x86/kernel/cpu/mce/inject.c | 20 +++---- arch/x86/kernel/cpu/mce/intel.c | 10 ++-- arch/x86/kernel/cpu/mshyperv.c | 6 +- arch/x86/kernel/cpu/resctrl/core.c | 6 +- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 2 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 4 +- arch/x86/kernel/cpu/sgx/main.c | 2 +- arch/x86/kernel/cpu/tsx.c | 10 ++-- arch/x86/kernel/fpu/xstate.c | 10 ++-- arch/x86/kernel/fpu/xstate.h | 2 +- arch/x86/kernel/fred.c | 20 +++---- arch/x86/kernel/kvm.c | 26 ++++----- arch/x86/kernel/kvmclock.c | 4 +- arch/x86/kernel/mmconf-fam10h_64.c | 2 +- arch/x86/kernel/process.c | 14 ++--- arch/x86/kernel/process_64.c | 6 +- arch/x86/kernel/reboot_fixups_32.c | 2 +- arch/x86/kernel/shstk.c | 14 ++--- arch/x86/kernel/traps.c | 6 +- arch/x86/kernel/tsc_sync.c | 8 +-- arch/x86/kvm/svm/avic.c | 2 +- arch/x86/kvm/svm/svm.c | 10 ++-- arch/x86/kvm/vmx/pmu_intel.c | 2 +- arch/x86/kvm/vmx/vmx.c | 24 ++++---- arch/x86/kvm/x86.c | 16 +++--- arch/x86/mm/pat/memtype.c | 2 +- arch/x86/mm/tlb.c | 2 +- arch/x86/pci/amd_bus.c | 2 +- arch/x86/platform/olpc/olpc-xo1-sci.c | 2 +- arch/x86/power/cpu.c | 12 ++-- arch/x86/virt/svm/sev.c | 4 +- arch/x86/xen/suspend.c | 4 +- drivers/cpufreq/acpi-cpufreq.c | 2 +- drivers/cpufreq/amd-pstate.c | 2 +- drivers/cpufreq/e_powersaver.c | 2 +- drivers/cpufreq/intel_pstate.c | 12 ++-- drivers/cpufreq/longhaul.c | 16 +++--- drivers/cpufreq/powernow-k7.c | 4 +- drivers/crypto/ccp/sev-dev.c | 2 +- drivers/idle/intel_idle.c | 10 ++-- drivers/platform/x86/intel/ifs/load.c | 10 ++-- drivers/platform/x86/intel/ifs/runtest.c | 8 +-- drivers/platform/x86/intel/pmc/cnp.c | 4 +- .../x86/intel/speed_select_if/isst_if_mbox_msr.c | 4 +- drivers/platform/x86/intel_ips.c | 16 +++--- drivers/thermal/intel/intel_hfi.c | 6 +- drivers/thermal/intel/therm_throt.c | 2 +- drivers/video/fbdev/geode/lxfb_ops.c | 10 ++-- drivers/video/fbdev/geode/suspend_gx.c | 2 +- drivers/video/fbdev/geode/video_gx.c | 8 +-- include/hyperv/hvgdk_mini.h | 2 +- 86 files changed, 436 insertions(+), 436 deletions(-)
arch/x86/events/amd/brs.c +2 -2
@@ -187,7 +187,7 @@ void amd_brs_reset(void)/* * Mark first entry as poisoned */ -wrmsrl (brs_to (0 ),BRS_POISON ); +wrmsrq (brs_to (0 ),BRS_POISON ); }int __init amd_brs_init (void )
@@ -371,7 +371,7 @@ static void amd_brs_poison_buffer(void) idx =amd_brs_get_tos (&cfg);/* Poison target of entry */ -wrmsrl (brs_to (idx),BRS_POISON ); +wrmsrq (brs_to (idx),BRS_POISON ); }/*
arch/x86/events/amd/core.c +4 -4
@@ -563,13 +563,13 @@ static void amd_pmu_cpu_reset(int cpu)return ;/* Clear enable bits i.e. PerfCntrGlobalCtl.PerfCntrEn */ -wrmsrl (MSR_AMD64_PERF_CNTR_GLOBAL_CTL ,0 ); +wrmsrq (MSR_AMD64_PERF_CNTR_GLOBAL_CTL ,0 );/* * Clear freeze and overflow bits i.e. PerfCntrGLobalStatus.LbrFreeze * and PerfCntrGLobalStatus.PerfCntrOvfl */ -wrmsrl (MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR , +wrmsrq (MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR ,GLOBAL_STATUS_LBRS_FROZEN | amd_pmu_global_cntr_mask); }
@@ -651,7 +651,7 @@ static void amd_pmu_cpu_dead(int cpu) static __always_inline void amd_pmu_set_global_ctl(u64 ctl) { -wrmsrl (MSR_AMD64_PERF_CNTR_GLOBAL_CTL , ctl); +wrmsrq (MSR_AMD64_PERF_CNTR_GLOBAL_CTL , ctl); }static inline u64 amd_pmu_get_global_status (void )
@@ -672,7 +672,7 @@ static inline void amd_pmu_ack_global_status(u64 status)* clears the same bit in PerfCntrGlobalStatus */ -wrmsrl (MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR , status); +wrmsrq (MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR , status); }static bool amd_pmu_test_overflow_topbit (int idx)
arch/x86/events/amd/ibs.c +4 -4
@@ -435,9 +435,9 @@ static inline void perf_ibs_enable_event(struct perf_ibs *perf_ibs,u64 tmp = hwc->config | config;if (perf_ibs->fetch_count_reset_broken) -wrmsrl (hwc->config_base, tmp & ~perf_ibs->enable_mask); +wrmsrq (hwc->config_base, tmp & ~perf_ibs->enable_mask); -wrmsrl (hwc->config_base, tmp | perf_ibs->enable_mask); +wrmsrq (hwc->config_base, tmp | perf_ibs->enable_mask); }/*
@@ -452,9 +452,9 @@ static inline void perf_ibs_disable_event(struct perf_ibs *perf_ibs, { config &= ~perf_ibs->cnt_mask;if (boot_cpu_data.x86 ==0x10 ) -wrmsrl (hwc->config_base, config); +wrmsrq (hwc->config_base, config); config &= ~perf_ibs->enable_mask; -wrmsrl (hwc->config_base, config); +wrmsrq (hwc->config_base, config); }/*
arch/x86/events/amd/lbr.c +6 -6
@@ -61,12 +61,12 @@ struct branch_entry { static __always_inline void amd_pmu_lbr_set_from(unsigned int idx, u64 val) { -wrmsrl (MSR_AMD_SAMP_BR_FROM + idx *2 , val); +wrmsrq (MSR_AMD_SAMP_BR_FROM + idx *2 , val); } static __always_inline void amd_pmu_lbr_set_to(unsigned int idx, u64 val) { -wrmsrl (MSR_AMD_SAMP_BR_FROM + idx *2 +1 , val); +wrmsrq (MSR_AMD_SAMP_BR_FROM + idx *2 +1 , val); } static __always_inline u64 amd_pmu_lbr_get_from(unsigned int idx)
@@ -333,7 +333,7 @@ void amd_pmu_lbr_reset(void) cpuc->last_task_ctx =NULL ; cpuc->last_log_id =0 ; -wrmsrl (MSR_AMD64_LBR_SELECT ,0 ); +wrmsrq (MSR_AMD64_LBR_SELECT ,0 ); }void amd_pmu_lbr_add (struct perf_event *event)
@@ -396,16 +396,16 @@ void amd_pmu_lbr_enable_all(void)/* Set hardware branch filter */ if (cpuc->lbr_select) { lbr_select = cpuc->lbr_sel->config &LBR_SELECT_MASK ; -wrmsrl (MSR_AMD64_LBR_SELECT , lbr_select); +wrmsrq (MSR_AMD64_LBR_SELECT , lbr_select); }if (cpu_feature_enabled (X86_FEATURE_AMD_LBR_PMC_FREEZE )) {rdmsrq (MSR_IA32_DEBUGCTLMSR , dbg_ctl); -wrmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl |DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); +wrmsrq (MSR_IA32_DEBUGCTLMSR , dbg_ctl |DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); }rdmsrq (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg); -wrmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg |DBG_EXTN_CFG_LBRV2EN ); +wrmsrq (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg |DBG_EXTN_CFG_LBRV2EN ); }void amd_pmu_lbr_disable_all (void )
arch/x86/events/amd/uncore.c +5 -5
@@ -121,10 +121,10 @@ static void amd_uncore_start(struct perf_event *event, int flags)struct hw_perf_event *hwc = &event->hw;if (flags &PERF_EF_RELOAD ) -wrmsrl (hwc->event_base, (u64 )local64_read (&hwc->prev_count)); +wrmsrq (hwc->event_base, (u64 )local64_read (&hwc->prev_count)); hwc->state =0 ; -wrmsrl (hwc->config_base, (hwc->config |ARCH_PERFMON_EVENTSEL_ENABLE )); +wrmsrq (hwc->config_base, (hwc->config |ARCH_PERFMON_EVENTSEL_ENABLE ));perf_event_update_userpage (event); }
@@ -132,7 +132,7 @@ static void amd_uncore_stop(struct perf_event *event, int flags) {struct hw_perf_event *hwc = &event->hw; -wrmsrl (hwc->config_base, hwc->config); +wrmsrq (hwc->config_base, hwc->config); hwc->state |=PERF_HES_STOPPED ;if ((flags &PERF_EF_UPDATE ) && !(hwc->state &PERF_HES_UPTODATE )) {
@@ -883,10 +883,10 @@ static void amd_uncore_umc_start(struct perf_event *event, int flags)struct hw_perf_event *hwc = &event->hw;if (flags &PERF_EF_RELOAD ) -wrmsrl (hwc->event_base, (u64 )local64_read (&hwc->prev_count)); +wrmsrq (hwc->event_base, (u64 )local64_read (&hwc->prev_count)); hwc->state =0 ; -wrmsrl (hwc->config_base, (hwc->config |AMD64_PERFMON_V2_ENABLE_UMC )); +wrmsrq (hwc->config_base, (hwc->config |AMD64_PERFMON_V2_ENABLE_UMC ));perf_event_update_userpage (event); }
arch/x86/events/core.c +6 -6
@@ -697,9 +697,9 @@ void x86_pmu_disable_all(void)if (!(val &ARCH_PERFMON_EVENTSEL_ENABLE ))continue ; val &= ~ARCH_PERFMON_EVENTSEL_ENABLE ; -wrmsrl (x86_pmu_config_addr (idx), val); +wrmsrq (x86_pmu_config_addr (idx), val);if (is_counter_pair (hwc)) -wrmsrl (x86_pmu_config_addr (idx +1 ),0 ); +wrmsrq (x86_pmu_config_addr (idx +1 ),0 ); } }
@@ -1420,14 +1420,14 @@ int x86_perf_event_set_period(struct perf_event *event)*/ local64_set (&hwc->prev_count, (u64)-left); -wrmsrl (hwc->event_base, (u64)(-left) & x86_pmu.cntval_mask); +wrmsrq (hwc->event_base, (u64)(-left) & x86_pmu.cntval_mask);/* * Sign extend the Merge event counter's upper 16 bits since * we currently declare a 48-bit counter width */ if (is_counter_pair (hwc)) -wrmsrl (x86_pmu_event_addr (idx +1 ),0xffff ); +wrmsrq (x86_pmu_event_addr (idx +1 ),0xffff );perf_event_update_userpage (event);
@@ -2496,9 +2496,9 @@ void perf_clear_dirty_counters(void)if (!test_bit (i -INTEL_PMC_IDX_FIXED ,hybrid (cpuc->pmu, fixed_cntr_mask)))continue ; -wrmsrl (x86_pmu_fixed_ctr_addr (i -INTEL_PMC_IDX_FIXED ),0 ); +wrmsrq (x86_pmu_fixed_ctr_addr (i -INTEL_PMC_IDX_FIXED ),0 ); }else { -wrmsrl (x86_pmu_event_addr (i),0 ); +wrmsrq (x86_pmu_event_addr (i),0 ); } }
arch/x86/events/intel/core.c +22 -22
138 lines not on this page · raw message
arch/x86/events/intel/ds.c +5 -5
@@ -1515,7 +1515,7 @@ static void intel_pmu_pebs_via_pt_enable(struct perf_event *event)else value = ds->pebs_event_reset[MAX_PEBS_EVENTS + idx]; } -wrmsrl (base + idx, value); +wrmsrq (base + idx, value); }static inline void intel_pmu_drain_large_pebs (struct cpu_hw_events *cpuc)
@@ -1552,7 +1552,7 @@ void intel_pmu_pebs_enable(struct perf_event *event)*/ intel_pmu_drain_pebs_buffer ();adaptive_pebs_record_size_update (); -wrmsrl (MSR_PEBS_DATA_CFG , pebs_data_cfg); +wrmsrq (MSR_PEBS_DATA_CFG , pebs_data_cfg); cpuc->active_pebs_data_cfg = pebs_data_cfg; } }
@@ -1615,7 +1615,7 @@ void intel_pmu_pebs_disable(struct perf_event *event)intel_pmu_pebs_via_pt_disable (event);if (cpuc->enabled) -wrmsrl (MSR_IA32_PEBS_ENABLE , cpuc->pebs_enabled); +wrmsrq (MSR_IA32_PEBS_ENABLE , cpuc->pebs_enabled); hwc->config |=ARCH_PERFMON_EVENTSEL_INT ; }
@@ -1625,7 +1625,7 @@ void intel_pmu_pebs_enable_all(void)struct cpu_hw_events *cpuc =this_cpu_ptr (&cpu_hw_events);if (cpuc->pebs_enabled) -wrmsrl (MSR_IA32_PEBS_ENABLE , cpuc->pebs_enabled); +wrmsrq (MSR_IA32_PEBS_ENABLE , cpuc->pebs_enabled); }void intel_pmu_pebs_disable_all (void )
@@ -2771,5 +2771,5 @@ void perf_restore_debug_store(void)if (!x86_pmu.bts && !x86_pmu.pebs)return ; -wrmsrl (MSR_IA32_DS_AREA , (unsigned long )ds); +wrmsrq (MSR_IA32_DS_AREA , (unsigned long )ds); }
arch/x86/events/intel/knc.c +3 -3
@@ -161,7 +161,7 @@ static void knc_pmu_disable_all(void)rdmsrq (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); val &= ~(KNC_ENABLE_COUNTER0 |KNC_ENABLE_COUNTER1 ); -wrmsrl (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); +wrmsrq (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); }static void knc_pmu_enable_all (int added)
@@ -170,7 +170,7 @@ static void knc_pmu_enable_all(int added)rdmsrq (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); val |= (KNC_ENABLE_COUNTER0 |KNC_ENABLE_COUNTER1 ); -wrmsrl (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); +wrmsrq (MSR_KNC_IA32_PERF_GLOBAL_CTRL , val); } static inline void
@@ -207,7 +207,7 @@ static inline u64 knc_pmu_get_status(void)static inline void knc_pmu_ack_status (u64 ack) { -wrmsrl (MSR_KNC_IA32_PERF_GLOBAL_OVF_CONTROL , ack); +wrmsrq (MSR_KNC_IA32_PERF_GLOBAL_OVF_CONTROL , ack); }static int knc_pmu_handle_irq (struct pt_regs *regs)
arch/x86/events/intel/lbr.c +14 -14
@@ -137,7 +137,7 @@ static void __intel_pmu_lbr_enable(bool pmi)if (cpuc->lbr_sel) lbr_select = cpuc->lbr_sel->config & x86_pmu.lbr_sel_mask;if (!static_cpu_has (X86_FEATURE_ARCH_LBR ) && !pmi && cpuc->lbr_sel) -wrmsrl (MSR_LBR_SELECT , lbr_select); +wrmsrq (MSR_LBR_SELECT , lbr_select);rdmsrq (MSR_IA32_DEBUGCTLMSR , debugctl); orig_debugctl = debugctl;
@@ -155,10 +155,10 @@ static void __intel_pmu_lbr_enable(bool pmi) debugctl |=DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ;if (orig_debugctl != debugctl) -wrmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); +wrmsrq (MSR_IA32_DEBUGCTLMSR , debugctl);if (static_cpu_has (X86_FEATURE_ARCH_LBR )) -wrmsrl (MSR_ARCH_LBR_CTL , lbr_select |ARCH_LBR_CTL_LBREN ); +wrmsrq (MSR_ARCH_LBR_CTL , lbr_select |ARCH_LBR_CTL_LBREN ); }void intel_pmu_lbr_reset_32 (void )
@@ -166,7 +166,7 @@ void intel_pmu_lbr_reset_32(void)int i;for (i =0 ; i < x86_pmu.lbr_nr; i++) -wrmsrl (x86_pmu.lbr_from + i,0 ); +wrmsrq (x86_pmu.lbr_from + i,0 ); }void intel_pmu_lbr_reset_64 (void )
@@ -174,17 +174,17 @@ void intel_pmu_lbr_reset_64(void)int i;for (i =0 ; i < x86_pmu.lbr_nr; i++) { -wrmsrl (x86_pmu.lbr_from + i,0 ); -wrmsrl (x86_pmu.lbr_to + i,0 ); +wrmsrq (x86_pmu.lbr_from + i,0 ); +wrmsrq (x86_pmu.lbr_to + i,0 );if (x86_pmu.lbr_has_info) -wrmsrl (x86_pmu.lbr_info + i,0 ); +wrmsrq (x86_pmu.lbr_info + i,0 ); } }static void intel_pmu_arch_lbr_reset (void ) {/* Write to ARCH_LBR_DEPTH MSR, all LBR entries are reset to 0 */ -wrmsrl (MSR_ARCH_LBR_DEPTH , x86_pmu.lbr_nr); +wrmsrq (MSR_ARCH_LBR_DEPTH , x86_pmu.lbr_nr); }void intel_pmu_lbr_reset (void )
@@ -199,7 +199,7 @@ void intel_pmu_lbr_reset(void) cpuc->last_task_ctx =NULL ; cpuc->last_log_id =0 ;if (!static_cpu_has (X86_FEATURE_ARCH_LBR ) && cpuc->lbr_select) -wrmsrl (MSR_LBR_SELECT ,0 ); +wrmsrq (MSR_LBR_SELECT ,0 ); }/*
@@ -282,17 +282,17 @@ static u64 lbr_from_signext_quirk_rd(u64 val) static __always_inline void wrlbr_from(unsigned int idx, u64 val) { val =lbr_from_signext_quirk_wr (val); -wrmsrl (x86_pmu.lbr_from + idx, val); +wrmsrq (x86_pmu.lbr_from + idx, val); } static __always_inline void wrlbr_to(unsigned int idx, u64 val) { -wrmsrl (x86_pmu.lbr_to + idx, val); +wrmsrq (x86_pmu.lbr_to + idx, val); } static __always_inline void wrlbr_info(unsigned int idx, u64 val) { -wrmsrl (x86_pmu.lbr_info + idx, val); +wrmsrq (x86_pmu.lbr_info + idx, val); } static __always_inline u64 rdlbr_from(unsigned int idx, struct lbr_entry *lbr)
@@ -380,10 +380,10 @@ void intel_pmu_lbr_restore(void *ctx)wrlbr_info (lbr_idx,0 ); } -wrmsrl (x86_pmu.lbr_tos, tos); +wrmsrq (x86_pmu.lbr_tos, tos);if (cpuc->lbr_select) -wrmsrl (MSR_LBR_SELECT , task_ctx->lbr_sel); +wrmsrq (MSR_LBR_SELECT , task_ctx->lbr_sel); }static void intel_pmu_arch_lbr_restore (void *ctx)
arch/x86/events/intel/p4.c +2 -2
@@ -861,7 +861,7 @@ static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc)/* an official way for overflow indication */ rdmsrq (hwc->config_base, v);if (v &P4_CCCR_OVF ) { -wrmsrl (hwc->config_base, v & ~P4_CCCR_OVF ); +wrmsrq (hwc->config_base, v & ~P4_CCCR_OVF );return 1 ; }
@@ -1024,7 +1024,7 @@ static int p4_pmu_set_period(struct perf_event *event)* * the former idea is taken from OProfile code */ -wrmsrl (hwc->event_base, (u64)(-left) & x86_pmu.cntval_mask); +wrmsrq (hwc->event_base, (u64)(-left) & x86_pmu.cntval_mask); }return ret;
arch/x86/events/intel/p6.c +2 -2
@@ -144,7 +144,7 @@ static void p6_pmu_disable_all(void)/* p6 only has one enable register */ rdmsrq (MSR_P6_EVNTSEL0 , val); val &= ~ARCH_PERFMON_EVENTSEL_ENABLE ; -wrmsrl (MSR_P6_EVNTSEL0 , val); +wrmsrq (MSR_P6_EVNTSEL0 , val); }static void p6_pmu_enable_all (int added)
@@ -154,7 +154,7 @@ static void p6_pmu_enable_all(int added)/* p6 only has one enable register */ rdmsrq (MSR_P6_EVNTSEL0 , val); val |=ARCH_PERFMON_EVENTSEL_ENABLE ; -wrmsrl (MSR_P6_EVNTSEL0 , val); +wrmsrq (MSR_P6_EVNTSEL0 , val); } static inline void
arch/x86/events/intel/pt.c +9 -9
@@ -426,7 +426,7 @@ static void pt_config_start(struct perf_event *event)if (READ_ONCE (pt->vmx_on))perf_aux_output_flag (&pt->handle,PERF_AUX_FLAG_PARTIAL );else -wrmsrl (MSR_IA32_RTIT_CTL , ctl); +wrmsrq (MSR_IA32_RTIT_CTL , ctl);WRITE_ONCE (event->hw.aux_config, ctl); }
@@ -485,12 +485,12 @@ static u64 pt_config_filters(struct perf_event *event)/* avoid redundant msr writes */ if (pt->filters.filter[range].msr_a != filter->msr_a) { -wrmsrl (pt_address_ranges[range].msr_a, filter->msr_a); +wrmsrq (pt_address_ranges[range].msr_a, filter->msr_a); pt->filters.filter[range].msr_a = filter->msr_a; }if (pt->filters.filter[range].msr_b != filter->msr_b) { -wrmsrl (pt_address_ranges[range].msr_b, filter->msr_b); +wrmsrq (pt_address_ranges[range].msr_b, filter->msr_b); pt->filters.filter[range].msr_b = filter->msr_b; }
@@ -509,7 +509,7 @@ static void pt_config(struct perf_event *event)/* First round: clear STATUS, in particular the PSB byte counter. */ if (!event->hw.aux_config) {perf_event_itrace_started (event); -wrmsrl (MSR_IA32_RTIT_STATUS ,0 ); +wrmsrq (MSR_IA32_RTIT_STATUS ,0 ); } reg =pt_config_filters (event);
@@ -569,7 +569,7 @@ static void pt_config_stop(struct perf_event *event) ctl &= ~RTIT_CTL_TRACEEN ;if (!READ_ONCE (pt->vmx_on)) -wrmsrl (MSR_IA32_RTIT_CTL , ctl); +wrmsrq (MSR_IA32_RTIT_CTL , ctl);WRITE_ONCE (event->hw.aux_config, ctl);
@@ -658,13 +658,13 @@ static void pt_config_buffer(struct pt_buffer *buf) reg =virt_to_phys (base);if (pt->output_base != reg) { pt->output_base = reg; -wrmsrl (MSR_IA32_RTIT_OUTPUT_BASE , reg); +wrmsrq (MSR_IA32_RTIT_OUTPUT_BASE , reg); } reg =0x7f | (mask <<7 ) | ((u64 )buf->output_off <<32 );if (pt->output_mask != reg) { pt->output_mask = reg; -wrmsrl (MSR_IA32_RTIT_OUTPUT_MASK , reg); +wrmsrq (MSR_IA32_RTIT_OUTPUT_MASK , reg); } }
@@ -970,7 +970,7 @@ static void pt_handle_status(struct pt *pt)if (advance)pt_buffer_advance (buf); -wrmsrl (MSR_IA32_RTIT_STATUS , status); +wrmsrq (MSR_IA32_RTIT_STATUS , status); }/**
@@ -1585,7 +1585,7 @@ void intel_pt_handle_vmx(int on)/* Turn PTs back on */ if (!on && event) -wrmsrl (MSR_IA32_RTIT_CTL , event->hw.aux_config); +wrmsrq (MSR_IA32_RTIT_CTL , event->hw.aux_config);local_irq_restore (flags); }
arch/x86/events/intel/uncore_discovery.c +5 -5
@@ -441,17 +441,17 @@ static u64 intel_generic_uncore_box_ctl(struct intel_uncore_box *box)void intel_generic_uncore_msr_init_box (struct intel_uncore_box *box) { -wrmsrl (intel_generic_uncore_box_ctl (box),GENERIC_PMON_BOX_CTL_INT ); +wrmsrq (intel_generic_uncore_box_ctl (box),GENERIC_PMON_BOX_CTL_INT ); }void intel_generic_uncore_msr_disable_box (struct intel_uncore_box *box) { -wrmsrl (intel_generic_uncore_box_ctl (box),GENERIC_PMON_BOX_CTL_FRZ ); +wrmsrq (intel_generic_uncore_box_ctl (box),GENERIC_PMON_BOX_CTL_FRZ ); }void intel_generic_uncore_msr_enable_box (struct intel_uncore_box *box) { -wrmsrl (intel_generic_uncore_box_ctl (box),0 ); +wrmsrq (intel_generic_uncore_box_ctl (box),0 ); } static void intel_generic_uncore_msr_enable_event(struct intel_uncore_box *box,
@@ -459,7 +459,7 @@ static void intel_generic_uncore_msr_enable_event(struct intel_uncore_box *box, {struct hw_perf_event *hwc = &event->hw; -wrmsrl (hwc->config_base, hwc->config); +wrmsrq (hwc->config_base, hwc->config); } static void intel_generic_uncore_msr_disable_event(struct intel_uncore_box *box,
@@ -467,7 +467,7 @@ static void intel_generic_uncore_msr_disable_event(struct intel_uncore_box *box, {struct hw_perf_event *hwc = &event->hw; -wrmsrl (hwc->config_base,0 ); +wrmsrq (hwc->config_base,0 ); }static struct intel_uncore_ops generic_uncore_msr_ops = {
arch/x86/events/intel/uncore_nhmex.c +33 -33
154 lines not on this page · raw message
arch/x86/events/intel/uncore_snb.c +20 -20
@@ -260,34 +260,34 @@ static void snb_uncore_msr_enable_event(struct intel_uncore_box *box, struct perstruct hw_perf_event *hwc = &event->hw;if (hwc->idx <UNCORE_PMC_IDX_FIXED ) -wrmsrl (hwc->config_base, hwc->config |SNB_UNC_CTL_EN ); +wrmsrq (hwc->config_base, hwc->config |SNB_UNC_CTL_EN );else -wrmsrl (hwc->config_base,SNB_UNC_CTL_EN ); +wrmsrq (hwc->config_base,SNB_UNC_CTL_EN ); }static void snb_uncore_msr_disable_event (struct intel_uncore_box *box,struct perf_event *event) { -wrmsrl (event->hw.config_base,0 ); +wrmsrq (event->hw.config_base,0 ); }static void snb_uncore_msr_init_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 ) { -wrmsrl (SNB_UNC_PERF_GLOBAL_CTL , +wrmsrq (SNB_UNC_PERF_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN |SNB_UNC_GLOBAL_CTL_CORE_ALL ); } }static void snb_uncore_msr_enable_box (struct intel_uncore_box *box) { -wrmsrl (SNB_UNC_PERF_GLOBAL_CTL , +wrmsrq (SNB_UNC_PERF_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN |SNB_UNC_GLOBAL_CTL_CORE_ALL ); }static void snb_uncore_msr_exit_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 ) -wrmsrl (SNB_UNC_PERF_GLOBAL_CTL ,0 ); +wrmsrq (SNB_UNC_PERF_GLOBAL_CTL ,0 ); }static struct uncore_event_desc snb_uncore_events[] = {
@@ -372,7 +372,7 @@ void snb_uncore_cpu_init(void)static void skl_uncore_msr_init_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 ) { -wrmsrl (SKL_UNC_PERF_GLOBAL_CTL , +wrmsrq (SKL_UNC_PERF_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN |SKL_UNC_GLOBAL_CTL_CORE_ALL ); }
@@ -383,14 +383,14 @@ static void skl_uncore_msr_init_box(struct intel_uncore_box *box)static void skl_uncore_msr_enable_box (struct intel_uncore_box *box) { -wrmsrl (SKL_UNC_PERF_GLOBAL_CTL , +wrmsrq (SKL_UNC_PERF_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN |SKL_UNC_GLOBAL_CTL_CORE_ALL ); }static void skl_uncore_msr_exit_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 ) -wrmsrl (SKL_UNC_PERF_GLOBAL_CTL ,0 ); +wrmsrq (SKL_UNC_PERF_GLOBAL_CTL ,0 ); }static struct intel_uncore_ops skl_uncore_msr_ops = {
@@ -525,7 +525,7 @@ static struct intel_uncore_type *tgl_msr_uncores[] = {static void rkl_uncore_msr_init_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 ) -wrmsrl (SKL_UNC_PERF_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN ); +wrmsrq (SKL_UNC_PERF_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN ); }void tgl_uncore_cpu_init (void )
@@ -541,24 +541,24 @@ void tgl_uncore_cpu_init(void)static void adl_uncore_msr_init_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 ) -wrmsrl (ADL_UNC_PERF_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN ); +wrmsrq (ADL_UNC_PERF_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN ); }static void adl_uncore_msr_enable_box (struct intel_uncore_box *box) { -wrmsrl (ADL_UNC_PERF_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN ); +wrmsrq (ADL_UNC_PERF_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN ); }static void adl_uncore_msr_disable_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 ) -wrmsrl (ADL_UNC_PERF_GLOBAL_CTL ,0 ); +wrmsrq (ADL_UNC_PERF_GLOBAL_CTL ,0 ); }static void adl_uncore_msr_exit_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 ) -wrmsrl (ADL_UNC_PERF_GLOBAL_CTL ,0 ); +wrmsrq (ADL_UNC_PERF_GLOBAL_CTL ,0 ); }static struct intel_uncore_ops adl_uncore_msr_ops = {
@@ -691,7 +691,7 @@ static struct intel_uncore_type mtl_uncore_hac_cbox = {static void mtl_uncore_msr_init_box (struct intel_uncore_box *box) { -wrmsrl (uncore_msr_box_ctl (box),SNB_UNC_GLOBAL_CTL_EN ); +wrmsrq (uncore_msr_box_ctl (box),SNB_UNC_GLOBAL_CTL_EN ); }static struct intel_uncore_ops mtl_uncore_msr_ops = {
@@ -758,7 +758,7 @@ static struct intel_uncore_type *lnl_msr_uncores[] = {static void lnl_uncore_msr_init_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 ) -wrmsrl (LNL_UNC_MSR_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN ); +wrmsrq (LNL_UNC_MSR_GLOBAL_CTL ,SNB_UNC_GLOBAL_CTL_EN ); }static struct intel_uncore_ops lnl_uncore_msr_ops = {
@@ -1306,12 +1306,12 @@ int skl_uncore_pci_init(void)/* Nehalem uncore support */ static void nhm_uncore_msr_disable_box (struct intel_uncore_box *box) { -wrmsrl (NHM_UNC_PERF_GLOBAL_CTL ,0 ); +wrmsrq (NHM_UNC_PERF_GLOBAL_CTL ,0 ); }static void nhm_uncore_msr_enable_box (struct intel_uncore_box *box) { -wrmsrl (NHM_UNC_PERF_GLOBAL_CTL ,NHM_UNC_GLOBAL_CTL_EN_PC_ALL |NHM_UNC_GLOBAL_CTL_EN_FC ); +wrmsrq (NHM_UNC_PERF_GLOBAL_CTL ,NHM_UNC_GLOBAL_CTL_EN_PC_ALL |NHM_UNC_GLOBAL_CTL_EN_FC ); }static void nhm_uncore_msr_enable_event (struct intel_uncore_box *box,struct perf_event *event)
@@ -1319,9 +1319,9 @@ static void nhm_uncore_msr_enable_event(struct intel_uncore_box *box, struct perstruct hw_perf_event *hwc = &event->hw;if (hwc->idx <UNCORE_PMC_IDX_FIXED ) -wrmsrl (hwc->config_base, hwc->config |SNB_UNC_CTL_EN ); +wrmsrq (hwc->config_base, hwc->config |SNB_UNC_CTL_EN );else -wrmsrl (hwc->config_base,NHM_UNC_FIXED_CTR_CTL_EN ); +wrmsrq (hwc->config_base,NHM_UNC_FIXED_CTR_CTL_EN ); }static struct attribute *nhm_uncore_formats_attr[] = {
arch/x86/events/intel/uncore_snbep.c +21 -21
128 lines not on this page · raw message
arch/x86/events/perf_event.h +10 -10
@@ -1198,16 +1198,16 @@ static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc,u64 disable_mask =__this_cpu_read (cpu_hw_events.perf_ctr_virt_mask);if (hwc->extra_reg.reg) -wrmsrl (hwc->extra_reg.reg, hwc->extra_reg.config); +wrmsrq (hwc->extra_reg.reg, hwc->extra_reg.config);/* * Add enabled Merge event on next counter * if large increment event being enabled on this counter */ if (is_counter_pair (hwc)) -wrmsrl (x86_pmu_config_addr (hwc->idx +1 ), x86_pmu.perf_ctr_pair_en); +wrmsrq (x86_pmu_config_addr (hwc->idx +1 ), x86_pmu.perf_ctr_pair_en); -wrmsrl (hwc->config_base, (hwc->config | enable_mask) & ~disable_mask); +wrmsrq (hwc->config_base, (hwc->config | enable_mask) & ~disable_mask); }void x86_pmu_enable_all (int added);
@@ -1223,10 +1223,10 @@ static inline void x86_pmu_disable_event(struct perf_event *event)u64 disable_mask =__this_cpu_read (cpu_hw_events.perf_ctr_virt_mask);struct hw_perf_event *hwc = &event->hw; -wrmsrl (hwc->config_base, hwc->config & ~disable_mask); +wrmsrq (hwc->config_base, hwc->config & ~disable_mask);if (is_counter_pair (hwc)) -wrmsrl (x86_pmu_config_addr (hwc->idx +1 ),0 ); +wrmsrq (x86_pmu_config_addr (hwc->idx +1 ),0 ); }void x86_pmu_enable_event (struct perf_event *event);
@@ -1395,11 +1395,11 @@ static __always_inline void __amd_pmu_lbr_disable(void)u64 dbg_ctl, dbg_extn_cfg;rdmsrq (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg); -wrmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg & ~DBG_EXTN_CFG_LBRV2EN ); +wrmsrq (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg & ~DBG_EXTN_CFG_LBRV2EN );if (cpu_feature_enabled (X86_FEATURE_AMD_LBR_PMC_FREEZE )) {rdmsrq (MSR_IA32_DEBUGCTLMSR , dbg_ctl); -wrmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl & ~DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); +wrmsrq (MSR_IA32_DEBUGCTLMSR , dbg_ctl & ~DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); } }
@@ -1531,12 +1531,12 @@ static inline bool intel_pmu_has_bts(struct perf_event *event) static __always_inline void __intel_pmu_pebs_disable_all(void) { -wrmsrl (MSR_IA32_PEBS_ENABLE ,0 ); +wrmsrq (MSR_IA32_PEBS_ENABLE ,0 ); } static __always_inline void __intel_pmu_arch_lbr_disable(void) { -wrmsrl (MSR_ARCH_LBR_CTL ,0 ); +wrmsrq (MSR_ARCH_LBR_CTL ,0 ); } static __always_inline void __intel_pmu_lbr_disable(void)
@@ -1545,7 +1545,7 @@ static __always_inline void __intel_pmu_lbr_disable(void)rdmsrq (MSR_IA32_DEBUGCTLMSR , debugctl); debugctl &= ~(DEBUGCTLMSR_LBR |DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); -wrmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); +wrmsrq (MSR_IA32_DEBUGCTLMSR , debugctl); }int intel_pmu_save_and_restart (struct perf_event *event);
arch/x86/events/zhaoxin/core.c +5 -5
@@ -254,12 +254,12 @@ static __initconst const u64 zxe_hw_cache_event_idsstatic void zhaoxin_pmu_disable_all (void ) { -wrmsrl (MSR_CORE_PERF_GLOBAL_CTRL ,0 ); +wrmsrq (MSR_CORE_PERF_GLOBAL_CTRL ,0 ); }static void zhaoxin_pmu_enable_all (int added) { -wrmsrl (MSR_CORE_PERF_GLOBAL_CTRL , x86_pmu.intel_ctrl); +wrmsrq (MSR_CORE_PERF_GLOBAL_CTRL , x86_pmu.intel_ctrl); }static inline u64 zhaoxin_pmu_get_status (void )
@@ -273,7 +273,7 @@ static inline u64 zhaoxin_pmu_get_status(void)static inline void zhaoxin_pmu_ack_status (u64 ack) { -wrmsrl (MSR_CORE_PERF_GLOBAL_OVF_CTRL , ack); +wrmsrq (MSR_CORE_PERF_GLOBAL_OVF_CTRL , ack); }static inline void zxc_pmu_ack_status (u64 ack)
@@ -295,7 +295,7 @@ static void zhaoxin_pmu_disable_fixed(struct hw_perf_event *hwc)rdmsrq (hwc->config_base, ctrl_val); ctrl_val &= ~mask; -wrmsrl (hwc->config_base, ctrl_val); +wrmsrq (hwc->config_base, ctrl_val); }static void zhaoxin_pmu_disable_event (struct perf_event *event)
@@ -332,7 +332,7 @@ static void zhaoxin_pmu_enable_fixed(struct hw_perf_event *hwc)rdmsrq (hwc->config_base, ctrl_val); ctrl_val &= ~mask; ctrl_val |= bits; -wrmsrl (hwc->config_base, ctrl_val); +wrmsrq (hwc->config_base, ctrl_val); }static void zhaoxin_pmu_enable_event (struct perf_event *event)
arch/x86/hyperv/hv_apic.c +1 -1
@@ -49,7 +49,7 @@ static void hv_apic_icr_write(u32 low, u32 id) reg_val = reg_val <<32 ; reg_val |= low; -wrmsrl (HV_X64_MSR_ICR , reg_val); +wrmsrq (HV_X64_MSR_ICR , reg_val); }static u32 hv_apic_read (u32 reg)
arch/x86/hyperv/hv_init.c +20 -20
@@ -128,7 +128,7 @@ static int hv_cpu_init(unsigned int cpu) }if (!WARN_ON (!(*hvp))) { msr.enable =1 ; -wrmsrl (HV_X64_MSR_VP_ASSIST_PAGE , msr.as_uint64); +wrmsrq (HV_X64_MSR_VP_ASSIST_PAGE , msr.as_uint64); }return hyperv_init_ghcb ();
@@ -155,7 +155,7 @@ void hyperv_stop_tsc_emulation(void)rdmsrq (HV_X64_MSR_TSC_EMULATION_STATUS , *(u64 *)&emu_status); emu_status.inprogress =0 ; -wrmsrl (HV_X64_MSR_TSC_EMULATION_STATUS , *(u64 *)&emu_status); +wrmsrq (HV_X64_MSR_TSC_EMULATION_STATUS , *(u64 *)&emu_status);rdmsrq (HV_X64_MSR_TSC_FREQUENCY , freq); tsc_khz =div64_u64 (freq,1000 );
@@ -203,8 +203,8 @@ void set_hv_tscchange_cb(void (*cb)(void)) re_ctrl.target_vp = hv_vp_index[get_cpu ()]; -wrmsrl (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *((u64 *)&re_ctrl)); -wrmsrl (HV_X64_MSR_TSC_EMULATION_CONTROL , *((u64 *)&emu_ctrl)); +wrmsrq (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *((u64 *)&re_ctrl)); +wrmsrq (HV_X64_MSR_TSC_EMULATION_CONTROL , *((u64 *)&emu_ctrl));put_cpu (); }
@@ -219,7 +219,7 @@ void clear_hv_tscchange_cb(void)rdmsrq (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *(u64 *)&re_ctrl); re_ctrl.enabled =0 ; -wrmsrl (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *(u64 *)&re_ctrl); +wrmsrq (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *(u64 *)&re_ctrl); hv_reenlightenment_cb =NULL ; }
@@ -254,7 +254,7 @@ static int hv_cpu_die(unsigned int cpu)rdmsrq (HV_X64_MSR_VP_ASSIST_PAGE , msr.as_uint64); msr.enable =0 ; } -wrmsrl (HV_X64_MSR_VP_ASSIST_PAGE , msr.as_uint64); +wrmsrq (HV_X64_MSR_VP_ASSIST_PAGE , msr.as_uint64); }if (hv_reenlightenment_cb ==NULL )
@@ -274,7 +274,7 @@ static int hv_cpu_die(unsigned int cpu)else re_ctrl.enabled =0 ; -wrmsrl (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *((u64 *)&re_ctrl)); +wrmsrq (HV_X64_MSR_REENLIGHTENMENT_CONTROL , *((u64 *)&re_ctrl)); }return 0 ;
@@ -333,7 +333,7 @@ static int hv_suspend(void)/* Disable the hypercall page in the hypervisor */ rdmsrq (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); hypercall_msr.enable =0 ; -wrmsrl (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); +wrmsrq (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); ret =hv_cpu_die (0 );return ret;
@@ -352,7 +352,7 @@ static void hv_resume(void) hypercall_msr.enable =1 ; hypercall_msr.guest_physical_address =vmalloc_to_pfn (hv_hypercall_pg_saved); -wrmsrl (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); +wrmsrq (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); hv_hypercall_pg = hv_hypercall_pg_saved; hv_hypercall_pg_saved =NULL ;
@@ -499,7 +499,7 @@ void __init hyperv_init(void)* in such a VM and is only used in such a VM. */ guest_id =hv_generate_guest_id (LINUX_VERSION_CODE ); -wrmsrl (HV_X64_MSR_GUEST_OS_ID , guest_id); +wrmsrq (HV_X64_MSR_GUEST_OS_ID , guest_id);/* With the paravisor, the VM must also write the ID via GHCB/GHCI */ hv_ivm_msr_write (HV_X64_MSR_GUEST_OS_ID , guest_id);
@@ -532,7 +532,7 @@ void __init hyperv_init(void)* so it is populated with code, then copy the code to an * executable page. */ -wrmsrl (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); +wrmsrq (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); pg =vmalloc_to_page (hv_hypercall_pg); src = memremap(hypercall_msr.guest_physical_address << PAGE_SHIFT, PAGE_SIZE,
@@ -544,7 +544,7 @@ void __init hyperv_init(void)hv_remap_tsc_clocksource (); }else { hypercall_msr.guest_physical_address =vmalloc_to_pfn (hv_hypercall_pg); -wrmsrl (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); +wrmsrq (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); } skip_hypercall_pg_init:
@@ -608,7 +608,7 @@ void __init hyperv_init(void)return ; clean_guest_os_id: -wrmsrl (HV_X64_MSR_GUEST_OS_ID ,0 ); +wrmsrq (HV_X64_MSR_GUEST_OS_ID ,0 );hv_ivm_msr_write (HV_X64_MSR_GUEST_OS_ID ,0 );cpuhp_remove_state (CPUHP_AP_HYPERV_ONLINE ); free_ghcb_page:
@@ -629,7 +629,7 @@ void hyperv_cleanup(void)union hv_reference_tsc_msr tsc_msr;/* Reset our OS id */ -wrmsrl (HV_X64_MSR_GUEST_OS_ID ,0 ); +wrmsrq (HV_X64_MSR_GUEST_OS_ID ,0 );hv_ivm_msr_write (HV_X64_MSR_GUEST_OS_ID ,0 );/*
@@ -669,16 +669,16 @@ void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die)rdmsrq (HV_X64_MSR_GUEST_OS_ID , guest_id); -wrmsrl (HV_X64_MSR_CRASH_P0 , err); -wrmsrl (HV_X64_MSR_CRASH_P1 , guest_id); -wrmsrl (HV_X64_MSR_CRASH_P2 , regs->ip); -wrmsrl (HV_X64_MSR_CRASH_P3 , regs->ax); -wrmsrl (HV_X64_MSR_CRASH_P4 , regs->sp); +wrmsrq (HV_X64_MSR_CRASH_P0 , err); +wrmsrq (HV_X64_MSR_CRASH_P1 , guest_id); +wrmsrq (HV_X64_MSR_CRASH_P2 , regs->ip); +wrmsrq (HV_X64_MSR_CRASH_P3 , regs->ax); +wrmsrq (HV_X64_MSR_CRASH_P4 , regs->sp);/* * Let Hyper-V know there is crash data available */ -wrmsrl (HV_X64_MSR_CRASH_CTL ,HV_CRASH_CTL_CRASH_NOTIFY ); +wrmsrq (HV_X64_MSR_CRASH_CTL ,HV_CRASH_CTL_CRASH_NOTIFY ); }EXPORT_SYMBOL_GPL (hyperv_report_panic);
arch/x86/include/asm/apic.h +1 -1
@@ -230,7 +230,7 @@ static inline u32 native_apic_msr_read(u32 reg)static inline void native_x2apic_icr_write (u32 low,u32 id) { -wrmsrl (APIC_BASE_MSR + (APIC_ICR >>4 ), ((__u64 ) id) <<32 | low); +wrmsrq (APIC_BASE_MSR + (APIC_ICR >>4 ), ((__u64 ) id) <<32 | low); }static inline u64 native_x2apic_icr_read (void )
arch/x86/include/asm/debugreg.h +1 -1
@@ -180,7 +180,7 @@ static inline void update_debugctlmsr(unsigned long debugctlmsr)if (boot_cpu_data.x86 <6 )return ;#endif - wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctlmsr); + wrmsrq(MSR_IA32_DEBUGCTLMSR, debugctlmsr); }#endif /* _ASM_X86_DEBUGREG_H */
arch/x86/include/asm/fsgsbase.h +1 -1
@@ -70,7 +70,7 @@ static inline void x86_fsbase_write_cpu(unsigned long fsbase)if (boot_cpu_has (X86_FEATURE_FSGSBASE ))wrfsbase (fsbase);else -wrmsrl (MSR_FS_BASE , fsbase); +wrmsrq (MSR_FS_BASE , fsbase); }extern unsigned long x86_gsbase_read_cpu_inactive (void );
arch/x86/include/asm/msr.h +2 -2
@@ -258,7 +258,7 @@ static inline void wrmsr(u32 msr, u32 low, u32 high)#define rdmsrq (msr, val) \ ((val) = native_read_msr((msr))) -static inline void wrmsrl (u32 msr,u64 val) +static inline void wrmsrq (u32 msr,u64 val) {native_write_msr (msr, (u32)(val &0xffffffffULL ), (u32)(val >>32 )); }
@@ -357,7 +357,7 @@ static inline int rdmsrl_on_cpu(unsigned int cpu, u32 msr_no, u64 *q) }static inline int wrmsrl_on_cpu (unsigned int cpu,u32 msr_no,u64 q) { -wrmsrl (msr_no, q); +wrmsrq (msr_no, q);return 0 ; } static inline void rdmsr_on_cpus(const struct cpumask *m, u32 msr_no,
arch/x86/include/asm/paravirt.h +1 -1
@@ -214,7 +214,7 @@ do { \ val =paravirt_read_msr (msr); \ }while (0 ) -static inline void wrmsrl(unsigned msr, u64 val) +static inline void wrmsrq(unsigned msr, u64 val) {wrmsr (msr, (u32 )val, (u32)(val>>32 )); }
arch/x86/kernel/apic/apic.c +5 -5
@@ -425,7 +425,7 @@ static int lapic_next_deadline(unsigned long delta,weak_wrmsr_fence (); tsc =rdtsc (); -wrmsrl (MSR_IA32_TSC_DEADLINE , tsc + (((u64 ) delta) *TSC_DIVISOR )); +wrmsrq (MSR_IA32_TSC_DEADLINE , tsc + (((u64 ) delta) *TSC_DIVISOR ));return 0 ; }
@@ -449,7 +449,7 @@ static int lapic_timer_shutdown(struct clock_event_device *evt)* the timer _and_ zero the counter registers: */ if (v &APIC_LVT_TIMER_TSCDEADLINE ) -wrmsrl (MSR_IA32_TSC_DEADLINE ,0 ); +wrmsrq (MSR_IA32_TSC_DEADLINE ,0 );else apic_write (APIC_TMICT ,0 );
@@ -1711,8 +1711,8 @@ static void __x2apic_disable(void)if (!(msr &X2APIC_ENABLE ))return ;/* Disable xapic and x2apic first and then reenable xapic mode */ -wrmsrl (MSR_IA32_APICBASE , msr & ~(X2APIC_ENABLE |XAPIC_ENABLE )); -wrmsrl (MSR_IA32_APICBASE , msr & ~X2APIC_ENABLE ); +wrmsrq (MSR_IA32_APICBASE , msr & ~(X2APIC_ENABLE |XAPIC_ENABLE )); +wrmsrq (MSR_IA32_APICBASE , msr & ~X2APIC_ENABLE );printk_once (KERN_INFO "x2apic disabled\n" ); }
@@ -1723,7 +1723,7 @@ static void __x2apic_enable(void)rdmsrq (MSR_IA32_APICBASE , msr);if (msr &X2APIC_ENABLE )return ; -wrmsrl (MSR_IA32_APICBASE , msr |X2APIC_ENABLE ); +wrmsrq (MSR_IA32_APICBASE , msr |X2APIC_ENABLE );printk_once (KERN_INFO "x2apic enabled\n" ); }
arch/x86/kernel/cpu/bugs.c +6 -6
@@ -71,7 +71,7 @@ void (*x86_return_thunk)(void) __ro_after_init = __x86_return_thunk;static void update_spec_ctrl (u64 val) {this_cpu_write (x86_spec_ctrl_current, val); -wrmsrl (MSR_IA32_SPEC_CTRL , val); +wrmsrq (MSR_IA32_SPEC_CTRL , val); }/*
@@ -90,7 +90,7 @@ void update_spec_ctrl_cond(u64 val)* forced the update can be delayed until that time. */ if (!cpu_feature_enabled (X86_FEATURE_KERNEL_IBRS )) -wrmsrl (MSR_IA32_SPEC_CTRL , val); +wrmsrq (MSR_IA32_SPEC_CTRL , val); } noinstr u64 spec_ctrl_current(void)
@@ -228,9 +228,9 @@ static void x86_amd_ssb_disable(void)u64 msrval = x86_amd_ls_cfg_base | x86_amd_ls_cfg_ssbd_mask;if (boot_cpu_has (X86_FEATURE_VIRT_SSBD )) -wrmsrl (MSR_AMD64_VIRT_SPEC_CTRL ,SPEC_CTRL_SSBD ); +wrmsrq (MSR_AMD64_VIRT_SPEC_CTRL ,SPEC_CTRL_SSBD );else if (boot_cpu_has (X86_FEATURE_LS_CFG_SSBD )) -wrmsrl (MSR_AMD64_LS_CFG , msrval); +wrmsrq (MSR_AMD64_LS_CFG , msrval); }#undef pr_fmt
@@ -670,7 +670,7 @@ void update_srbds_msr(void)break ; } -wrmsrl (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl); +wrmsrq (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl); }static void __init srbds_select_mitigation (void )
@@ -795,7 +795,7 @@ void update_gds_msr(void)return ; } -wrmsrl (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl); +wrmsrq (MSR_IA32_MCU_OPT_CTRL , mcu_ctrl);/* * Check to make sure that the WRMSR value was not ignored. Writes to
arch/x86/kernel/cpu/bus_lock.c +3 -3
@@ -145,7 +145,7 @@ static void __init __split_lock_setup(void) }/* Restore the MSR to its cached value. */ -wrmsrl (MSR_TEST_CTRL , msr_test_ctrl_cache); +wrmsrq (MSR_TEST_CTRL , msr_test_ctrl_cache);setup_force_cpu_cap (X86_FEATURE_SPLIT_LOCK_DETECT ); }
@@ -162,7 +162,7 @@ static void sld_update_msr(bool on)if (on) test_ctrl_val |=MSR_TEST_CTRL_SPLIT_LOCK_DETECT ; -wrmsrl (MSR_TEST_CTRL , test_ctrl_val); +wrmsrq (MSR_TEST_CTRL , test_ctrl_val); }void split_lock_init (void )
@@ -311,7 +311,7 @@ void bus_lock_init(void) val |=DEBUGCTLMSR_BUS_LOCK_DETECT ; } -wrmsrl (MSR_IA32_DEBUGCTLMSR , val); +wrmsrq (MSR_IA32_DEBUGCTLMSR , val); }bool handle_user_split_lock (struct pt_regs *regs,long error_code)
arch/x86/kernel/cpu/common.c +17 -17
@@ -564,7 +564,7 @@ __noendbr u64 ibt_save(bool disable)if (cpu_feature_enabled (X86_FEATURE_IBT )) {rdmsrq (MSR_IA32_S_CET , msr);if (disable) -wrmsrl (MSR_IA32_S_CET , msr & ~CET_ENDBR_EN ); +wrmsrq (MSR_IA32_S_CET , msr & ~CET_ENDBR_EN ); }return msr;
@@ -578,7 +578,7 @@ __noendbr void ibt_restore(u64 save)rdmsrq (MSR_IA32_S_CET , msr); msr &= ~CET_ENDBR_EN ; msr |= (save &CET_ENDBR_EN ); -wrmsrl (MSR_IA32_S_CET , msr); +wrmsrq (MSR_IA32_S_CET , msr); } }
@@ -602,15 +602,15 @@ static __always_inline void setup_cet(struct cpuinfo_x86 *c)set_cpu_cap (c,X86_FEATURE_USER_SHSTK );if (kernel_ibt) -wrmsrl (MSR_IA32_S_CET ,CET_ENDBR_EN ); +wrmsrq (MSR_IA32_S_CET ,CET_ENDBR_EN );else -wrmsrl (MSR_IA32_S_CET ,0 ); +wrmsrq (MSR_IA32_S_CET ,0 );cr4_set_bits (X86_CR4_CET );if (kernel_ibt &&ibt_selftest ()) {pr_err ("IBT selftest: Failed!\n" ); -wrmsrl (MSR_IA32_S_CET ,0 ); +wrmsrq (MSR_IA32_S_CET ,0 );setup_clear_cpu_cap (X86_FEATURE_IBT ); } }
@@ -621,8 +621,8 @@ __noendbr void cet_disable(void) cpu_feature_enabled(X86_FEATURE_SHSTK)))return ; -wrmsrl (MSR_IA32_S_CET ,0 ); -wrmsrl (MSR_IA32_U_CET ,0 ); +wrmsrq (MSR_IA32_S_CET ,0 ); +wrmsrq (MSR_IA32_U_CET ,0 ); }/*
@@ -751,9 +751,9 @@ void __init switch_gdt_and_percpu_base(int cpu)* No need to load %gs. It is already correct. * * Writing %gs on 64bit would zero GSBASE which would make any per -* CPU operation up to the point of the wrmsrl() fault. +* CPU operation up to the point of the wrmsrq() fault. * -* Set GSBASE to the new offset. Until the wrmsrl() happens the +* Set GSBASE to the new offset. Until the wrmsrq() happens the * early mapping is still valid. That means the GSBASE update will * lose any prior per CPU data which was not copied over in * setup_per_cpu_areas().
@@ -761,7 +761,7 @@ void __init switch_gdt_and_percpu_base(int cpu)* This works even with stackprotector enabled because the * per CPU stack canary is 0 in both per CPU areas. */ -wrmsrl (MSR_GS_BASE ,cpu_kernelmode_gs_base (cpu)); +wrmsrq (MSR_GS_BASE ,cpu_kernelmode_gs_base (cpu));#else /* * %fs is already set to __KERNEL_PERCPU, but after switching GDT
@@ -1750,10 +1750,10 @@ static bool detect_null_seg_behavior(void)unsigned long old_base, tmp;rdmsrq (MSR_FS_BASE , old_base); -wrmsrl (MSR_FS_BASE ,1 ); +wrmsrq (MSR_FS_BASE ,1 );loadsegment (fs,0 );rdmsrq (MSR_FS_BASE , tmp); -wrmsrl (MSR_FS_BASE , old_base); +wrmsrq (MSR_FS_BASE , old_base);return tmp ==0 ; }
@@ -2099,12 +2099,12 @@ static void wrmsrl_cstar(unsigned long val)* guest. Avoid the pointless write on all Intel CPUs. */ if (boot_cpu_data.x86_vendor !=X86_VENDOR_INTEL ) -wrmsrl (MSR_CSTAR , val); +wrmsrq (MSR_CSTAR , val); }static inline void idt_syscall_init (void ) { -wrmsrl (MSR_LSTAR , (unsigned long )entry_SYSCALL_64); +wrmsrq (MSR_LSTAR , (unsigned long )entry_SYSCALL_64);if (ia32_enabled ()) {wrmsrl_cstar ((unsigned long )entry_SYSCALL_compat);
@@ -2129,7 +2129,7 @@ static inline void idt_syscall_init(void)* Flags to clear on syscall; clear as much as possible * to minimize user space-kernel interference. */ - wrmsrl(MSR_SYSCALL_MASK, + wrmsrq(MSR_SYSCALL_MASK, X86_EFLAGS_CF|X86_EFLAGS_PF|X86_EFLAGS_AF| X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_TF| X86_EFLAGS_IF|X86_EFLAGS_DF|X86_EFLAGS_OF|
@@ -2313,8 +2313,8 @@ void cpu_init(void)memset (cur->thread.tls_array,0 ,GDT_ENTRY_TLS_ENTRIES *8 );syscall_init (); -wrmsrl (MSR_FS_BASE ,0 ); -wrmsrl (MSR_KERNEL_GS_BASE ,0 ); +wrmsrq (MSR_FS_BASE ,0 ); +wrmsrq (MSR_KERNEL_GS_BASE ,0 );barrier ();x2apic_setup ();
arch/x86/kernel/cpu/feat_ctl.c +1 -1
@@ -165,7 +165,7 @@ void init_ia32_feat_ctl(struct cpuinfo_x86 *c) msr |=FEAT_CTL_SGX_LC_ENABLED ; } -wrmsrl (MSR_IA32_FEAT_CTL , msr); +wrmsrq (MSR_IA32_FEAT_CTL , msr); update_caps:set_cpu_cap (c,X86_FEATURE_MSR_IA32_FEAT_CTL );
arch/x86/kernel/cpu/intel.c +1 -1
@@ -509,7 +509,7 @@ static void init_intel_misc_features(struct cpuinfo_x86 *c)probe_xeon_phi_r3mwait (c); msr =this_cpu_read (msr_misc_features_shadow); -wrmsrl (MSR_MISC_FEATURES_ENABLES , msr); +wrmsrq (MSR_MISC_FEATURES_ENABLES , msr); }/*
arch/x86/kernel/cpu/intel_epb.c +1 -1
@@ -111,7 +111,7 @@ static void intel_epb_restore(void)pr_warn_once ("ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n" ); } } -wrmsrl (MSR_IA32_ENERGY_PERF_BIAS , (epb & ~EPB_MASK ) | val); +wrmsrq (MSR_IA32_ENERGY_PERF_BIAS , (epb & ~EPB_MASK ) | val); }static struct syscore_ops intel_epb_syscore_ops = {
arch/x86/kernel/cpu/mce/amd.c +4 -4
@@ -667,7 +667,7 @@ static void disable_err_thresholding(struct cpuinfo_x86 *c, unsigned int bank)/* McStatusWrEn has to be set */ need_toggle = !(hwcr &BIT (18 ));if (need_toggle) -wrmsrl (MSR_K7_HWCR , hwcr |BIT (18 )); +wrmsrq (MSR_K7_HWCR , hwcr |BIT (18 ));/* Clear CntP bit safely */ for (i =0 ; i < num_msrs; i++)
@@ -675,7 +675,7 @@ static void disable_err_thresholding(struct cpuinfo_x86 *c, unsigned int bank)/* restore old settings */ if (need_toggle) -wrmsrl (MSR_K7_HWCR , hwcr); +wrmsrq (MSR_K7_HWCR , hwcr); }/* cpu init entry point, called from mce.c with preempt off */
@@ -843,7 +843,7 @@ _log_error_bank(unsigned int bank, u32 msr_stat, u32 msr_addr, u64 misc)__log_error (bank, status, addr, misc); -wrmsrl (msr_stat,0 ); +wrmsrq (msr_stat,0 );return status &MCI_STATUS_DEFERRED ; }
@@ -862,7 +862,7 @@ static bool _log_error_deferred(unsigned int bank, u32 misc)return true;/* Clear MCA_DESTAT if the deferred error was logged from MCA_STATUS. */ -wrmsrl (MSR_AMD64_SMCA_MCx_DESTAT (bank),0 ); +wrmsrq (MSR_AMD64_SMCA_MCx_DESTAT (bank),0 );return true; }
arch/x86/kernel/cpu/mce/core.c +4 -4
@@ -1878,8 +1878,8 @@ static void __mcheck_cpu_init_clear_banks(void)if (!b->init)continue ; -wrmsrl (mca_msr_reg (i,MCA_CTL ), b->ctl); -wrmsrl (mca_msr_reg (i,MCA_STATUS ),0 ); +wrmsrq (mca_msr_reg (i,MCA_CTL ), b->ctl); +wrmsrq (mca_msr_reg (i,MCA_STATUS ),0 ); } }
@@ -2436,7 +2436,7 @@ static void mce_disable_error_reporting(void)struct mce_bank *b = &mce_banks[i];if (b->init) -wrmsrl (mca_msr_reg (i,MCA_CTL ),0 ); +wrmsrq (mca_msr_reg (i,MCA_CTL ),0 ); }return ; }
@@ -2786,7 +2786,7 @@ static void mce_reenable_cpu(void)struct mce_bank *b = &mce_banks[i];if (b->init) -wrmsrl (mca_msr_reg (i,MCA_CTL ), b->ctl); +wrmsrq (mca_msr_reg (i,MCA_CTL ), b->ctl); } }
arch/x86/kernel/cpu/mce/inject.c +10 -10
@@ -475,27 +475,27 @@ static void prepare_msrs(void *info)struct mce m = *(struct mce *)info;u8 b = m.bank; -wrmsrl (MSR_IA32_MCG_STATUS , m.mcgstatus); +wrmsrq (MSR_IA32_MCG_STATUS , m.mcgstatus);if (boot_cpu_has (X86_FEATURE_SMCA )) {if (m.inject_flags ==DFR_INT_INJ ) { -wrmsrl (MSR_AMD64_SMCA_MCx_DESTAT (b), m.status); -wrmsrl (MSR_AMD64_SMCA_MCx_DEADDR (b), m.addr); +wrmsrq (MSR_AMD64_SMCA_MCx_DESTAT (b), m.status); +wrmsrq (MSR_AMD64_SMCA_MCx_DEADDR (b), m.addr); }else { -wrmsrl (MSR_AMD64_SMCA_MCx_STATUS (b), m.status); -wrmsrl (MSR_AMD64_SMCA_MCx_ADDR (b), m.addr); +wrmsrq (MSR_AMD64_SMCA_MCx_STATUS (b), m.status); +wrmsrq (MSR_AMD64_SMCA_MCx_ADDR (b), m.addr); } -wrmsrl (MSR_AMD64_SMCA_MCx_SYND (b), m.synd); +wrmsrq (MSR_AMD64_SMCA_MCx_SYND (b), m.synd);if (m.misc) -wrmsrl (MSR_AMD64_SMCA_MCx_MISC (b), m.misc); +wrmsrq (MSR_AMD64_SMCA_MCx_MISC (b), m.misc); }else { -wrmsrl (MSR_IA32_MCx_STATUS (b), m.status); -wrmsrl (MSR_IA32_MCx_ADDR (b), m.addr); +wrmsrq (MSR_IA32_MCx_STATUS (b), m.status); +wrmsrq (MSR_IA32_MCx_ADDR (b), m.addr);if (m.misc) -wrmsrl (MSR_IA32_MCx_MISC (b), m.misc); +wrmsrq (MSR_IA32_MCx_MISC (b), m.misc); } }
arch/x86/kernel/cpu/mce/intel.c +5 -5
@@ -143,7 +143,7 @@ static void cmci_set_threshold(int bank, int thresh)raw_spin_lock_irqsave (&cmci_discover_lock, flags);rdmsrq (MSR_IA32_MCx_CTL2 (bank), val); val &= ~MCI_CTL2_CMCI_THRESHOLD_MASK ; -wrmsrl (MSR_IA32_MCx_CTL2 (bank), val | thresh); +wrmsrq (MSR_IA32_MCx_CTL2 (bank), val | thresh);raw_spin_unlock_irqrestore (&cmci_discover_lock, flags); }
@@ -232,7 +232,7 @@ static void cmci_claim_bank(int bank, u64 val, int bios_zero_thresh, int *bios_wstruct mca_storm_desc *storm =this_cpu_ptr (&storm_desc); val |=MCI_CTL2_CMCI_EN ; -wrmsrl (MSR_IA32_MCx_CTL2 (bank), val); +wrmsrq (MSR_IA32_MCx_CTL2 (bank), val);rdmsrq (MSR_IA32_MCx_CTL2 (bank), val);/* If the enable bit did not stick, this bank should be polled. */
@@ -326,7 +326,7 @@ static void __cmci_disable_bank(int bank)return ;rdmsrq (MSR_IA32_MCx_CTL2 (bank), val); val &= ~MCI_CTL2_CMCI_EN ; -wrmsrl (MSR_IA32_MCx_CTL2 (bank), val); +wrmsrq (MSR_IA32_MCx_CTL2 (bank), val);__clear_bit (bank,this_cpu_ptr (mce_banks_owned));if ((val &MCI_CTL2_CMCI_THRESHOLD_MASK ) ==CMCI_STORM_THRESHOLD )
@@ -433,7 +433,7 @@ void intel_init_lmce(void)rdmsrq (MSR_IA32_MCG_EXT_CTL , val);if (!(val &MCG_EXT_CTL_LMCE_EN )) -wrmsrl (MSR_IA32_MCG_EXT_CTL , val |MCG_EXT_CTL_LMCE_EN ); +wrmsrq (MSR_IA32_MCG_EXT_CTL , val |MCG_EXT_CTL_LMCE_EN ); }void intel_clear_lmce (void )
@@ -445,7 +445,7 @@ void intel_clear_lmce(void)rdmsrq (MSR_IA32_MCG_EXT_CTL , val); val &= ~MCG_EXT_CTL_LMCE_EN ; -wrmsrl (MSR_IA32_MCG_EXT_CTL , val); +wrmsrq (MSR_IA32_MCG_EXT_CTL , val); }/*
arch/x86/kernel/cpu/mshyperv.c +3 -3
@@ -82,9 +82,9 @@ void hv_set_non_nested_msr(unsigned int reg, u64 value)/* Write proxy bit via wrmsl instruction */ if (hv_is_sint_msr (reg)) -wrmsrl (reg, value |1 <<20 ); +wrmsrq (reg, value |1 <<20 ); }else { -wrmsrl (reg, value); +wrmsrq (reg, value); } }EXPORT_SYMBOL_GPL (hv_set_non_nested_msr);
@@ -574,7 +574,7 @@ static void __init ms_hyperv_init_platform(void)* setting of this MSR bit should happen before init_intel() * is called. */ -wrmsrl (HV_X64_MSR_TSC_INVARIANT_CONTROL ,HV_EXPOSE_INVARIANT_TSC ); +wrmsrq (HV_X64_MSR_TSC_INVARIANT_CONTROL ,HV_EXPOSE_INVARIANT_TSC );setup_force_cpu_cap (X86_FEATURE_TSC_RELIABLE ); }
arch/x86/kernel/cpu/resctrl/core.c +3 -3
@@ -309,7 +309,7 @@ static void mba_wrmsr_amd(struct msr_param *m)unsigned int i;for (i = m->low; i < m->high; i++) -wrmsrl (hw_res->msr_base + i, hw_dom->ctrl_val[i]); +wrmsrq (hw_res->msr_base + i, hw_dom->ctrl_val[i]); }/*
@@ -334,7 +334,7 @@ static void mba_wrmsr_intel(struct msr_param *m)/* Write the delay values for mba. */ for (i = m->low; i < m->high; i++) -wrmsrl (hw_res->msr_base + i,delay_bw_map (hw_dom->ctrl_val[i], m->res)); +wrmsrq (hw_res->msr_base + i,delay_bw_map (hw_dom->ctrl_val[i], m->res)); }static void cat_wrmsr (struct msr_param *m)
@@ -344,7 +344,7 @@ static void cat_wrmsr(struct msr_param *m)unsigned int i;for (i = m->low; i < m->high; i++) -wrmsrl (hw_res->msr_base + i, hw_dom->ctrl_val[i]); +wrmsrq (hw_res->msr_base + i, hw_dom->ctrl_val[i]); }u32 resctrl_arch_get_num_closid (struct rdt_resource *r)
arch/x86/kernel/cpu/resctrl/pseudo_lock.c +1 -1
@@ -534,7 +534,7 @@ int resctrl_arch_pseudo_lock_fn(void *_plr)__wrmsr (MSR_IA32_PQR_ASSOC , rmid_p, closid_p);/* Re-enable the hardware prefetcher(s) */ -wrmsrl (MSR_MISC_FEATURE_CONTROL , saved_msr); +wrmsrq (MSR_MISC_FEATURE_CONTROL , saved_msr);local_irq_enable (); plr->thread_done =1 ;
arch/x86/kernel/cpu/resctrl/rdtgroup.c +2 -2
@@ -2326,14 +2326,14 @@ static void l3_qos_cfg_update(void *arg) {bool *enable = arg; -wrmsrl (MSR_IA32_L3_QOS_CFG , *enable ?L3_QOS_CDP_ENABLE :0ULL ); +wrmsrq (MSR_IA32_L3_QOS_CFG , *enable ?L3_QOS_CDP_ENABLE :0ULL ); }static void l2_qos_cfg_update (void *arg) {bool *enable = arg; -wrmsrl (MSR_IA32_L2_QOS_CFG , *enable ?L2_QOS_CDP_ENABLE :0ULL ); +wrmsrq (MSR_IA32_L2_QOS_CFG , *enable ?L2_QOS_CDP_ENABLE :0ULL ); }static inline bool is_mba_linear (void )
arch/x86/kernel/cpu/sgx/main.c +1 -1
@@ -871,7 +871,7 @@ void sgx_update_lepubkeyhash(u64 *lepubkeyhash)WARN_ON_ONCE (preemptible ());for (i =0 ; i <4 ; i++) -wrmsrl (MSR_IA32_SGXLEPUBKEYHASH0 + i, lepubkeyhash[i]); +wrmsrq (MSR_IA32_SGXLEPUBKEYHASH0 + i, lepubkeyhash[i]); }const struct file_operations sgx_provision_fops = {
arch/x86/kernel/cpu/tsx.c +5 -5
@@ -37,7 +37,7 @@ static void tsx_disable(void)*/ tsx |=TSX_CTRL_CPUID_CLEAR ; -wrmsrl (MSR_IA32_TSX_CTRL , tsx); +wrmsrq (MSR_IA32_TSX_CTRL , tsx); }static void tsx_enable (void )
@@ -56,7 +56,7 @@ static void tsx_enable(void)*/ tsx &= ~TSX_CTRL_CPUID_CLEAR ; -wrmsrl (MSR_IA32_TSX_CTRL , tsx); +wrmsrq (MSR_IA32_TSX_CTRL , tsx); }static enum tsx_ctrl_states x86_get_tsx_auto_mode (void )
@@ -117,11 +117,11 @@ static void tsx_clear_cpuid(void) boot_cpu_has(X86_FEATURE_TSX_FORCE_ABORT)) {rdmsrq (MSR_TSX_FORCE_ABORT , msr); msr |=MSR_TFA_TSX_CPUID_CLEAR ; -wrmsrl (MSR_TSX_FORCE_ABORT , msr); +wrmsrq (MSR_TSX_FORCE_ABORT , msr); } else if (cpu_feature_enabled(X86_FEATURE_MSR_TSX_CTRL)) {rdmsrq (MSR_IA32_TSX_CTRL , msr); msr |=TSX_CTRL_CPUID_CLEAR ; -wrmsrl (MSR_IA32_TSX_CTRL , msr); +wrmsrq (MSR_IA32_TSX_CTRL , msr); } }
@@ -150,7 +150,7 @@ static void tsx_dev_mode_disable(void)if (mcu_opt_ctrl &RTM_ALLOW ) { mcu_opt_ctrl &= ~RTM_ALLOW ; -wrmsrl (MSR_IA32_MCU_OPT_CTRL , mcu_opt_ctrl); +wrmsrq (MSR_IA32_MCU_OPT_CTRL , mcu_opt_ctrl);setup_force_cpu_cap (X86_FEATURE_RTM_ALWAYS_ABORT ); } }
arch/x86/kernel/fpu/xstate.c +5 -5
@@ -199,7 +199,7 @@ void fpu__init_cpu_xstate(void)* MSR_IA32_XSS sets supervisor states managed by XSAVES. */ if (boot_cpu_has (X86_FEATURE_XSAVES )) { -wrmsrl (MSR_IA32_XSS ,xfeatures_mask_supervisor () | +wrmsrq (MSR_IA32_XSS ,xfeatures_mask_supervisor () |xfeatures_mask_independent ()); } }
@@ -639,7 +639,7 @@ static unsigned int __init get_xsave_compacted_size(void)return get_compacted_size ();/* Disable independent features. */ -wrmsrl (MSR_IA32_XSS ,xfeatures_mask_supervisor ()); +wrmsrq (MSR_IA32_XSS ,xfeatures_mask_supervisor ());/* * Ask the hardware what size is required of the buffer.
@@ -648,7 +648,7 @@ static unsigned int __init get_xsave_compacted_size(void) size =get_compacted_size ();/* Re-enable independent features so XSAVES will work on them again. */ -wrmsrl (MSR_IA32_XSS ,xfeatures_mask_supervisor () | mask); +wrmsrq (MSR_IA32_XSS ,xfeatures_mask_supervisor () | mask);return size; }
@@ -904,12 +904,12 @@ void fpu__resume_cpu(void)* of XSAVES and MSR_IA32_XSS. */ if (cpu_feature_enabled (X86_FEATURE_XSAVES )) { -wrmsrl (MSR_IA32_XSS ,xfeatures_mask_supervisor () | +wrmsrq (MSR_IA32_XSS ,xfeatures_mask_supervisor () |xfeatures_mask_independent ()); }if (fpu_state_size_dynamic ()) -wrmsrl (MSR_IA32_XFD , current->thread.fpu.fpstate->xfd); +wrmsrq (MSR_IA32_XFD , current->thread.fpu.fpstate->xfd); }/*
arch/x86/kernel/fpu/xstate.h +1 -1
@@ -171,7 +171,7 @@ static inline void xfd_validate_state(struct fpstate *fpstate, u64 mask, bool rs#ifdef CONFIG_X86_64 static inline void xfd_set_state (u64 xfd) { -wrmsrl (MSR_IA32_XFD , xfd); +wrmsrq (MSR_IA32_XFD , xfd);__this_cpu_write (xfd_state, xfd); }
arch/x86/kernel/fred.c +10 -10
@@ -43,23 +43,23 @@ void cpu_init_fred_exceptions(void)*/ loadsegment (ss, __KERNEL_DS); -wrmsrl (MSR_IA32_FRED_CONFIG , +wrmsrq (MSR_IA32_FRED_CONFIG ,/* Reserve for CALL emulation */ FRED_CONFIG_REDZONE |FRED_CONFIG_INT_STKLVL (0 ) |FRED_CONFIG_ENTRYPOINT (asm_fred_entrypoint_user)); -wrmsrl (MSR_IA32_FRED_STKLVLS ,0 ); +wrmsrq (MSR_IA32_FRED_STKLVLS ,0 );/* * Ater a CPU offline/online cycle, the FRED RSP0 MSR should be * resynchronized with its per-CPU cache. */ -wrmsrl (MSR_IA32_FRED_RSP0 ,__this_cpu_read (fred_rsp0)); +wrmsrq (MSR_IA32_FRED_RSP0 ,__this_cpu_read (fred_rsp0)); -wrmsrl (MSR_IA32_FRED_RSP1 ,0 ); -wrmsrl (MSR_IA32_FRED_RSP2 ,0 ); -wrmsrl (MSR_IA32_FRED_RSP3 ,0 ); +wrmsrq (MSR_IA32_FRED_RSP1 ,0 ); +wrmsrq (MSR_IA32_FRED_RSP2 ,0 ); +wrmsrq (MSR_IA32_FRED_RSP3 ,0 );/* Enable FRED */ cr4_set_bits (X86_CR4_FRED );
@@ -79,14 +79,14 @@ void cpu_init_fred_rsps(void)* (remember that user space faults are always taken on stack level 0) * is to avoid overflowing the kernel stack. */ -wrmsrl (MSR_IA32_FRED_STKLVLS , +wrmsrq (MSR_IA32_FRED_STKLVLS ,FRED_STKLVL (X86_TRAP_DB ,FRED_DB_STACK_LEVEL ) |FRED_STKLVL (X86_TRAP_NMI ,FRED_NMI_STACK_LEVEL ) |FRED_STKLVL (X86_TRAP_MC ,FRED_MC_STACK_LEVEL ) |FRED_STKLVL (X86_TRAP_DF ,FRED_DF_STACK_LEVEL ));/* The FRED equivalents to IST stacks... */ -wrmsrl (MSR_IA32_FRED_RSP1 ,__this_cpu_ist_top_va (DB )); -wrmsrl (MSR_IA32_FRED_RSP2 ,__this_cpu_ist_top_va (NMI )); -wrmsrl (MSR_IA32_FRED_RSP3 ,__this_cpu_ist_top_va (DF )); +wrmsrq (MSR_IA32_FRED_RSP1 ,__this_cpu_ist_top_va (DB )); +wrmsrq (MSR_IA32_FRED_RSP2 ,__this_cpu_ist_top_va (NMI )); +wrmsrq (MSR_IA32_FRED_RSP3 ,__this_cpu_ist_top_va (DF )); }
arch/x86/kernel/kvm.c +13 -13
@@ -301,7 +301,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_kvm_asyncpf_interrupt) token =__this_cpu_read (apf_reason.token);kvm_async_pf_task_wake (token);__this_cpu_write (apf_reason.token,0 ); -wrmsrl (MSR_KVM_ASYNC_PF_ACK ,1 ); +wrmsrq (MSR_KVM_ASYNC_PF_ACK ,1 ); }set_irq_regs (old_regs);
@@ -327,7 +327,7 @@ static void kvm_register_steal_time(void)if (!has_steal_clock)return ; -wrmsrl (MSR_KVM_STEAL_TIME , (slow_virt_to_phys (st) |KVM_MSR_ENABLED )); +wrmsrq (MSR_KVM_STEAL_TIME , (slow_virt_to_phys (st) |KVM_MSR_ENABLED ));pr_debug ("stealtime: cpu %d, msr %llx\n" , cpu, (unsigned long long )slow_virt_to_phys (st)); }
@@ -361,9 +361,9 @@ static void kvm_guest_cpu_init(void)if (kvm_para_has_feature (KVM_FEATURE_ASYNC_PF_VMEXIT )) pa |=KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT ; -wrmsrl (MSR_KVM_ASYNC_PF_INT ,HYPERVISOR_CALLBACK_VECTOR ); +wrmsrq (MSR_KVM_ASYNC_PF_INT ,HYPERVISOR_CALLBACK_VECTOR ); -wrmsrl (MSR_KVM_ASYNC_PF_EN , pa); +wrmsrq (MSR_KVM_ASYNC_PF_EN , pa);__this_cpu_write (async_pf_enabled, true);pr_debug ("setup async PF for cpu %d\n" ,smp_processor_id ()); }
@@ -376,7 +376,7 @@ static void kvm_guest_cpu_init(void)__this_cpu_write (kvm_apic_eoi,0 ); pa =slow_virt_to_phys (this_cpu_ptr (&kvm_apic_eoi)) |KVM_MSR_ENABLED ; -wrmsrl (MSR_KVM_PV_EOI_EN , pa); +wrmsrq (MSR_KVM_PV_EOI_EN , pa); }if (has_steal_clock)
@@ -388,7 +388,7 @@ static void kvm_pv_disable_apf(void)if (!__this_cpu_read (async_pf_enabled))return ; -wrmsrl (MSR_KVM_ASYNC_PF_EN ,0 ); +wrmsrq (MSR_KVM_ASYNC_PF_EN ,0 );__this_cpu_write (async_pf_enabled, false);pr_debug ("disable async PF for cpu %d\n" ,smp_processor_id ());
@@ -451,9 +451,9 @@ static void kvm_guest_cpu_offline(bool shutdown) {kvm_disable_steal_time ();if (kvm_para_has_feature (KVM_FEATURE_PV_EOI )) -wrmsrl (MSR_KVM_PV_EOI_EN ,0 ); +wrmsrq (MSR_KVM_PV_EOI_EN ,0 );if (kvm_para_has_feature (KVM_FEATURE_MIGRATION_CONTROL )) -wrmsrl (MSR_KVM_MIGRATION_CONTROL ,0 ); +wrmsrq (MSR_KVM_MIGRATION_CONTROL ,0 );kvm_pv_disable_apf ();if (!shutdown)apf_task_wake_all ();
@@ -615,7 +615,7 @@ static int __init setup_efi_kvm_sev_migration(void) }pr_info ("%s : live migration enabled in EFI\n" , __func__); -wrmsrl (MSR_KVM_MIGRATION_CONTROL ,KVM_MIGRATION_READY ); +wrmsrq (MSR_KVM_MIGRATION_CONTROL ,KVM_MIGRATION_READY );return 1 ; }
@@ -740,7 +740,7 @@ static void kvm_resume(void)#ifdef CONFIG_ARCH_CPUIDLE_HALTPOLL if (kvm_para_has_feature (KVM_FEATURE_POLL_CONTROL ) && has_guest_poll) -wrmsrl (MSR_KVM_POLL_CONTROL ,0 ); +wrmsrq (MSR_KVM_POLL_CONTROL ,0 );#endif }
@@ -975,7 +975,7 @@ static void __init kvm_init_platform(void)* If not booted using EFI, enable Live migration support. */ if (!efi_enabled (EFI_BOOT )) -wrmsrl (MSR_KVM_MIGRATION_CONTROL , +wrmsrq (MSR_KVM_MIGRATION_CONTROL ,KVM_MIGRATION_READY ); }kvmclock_init ();
@@ -1124,12 +1124,12 @@ void __init kvm_spinlock_init(void)static void kvm_disable_host_haltpoll (void *i) { -wrmsrl (MSR_KVM_POLL_CONTROL ,0 ); +wrmsrq (MSR_KVM_POLL_CONTROL ,0 ); }static void kvm_enable_host_haltpoll (void *i) { -wrmsrl (MSR_KVM_POLL_CONTROL ,1 ); +wrmsrq (MSR_KVM_POLL_CONTROL ,1 ); }void arch_haltpoll_enable (unsigned int cpu)
arch/x86/kernel/kvmclock.c +2 -2
@@ -60,7 +60,7 @@ EXPORT_PER_CPU_SYMBOL_GPL(hv_clock_per_cpu);*/ static void kvm_get_wallclock (struct timespec64 *now) { -wrmsrl (msr_kvm_wall_clock,slow_virt_to_phys (&wall_clock)); +wrmsrq (msr_kvm_wall_clock,slow_virt_to_phys (&wall_clock));preempt_disable ();pvclock_read_wallclock (&wall_clock,this_cpu_pvti (), now);preempt_enable ();
@@ -173,7 +173,7 @@ static void kvm_register_clock(char *txt)return ; pa =slow_virt_to_phys (&src->pvti) |0x01ULL ; -wrmsrl (msr_kvm_system_time, pa); +wrmsrq (msr_kvm_system_time, pa);pr_debug ("kvm-clock: cpu %d, msr %llx, %s" ,smp_processor_id (), pa, txt); }
arch/x86/kernel/mmconf-fam10h_64.c +1 -1
@@ -212,7 +212,7 @@ void fam10h_check_enable_mmcfg(void) (FAM10H_MMIO_CONF_BUSRANGE_MASK<<FAM10H_MMIO_CONF_BUSRANGE_SHIFT)); val |= fam10h_pci_mmconf_base | (8 <<FAM10H_MMIO_CONF_BUSRANGE_SHIFT ) |FAM10H_MMIO_CONF_ENABLE ; -wrmsrl (address, val); +wrmsrq (address, val); }static int __init set_check_enable_amd_mmconf (const struct dmi_system_id *d)
arch/x86/kernel/process.c +7 -7
@@ -344,7 +344,7 @@ static void set_cpuid_faulting(bool on) msrval &= ~MSR_MISC_FEATURES_ENABLES_CPUID_FAULT ; msrval |= (on <<MSR_MISC_FEATURES_ENABLES_CPUID_FAULT_BIT );this_cpu_write (msr_misc_features_shadow, msrval); -wrmsrl (MSR_MISC_FEATURES_ENABLES , msrval); +wrmsrq (MSR_MISC_FEATURES_ENABLES , msrval); }static void disable_cpuid (void )
@@ -561,7 +561,7 @@ static __always_inline void amd_set_core_ssb_state(unsigned long tifn)if (!static_cpu_has (X86_FEATURE_ZEN )) { msr |=ssbd_tif_to_amd_ls_cfg (tifn); -wrmsrl (MSR_AMD64_LS_CFG , msr); +wrmsrq (MSR_AMD64_LS_CFG , msr);return ; }
@@ -578,7 +578,7 @@ static __always_inline void amd_set_core_ssb_state(unsigned long tifn)raw_spin_lock (&st->shared_state->lock);/* First sibling enables SSBD: */ if (!st->shared_state->disable_state) -wrmsrl (MSR_AMD64_LS_CFG , msr); +wrmsrq (MSR_AMD64_LS_CFG , msr); st->shared_state->disable_state++;raw_spin_unlock (&st->shared_state->lock); }else {
@@ -588,7 +588,7 @@ static __always_inline void amd_set_core_ssb_state(unsigned long tifn)raw_spin_lock (&st->shared_state->lock); st->shared_state->disable_state--;if (!st->shared_state->disable_state) -wrmsrl (MSR_AMD64_LS_CFG , msr); +wrmsrq (MSR_AMD64_LS_CFG , msr);raw_spin_unlock (&st->shared_state->lock); } }
@@ -597,7 +597,7 @@ static __always_inline void amd_set_core_ssb_state(unsigned long tifn) {u64 msr = x86_amd_ls_cfg_base |ssbd_tif_to_amd_ls_cfg (tifn); -wrmsrl (MSR_AMD64_LS_CFG , msr); +wrmsrq (MSR_AMD64_LS_CFG , msr); }#endif
@@ -607,7 +607,7 @@ static __always_inline void amd_set_ssb_virt_state(unsigned long tifn)* SSBD has the same definition in SPEC_CTRL and VIRT_SPEC_CTRL, * so ssbd_tif_to_spec_ctrl() just works. */ -wrmsrl (MSR_AMD64_VIRT_SPEC_CTRL ,ssbd_tif_to_spec_ctrl (tifn)); +wrmsrq (MSR_AMD64_VIRT_SPEC_CTRL ,ssbd_tif_to_spec_ctrl (tifn)); }/*
@@ -714,7 +714,7 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p) debugctl &= ~DEBUGCTLMSR_BTF ; msk = tifn & _TIF_BLOCKSTEP; debugctl |= (msk >>TIF_BLOCKSTEP ) <<DEBUGCTLMSR_BTF_SHIFT ; -wrmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); +wrmsrq (MSR_IA32_DEBUGCTLMSR , debugctl); }if ((tifp ^ tifn) & _TIF_NOTSC)
arch/x86/kernel/process_64.c +3 -3
@@ -221,7 +221,7 @@ static noinstr void __wrgsbase_inactive(unsigned long gsbase)native_swapgs (); }else {instrumentation_begin (); -wrmsrl (MSR_KERNEL_GS_BASE , gsbase); +wrmsrq (MSR_KERNEL_GS_BASE , gsbase);instrumentation_end (); } }
@@ -353,7 +353,7 @@ static __always_inline void load_seg_legacy(unsigned short prev_index, }else {if (prev_index != next_index)loadseg (which, next_index); -wrmsrl (which ==FS ?MSR_FS_BASE :MSR_KERNEL_GS_BASE , +wrmsrq (which ==FS ?MSR_FS_BASE :MSR_KERNEL_GS_BASE , next_base); } }else {
@@ -478,7 +478,7 @@ void x86_gsbase_write_cpu_inactive(unsigned long gsbase)__wrgsbase_inactive (gsbase);local_irq_restore (flags); }else { -wrmsrl (MSR_KERNEL_GS_BASE , gsbase); +wrmsrq (MSR_KERNEL_GS_BASE , gsbase); } }
arch/x86/kernel/reboot_fixups_32.c +1 -1
@@ -27,7 +27,7 @@ static void cs5530a_warm_reset(struct pci_dev *dev)static void cs5536_warm_reset (struct pci_dev *dev) {/* writing 1 to the LSB of this MSR causes a hard reset */ -wrmsrl (MSR_DIVIL_SOFT_RESET ,1ULL ); +wrmsrq (MSR_DIVIL_SOFT_RESET ,1ULL );udelay (50 );/* shouldn't get here but be safe and spin a while */ }
arch/x86/kernel/shstk.c +7 -7
@@ -173,8 +173,8 @@ static int shstk_setup(void)return PTR_ERR ((void *)addr);fpregs_lock_and_load (); -wrmsrl (MSR_IA32_PL3_SSP , addr + size); -wrmsrl (MSR_IA32_U_CET ,CET_SHSTK_EN ); +wrmsrq (MSR_IA32_PL3_SSP , addr + size); +wrmsrq (MSR_IA32_U_CET ,CET_SHSTK_EN );fpregs_unlock (); shstk->base = addr;
@@ -372,7 +372,7 @@ int setup_signal_shadow_stack(struct ksignal *ksig)return -EFAULT ;fpregs_lock_and_load (); -wrmsrl (MSR_IA32_PL3_SSP , ssp); +wrmsrq (MSR_IA32_PL3_SSP , ssp);fpregs_unlock ();return 0 ;
@@ -396,7 +396,7 @@ int restore_signal_shadow_stack(void)return err;fpregs_lock_and_load (); -wrmsrl (MSR_IA32_PL3_SSP , ssp); +wrmsrq (MSR_IA32_PL3_SSP , ssp);fpregs_unlock ();return 0 ;
@@ -473,7 +473,7 @@ static int wrss_control(bool enable) msrval &= ~CET_WRSS_EN ; } -wrmsrl (MSR_IA32_U_CET , msrval); +wrmsrq (MSR_IA32_U_CET , msrval); unlock:fpregs_unlock ();
@@ -492,8 +492,8 @@ static int shstk_disable(void)fpregs_lock_and_load ();/* Disable WRSS too when disabling shadow stack */ -wrmsrl (MSR_IA32_U_CET ,0 ); -wrmsrl (MSR_IA32_PL3_SSP ,0 ); +wrmsrq (MSR_IA32_U_CET ,0 ); +wrmsrq (MSR_IA32_PL3_SSP ,0 );fpregs_unlock ();shstk_free (current);
arch/x86/kernel/traps.c +3 -3
@@ -749,7 +749,7 @@ static bool try_fixup_enqcmd_gp(void)if (current->pasid_activated)return false; -wrmsrl (MSR_IA32_PASID , pasid |MSR_IA32_PASID_VALID ); +wrmsrq (MSR_IA32_PASID , pasid |MSR_IA32_PASID_VALID ); current->pasid_activated =1 ;return true;
@@ -1122,7 +1122,7 @@ static noinstr void exc_debug_kernel(struct pt_regs *regs, unsigned long dr6)rdmsrq (MSR_IA32_DEBUGCTLMSR , debugctl); debugctl |=DEBUGCTLMSR_BTF ; -wrmsrl (MSR_IA32_DEBUGCTLMSR , debugctl); +wrmsrq (MSR_IA32_DEBUGCTLMSR , debugctl); }/*
@@ -1390,7 +1390,7 @@ static bool handle_xfd_event(struct pt_regs *regs)if (!xfd_err)return false; -wrmsrl (MSR_IA32_XFD_ERR ,0 ); +wrmsrq (MSR_IA32_XFD_ERR ,0 );/* Die if that happens in kernel space */ if (WARN_ON (!user_mode (regs)))
arch/x86/kernel/tsc_sync.c +4 -4
@@ -70,7 +70,7 @@ void tsc_verify_tsc_adjust(bool resume)return ;/* Restore the original value */ -wrmsrl (MSR_IA32_TSC_ADJUST , adj->adjusted); +wrmsrq (MSR_IA32_TSC_ADJUST , adj->adjusted);if (!adj->warned || resume) { pr_warn(FW_BUG "TSC ADJUST differs: CPU%u %lld --> %lld. Restoring\n",
@@ -142,7 +142,7 @@ static void tsc_sanitize_first_cpu(struct tsc_adjust *cur, s64 bootval,if (likely (!tsc_async_resets)) {pr_warn (FW_BUG "TSC ADJUST: CPU%u: %lld force to 0\n" , cpu, bootval); -wrmsrl (MSR_IA32_TSC_ADJUST ,0 ); +wrmsrq (MSR_IA32_TSC_ADJUST ,0 ); bootval =0 ; }else { pr_info("TSC ADJUST: CPU%u: %lld NOT forced to 0\n",
@@ -229,7 +229,7 @@ bool tsc_store_and_check_tsc_adjust(bool bootcpu)*/ if (bootval != ref->adjusted) { cur->adjusted = ref->adjusted; -wrmsrl (MSR_IA32_TSC_ADJUST , ref->adjusted); +wrmsrq (MSR_IA32_TSC_ADJUST , ref->adjusted); }/* * We have the TSCs forced to be in sync on this package. Skip sync
@@ -518,7 +518,7 @@ void check_tsc_sync_target(void)pr_warn ("TSC ADJUST compensate: CPU%u observed %lld warp. Adjust: %lld\n" , cpu, cur_max_warp, cur->adjusted); -wrmsrl (MSR_IA32_TSC_ADJUST , cur->adjusted); +wrmsrq (MSR_IA32_TSC_ADJUST , cur->adjusted); goto retry; }
arch/x86/kvm/svm/avic.c +1 -1
@@ -330,7 +330,7 @@ void avic_ring_doorbell(struct kvm_vcpu *vcpu)int cpu =READ_ONCE (vcpu->cpu);if (cpu !=get_cpu ()) { -wrmsrl (MSR_AMD64_SVM_AVIC_DOORBELL ,kvm_cpu_get_apicid (cpu)); +wrmsrq (MSR_AMD64_SVM_AVIC_DOORBELL ,kvm_cpu_get_apicid (cpu));trace_kvm_avic_doorbell (vcpu->vcpu_id,kvm_cpu_get_apicid (cpu)); }put_cpu ();
arch/x86/kvm/svm/svm.c +5 -5
@@ -566,7 +566,7 @@ static void __svm_write_tsc_multiplier(u64 multiplier)if (multiplier ==__this_cpu_read (current_tsc_ratio))return ; -wrmsrl (MSR_AMD64_TSC_RATIO , multiplier); +wrmsrq (MSR_AMD64_TSC_RATIO , multiplier);__this_cpu_write (current_tsc_ratio, multiplier); }
@@ -579,7 +579,7 @@ static inline void kvm_cpu_svm_disable(void) {uint64_t efer; -wrmsrl (MSR_VM_HSAVE_PA ,0 ); +wrmsrq (MSR_VM_HSAVE_PA ,0 );rdmsrq (MSR_EFER , efer);if (efer &EFER_SVME ) {/*
@@ -587,7 +587,7 @@ static inline void kvm_cpu_svm_disable(void)* NMI aren't blocked. */ stgi (); -wrmsrl (MSR_EFER , efer & ~EFER_SVME ); +wrmsrq (MSR_EFER , efer & ~EFER_SVME ); } }
@@ -629,9 +629,9 @@ static int svm_enable_virtualization_cpu(void) sd->next_asid = sd->max_asid +1 ; sd->min_asid = max_sev_asid +1 ; -wrmsrl (MSR_EFER , efer |EFER_SVME ); +wrmsrq (MSR_EFER , efer |EFER_SVME ); -wrmsrl (MSR_VM_HSAVE_PA , sd->save_area_pa); +wrmsrq (MSR_VM_HSAVE_PA , sd->save_area_pa);if (static_cpu_has (X86_FEATURE_TSCRATEMSR )) {/*
arch/x86/kvm/vmx/pmu_intel.c +1 -1
@@ -281,7 +281,7 @@ static bool intel_pmu_handle_lbr_msrs_access(struct kvm_vcpu *vcpu,if (read)rdmsrq (index, msr_info->data);else -wrmsrl (index, msr_info->data); +wrmsrq (index, msr_info->data);__set_bit (INTEL_PMC_IDX_FIXED_VLBR ,vcpu_to_pmu (vcpu)->pmc_in_use);local_irq_enable ();return true;
arch/x86/kvm/vmx/vmx.c +12 -12
@@ -1063,7 +1063,7 @@ static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr,* provide that period, so a CPU could write host's record into * guest's memory. */ -wrmsrl (MSR_IA32_PEBS_ENABLE ,0 ); +wrmsrq (MSR_IA32_PEBS_ENABLE ,0 ); } i =vmx_find_loadstore_msr_slot (&m->guest, msr);
@@ -1192,13 +1192,13 @@ static inline void pt_load_msr(struct pt_ctx *ctx, u32 addr_range) {u32 i; -wrmsrl (MSR_IA32_RTIT_STATUS , ctx->status); -wrmsrl (MSR_IA32_RTIT_OUTPUT_BASE , ctx->output_base); -wrmsrl (MSR_IA32_RTIT_OUTPUT_MASK , ctx->output_mask); -wrmsrl (MSR_IA32_RTIT_CR3_MATCH , ctx->cr3_match); +wrmsrq (MSR_IA32_RTIT_STATUS , ctx->status); +wrmsrq (MSR_IA32_RTIT_OUTPUT_BASE , ctx->output_base); +wrmsrq (MSR_IA32_RTIT_OUTPUT_MASK , ctx->output_mask); +wrmsrq (MSR_IA32_RTIT_CR3_MATCH , ctx->cr3_match);for (i =0 ; i < addr_range; i++) { -wrmsrl (MSR_IA32_RTIT_ADDR0_A + i *2 , ctx->addr_a[i]); -wrmsrl (MSR_IA32_RTIT_ADDR0_B + i *2 , ctx->addr_b[i]); +wrmsrq (MSR_IA32_RTIT_ADDR0_A + i *2 , ctx->addr_a[i]); +wrmsrq (MSR_IA32_RTIT_ADDR0_B + i *2 , ctx->addr_b[i]); } }
@@ -1227,7 +1227,7 @@ static void pt_guest_enter(struct vcpu_vmx *vmx)*/ rdmsrq (MSR_IA32_RTIT_CTL , vmx->pt_desc.host.ctl);if (vmx->pt_desc.guest.ctl &RTIT_CTL_TRACEEN ) { -wrmsrl (MSR_IA32_RTIT_CTL ,0 ); +wrmsrq (MSR_IA32_RTIT_CTL ,0 );pt_save_msr (&vmx->pt_desc.host, vmx->pt_desc.num_address_ranges);pt_load_msr (&vmx->pt_desc.guest, vmx->pt_desc.num_address_ranges); }
@@ -1248,7 +1248,7 @@ static void pt_guest_exit(struct vcpu_vmx *vmx)* i.e. RTIT_CTL is always cleared on VM-Exit. Restore it if necessary. */ if (vmx->pt_desc.host.ctl) -wrmsrl (MSR_IA32_RTIT_CTL , vmx->pt_desc.host.ctl); +wrmsrq (MSR_IA32_RTIT_CTL , vmx->pt_desc.host.ctl); } void vmx_set_host_fs_gs(struct vmcs_host_state *host, u16 fs_sel, u16 gs_sel,
@@ -1338,7 +1338,7 @@ void vmx_prepare_switch_to_guest(struct kvm_vcpu *vcpu) vmx->msr_host_kernel_gs_base = read_msr(MSR_KERNEL_GS_BASE); } -wrmsrl (MSR_KERNEL_GS_BASE , vmx->msr_guest_kernel_gs_base); +wrmsrq (MSR_KERNEL_GS_BASE , vmx->msr_guest_kernel_gs_base);#else savesegment (fs, fs_sel);savesegment (gs, gs_sel);
@@ -1382,7 +1382,7 @@ static void vmx_prepare_switch_to_host(struct vcpu_vmx *vmx)#endif invalidate_tss_limit ();#ifdef CONFIG_X86_64 -wrmsrl (MSR_KERNEL_GS_BASE , vmx->msr_host_kernel_gs_base); +wrmsrq (MSR_KERNEL_GS_BASE , vmx->msr_host_kernel_gs_base);#endif load_fixmap_gdt (raw_smp_processor_id ()); vmx->guest_state_loaded = false;
@@ -1403,7 +1403,7 @@ static void vmx_write_guest_kernel_gs_base(struct vcpu_vmx *vmx, u64 data) {preempt_disable ();if (vmx->guest_state_loaded) -wrmsrl (MSR_KERNEL_GS_BASE , data); +wrmsrq (MSR_KERNEL_GS_BASE , data);preempt_enable (); vmx->msr_guest_kernel_gs_base = data; }
arch/x86/kvm/x86.c +8 -8
@@ -578,7 +578,7 @@ static void kvm_on_user_return(struct user_return_notifier *urn)for (slot =0 ; slot < kvm_nr_uret_msrs; ++slot) { values = &msrs->values[slot];if (values->host != values->curr) { -wrmsrl (kvm_uret_msrs_list[slot], values->host); +wrmsrq (kvm_uret_msrs_list[slot], values->host); values->curr = values->host; } }
@@ -1174,7 +1174,7 @@ void kvm_load_guest_xsave_state(struct kvm_vcpu *vcpu)if (guest_cpu_cap_has (vcpu,X86_FEATURE_XSAVES ) && vcpu->arch.ia32_xss != kvm_host.xss) -wrmsrl (MSR_IA32_XSS , vcpu->arch.ia32_xss); +wrmsrq (MSR_IA32_XSS , vcpu->arch.ia32_xss); } if (cpu_feature_enabled(X86_FEATURE_PKU) &&
@@ -1205,7 +1205,7 @@ void kvm_load_host_xsave_state(struct kvm_vcpu *vcpu)if (guest_cpu_cap_has (vcpu,X86_FEATURE_XSAVES ) && vcpu->arch.ia32_xss != kvm_host.xss) -wrmsrl (MSR_IA32_XSS , kvm_host.xss); +wrmsrq (MSR_IA32_XSS , kvm_host.xss); } }
@@ -3827,7 +3827,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)if (!data)break ; -wrmsrl (MSR_IA32_PRED_CMD , data); +wrmsrq (MSR_IA32_PRED_CMD , data);break ; }case MSR_IA32_FLUSH_CMD :
@@ -3840,7 +3840,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)if (!data)break ; -wrmsrl (MSR_IA32_FLUSH_CMD ,L1D_FLUSH ); +wrmsrq (MSR_IA32_FLUSH_CMD ,L1D_FLUSH );break ;case MSR_EFER :return set_efer (vcpu, msr_info);
@@ -10974,7 +10974,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)switch_fpu_return ();if (vcpu->arch.guest_fpu.xfd_err) -wrmsrl (MSR_IA32_XFD_ERR , vcpu->arch.guest_fpu.xfd_err); +wrmsrq (MSR_IA32_XFD_ERR , vcpu->arch.guest_fpu.xfd_err);if (unlikely (vcpu->arch.switch_db_regs)) {set_debugreg (0 ,7 );
@@ -11060,7 +11060,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)kvm_x86_call (handle_exit_irqoff)(vcpu);if (vcpu->arch.guest_fpu.xfd_err) -wrmsrl (MSR_IA32_XFD_ERR ,0 ); +wrmsrq (MSR_IA32_XFD_ERR ,0 );/* * Consume any pending interrupts, including the possible source of
@@ -13657,7 +13657,7 @@ int kvm_spec_ctrl_test_value(u64 value)else if (wrmsrl_safe (MSR_IA32_SPEC_CTRL , value)) ret =1 ;else -wrmsrl (MSR_IA32_SPEC_CTRL , saved_value); +wrmsrq (MSR_IA32_SPEC_CTRL , saved_value);local_irq_restore (flags);
arch/x86/mm/pat/memtype.c +1 -1
@@ -232,7 +232,7 @@ void pat_cpu_init(void)panic ("x86/PAT: PAT enabled, but not supported by secondary CPU\n" ); } -wrmsrl (MSR_IA32_CR_PAT , pat_msr_val); +wrmsrq (MSR_IA32_CR_PAT , pat_msr_val);__flush_tlb_all (); }
arch/x86/mm/tlb.c +1 -1
@@ -623,7 +623,7 @@ static void l1d_flush_evaluate(unsigned long prev_mm, unsigned long next_mm, {/* Flush L1D if the outgoing task requests it */ if (prev_mm &LAST_USER_MM_L1D_FLUSH ) -wrmsrl (MSR_IA32_FLUSH_CMD ,L1D_FLUSH ); +wrmsrq (MSR_IA32_FLUSH_CMD ,L1D_FLUSH );/* Check whether the incoming task opted in for L1D flush */ if (likely (!(next_mm &LAST_USER_MM_L1D_FLUSH )))
arch/x86/pci/amd_bus.c +1 -1
@@ -344,7 +344,7 @@ static int amd_bus_cpu_online(unsigned int cpu)rdmsrq (MSR_AMD64_NB_CFG , reg);if (!(reg &ENABLE_CF8_EXT_CFG )) { reg |=ENABLE_CF8_EXT_CFG ; -wrmsrl (MSR_AMD64_NB_CFG , reg); +wrmsrq (MSR_AMD64_NB_CFG , reg); }return 0 ; }
arch/x86/platform/olpc/olpc-xo1-sci.c +1 -1
@@ -325,7 +325,7 @@ static int setup_sci_interrupt(struct platform_device *pdev)dev_info (&pdev->dev,"SCI unmapped. Mapping to IRQ 3\n" ); sci_irq =3 ; lo |=0x00300000 ; -wrmsrl (0x51400020 , lo); +wrmsrq (0x51400020 , lo); }/* Select level triggered in PIC */
arch/x86/power/cpu.c +6 -6
@@ -56,7 +56,7 @@ static void msr_restore_context(struct saved_context *ctxt)while (msr < end) {if (msr->valid) -wrmsrl (msr->info.msr_no, msr->info.reg.q); +wrmsrq (msr->info.msr_no, msr->info.reg.q); msr++; } }
@@ -198,7 +198,7 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)struct cpuinfo_x86 *c;if (ctxt->misc_enable_saved) -wrmsrl (MSR_IA32_MISC_ENABLE , ctxt->misc_enable); +wrmsrq (MSR_IA32_MISC_ENABLE , ctxt->misc_enable);/* * control registers */
@@ -208,7 +208,7 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)__write_cr4 (ctxt->cr4);#else /* CONFIG X86_64 */ -wrmsrl (MSR_EFER , ctxt->efer); +wrmsrq (MSR_EFER , ctxt->efer);__write_cr4 (ctxt->cr4);#endif write_cr3 (ctxt->cr3);
@@ -231,7 +231,7 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)* handlers or in complicated helpers like load_gs_index(). */ #ifdef CONFIG_X86_64 -wrmsrl (MSR_GS_BASE , ctxt->kernelmode_gs_base); +wrmsrq (MSR_GS_BASE , ctxt->kernelmode_gs_base);/* * Reinitialize FRED to ensure the FRED MSRs contain the same values
@@ -267,8 +267,8 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)* restoring the selectors clobbers the bases. Keep in mind * that MSR_KERNEL_GS_BASE is horribly misnamed. */ -wrmsrl (MSR_FS_BASE , ctxt->fs_base); -wrmsrl (MSR_KERNEL_GS_BASE , ctxt->usermode_gs_base); +wrmsrq (MSR_FS_BASE , ctxt->fs_base); +wrmsrq (MSR_KERNEL_GS_BASE , ctxt->usermode_gs_base);#else loadsegment (gs, ctxt->gs);#endif
arch/x86/virt/svm/sev.c +2 -2
@@ -140,7 +140,7 @@ static int __mfd_enable(unsigned int cpu) val |=MSR_AMD64_SYSCFG_MFDM ; -wrmsrl (MSR_AMD64_SYSCFG , val); +wrmsrq (MSR_AMD64_SYSCFG , val);return 0 ; }
@@ -162,7 +162,7 @@ static int __snp_enable(unsigned int cpu) val |=MSR_AMD64_SYSCFG_SNP_EN ; val |=MSR_AMD64_SYSCFG_SNP_VMPL_EN ; -wrmsrl (MSR_AMD64_SYSCFG , val); +wrmsrq (MSR_AMD64_SYSCFG , val);return 0 ; }
arch/x86/xen/suspend.c +2 -2
@@ -39,7 +39,7 @@ void xen_arch_post_suspend(int cancelled)static void xen_vcpu_notify_restore (void *data) {if (xen_pv_domain () &&boot_cpu_has (X86_FEATURE_SPEC_CTRL )) -wrmsrl (MSR_IA32_SPEC_CTRL ,this_cpu_read (spec_ctrl)); +wrmsrq (MSR_IA32_SPEC_CTRL ,this_cpu_read (spec_ctrl));/* Boot processor notified via generic timekeeping_resume() */ if (smp_processor_id () ==0 )
@@ -57,7 +57,7 @@ static void xen_vcpu_notify_suspend(void *data)if (xen_pv_domain () &&boot_cpu_has (X86_FEATURE_SPEC_CTRL )) {rdmsrq (MSR_IA32_SPEC_CTRL , tmp);this_cpu_write (spec_ctrl, tmp); -wrmsrl (MSR_IA32_SPEC_CTRL ,0 ); +wrmsrq (MSR_IA32_SPEC_CTRL ,0 ); } }
drivers/cpufreq/acpi-cpufreq.c +1 -1
@@ -117,7 +117,7 @@ static int boost_set_msr(bool enable)else val |= msr_mask; -wrmsrl (msr_addr, val); +wrmsrq (msr_addr, val);return 0 ; }
drivers/cpufreq/amd-pstate.c +1 -1
@@ -258,7 +258,7 @@ static int msr_update_perf(struct cpufreq_policy *policy, u8 min_perf,return 0 ;if (fast_switch) { -wrmsrl (MSR_AMD_CPPC_REQ , value); +wrmsrq (MSR_AMD_CPPC_REQ , value);return 0 ; }else {int ret =wrmsrl_on_cpu (cpudata->cpu,MSR_AMD_CPPC_REQ , value);
drivers/cpufreq/e_powersaver.c +1 -1
@@ -228,7 +228,7 @@ static int eps_cpu_init(struct cpufreq_policy *policy)rdmsrq (MSR_IA32_MISC_ENABLE , val);if (!(val &MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP )) { val |=MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP ; -wrmsrl (MSR_IA32_MISC_ENABLE , val); +wrmsrq (MSR_IA32_MISC_ENABLE , val);/* Can be locked at 0 */ rdmsrq (MSR_IA32_MISC_ENABLE , val);if (!(val &MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP )) {
drivers/cpufreq/intel_pstate.c +6 -6
@@ -1293,7 +1293,7 @@ static void set_power_ctl_ee_state(bool input) power_ctl |=BIT (MSR_IA32_POWER_CTL_BIT_EE ); power_ctl_ee_state =POWER_CTL_EE_DISABLE ; } -wrmsrl (MSR_IA32_POWER_CTL , power_ctl); +wrmsrq (MSR_IA32_POWER_CTL , power_ctl);mutex_unlock (&intel_pstate_driver_lock); }
@@ -2351,7 +2351,7 @@ static inline void intel_pstate_hwp_boost_up(struct cpudata *cpu)return ; hwp_req = (hwp_req & ~GENMASK_ULL (7 ,0 )) | cpu->hwp_boost_min; -wrmsrl (MSR_HWP_REQUEST , hwp_req); +wrmsrq (MSR_HWP_REQUEST , hwp_req); cpu->last_update = cpu->sample.time; }
@@ -2364,7 +2364,7 @@ static inline void intel_pstate_hwp_boost_down(struct cpudata *cpu) expired =time_after64 (cpu->sample.time, cpu->last_update + hwp_boost_hold_time_ns);if (expired) { -wrmsrl (MSR_HWP_REQUEST , cpu->hwp_req_cached); +wrmsrq (MSR_HWP_REQUEST , cpu->hwp_req_cached); cpu->hwp_boost_min =0 ; } }
@@ -2520,7 +2520,7 @@ static void intel_pstate_update_pstate(struct cpudata *cpu, int pstate)return ; cpu->pstate.current_pstate = pstate; -wrmsrl (MSR_IA32_PERF_CTL , pstate_funcs.get_val (cpu, pstate)); +wrmsrq (MSR_IA32_PERF_CTL , pstate_funcs.get_val (cpu, pstate)); }static void intel_pstate_adjust_pstate (struct cpudata *cpu)
@@ -3100,7 +3100,7 @@ static void intel_cpufreq_hwp_update(struct cpudata *cpu, u32 min, u32 max,WRITE_ONCE (cpu->hwp_req_cached, value);if (fast_switch) -wrmsrl (MSR_HWP_REQUEST , value); +wrmsrq (MSR_HWP_REQUEST , value);else wrmsrl_on_cpu (cpu->cpu,MSR_HWP_REQUEST , value); }
@@ -3109,7 +3109,7 @@ static void intel_cpufreq_perf_ctl_update(struct cpudata *cpu, u32 target_pstate, bool fast_switch) { if (fast_switch) - wrmsrl(MSR_IA32_PERF_CTL, + wrmsrq(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, target_pstate)); else wrmsrl_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL,
drivers/cpufreq/longhaul.c +8 -8
@@ -144,7 +144,7 @@ static void do_longhaul1(unsigned int mults_index)/* Sync to timer tick */ safe_halt ();/* Change frequency on next halt or sleep */ -wrmsrl (MSR_VIA_BCR2 , bcr2.val); +wrmsrq (MSR_VIA_BCR2 , bcr2.val);/* Invoke transition */ ACPI_FLUSH_CPU_CACHE ();halt ();
@@ -153,7 +153,7 @@ static void do_longhaul1(unsigned int mults_index)local_irq_disable ();rdmsrq (MSR_VIA_BCR2 , bcr2.val); bcr2.bits.ESOFTBF =0 ; -wrmsrl (MSR_VIA_BCR2 , bcr2.val); +wrmsrq (MSR_VIA_BCR2 , bcr2.val); }/* For processor with Longhaul MSR */
@@ -180,7 +180,7 @@ static void do_powersaver(int cx_address, unsigned int mults_index,/* Raise voltage if necessary */ if (can_scale_voltage && dir) { longhaul.bits.EnableSoftVID =1 ; -wrmsrl (MSR_VIA_LONGHAUL , longhaul.val); +wrmsrq (MSR_VIA_LONGHAUL , longhaul.val);/* Change voltage */ if (!cx_address) {ACPI_FLUSH_CPU_CACHE ();
@@ -194,12 +194,12 @@ static void do_powersaver(int cx_address, unsigned int mults_index, t =inl (acpi_gbl_FADT.xpm_timer_block.address); } longhaul.bits.EnableSoftVID =0 ; -wrmsrl (MSR_VIA_LONGHAUL , longhaul.val); +wrmsrq (MSR_VIA_LONGHAUL , longhaul.val); }/* Change frequency on next halt or sleep */ longhaul.bits.EnableSoftBusRatio =1 ; -wrmsrl (MSR_VIA_LONGHAUL , longhaul.val); +wrmsrq (MSR_VIA_LONGHAUL , longhaul.val);if (!cx_address) {ACPI_FLUSH_CPU_CACHE ();halt ();
@@ -212,12 +212,12 @@ static void do_powersaver(int cx_address, unsigned int mults_index, }/* Disable bus ratio bit */ longhaul.bits.EnableSoftBusRatio =0 ; -wrmsrl (MSR_VIA_LONGHAUL , longhaul.val); +wrmsrq (MSR_VIA_LONGHAUL , longhaul.val);/* Reduce voltage if necessary */ if (can_scale_voltage && !dir) { longhaul.bits.EnableSoftVID =1 ; -wrmsrl (MSR_VIA_LONGHAUL , longhaul.val); +wrmsrq (MSR_VIA_LONGHAUL , longhaul.val);/* Change voltage */ if (!cx_address) {ACPI_FLUSH_CPU_CACHE ();
@@ -231,7 +231,7 @@ static void do_powersaver(int cx_address, unsigned int mults_index, t =inl (acpi_gbl_FADT.xpm_timer_block.address); } longhaul.bits.EnableSoftVID =0 ; -wrmsrl (MSR_VIA_LONGHAUL , longhaul.val); +wrmsrq (MSR_VIA_LONGHAUL , longhaul.val); } }
drivers/cpufreq/powernow-k7.c +2 -2
@@ -225,7 +225,7 @@ static void change_FID(int fid) fidvidctl.bits.FID = fid; fidvidctl.bits.VIDC =0 ; fidvidctl.bits.FIDC =1 ; -wrmsrl (MSR_K7_FID_VID_CTL , fidvidctl.val); +wrmsrq (MSR_K7_FID_VID_CTL , fidvidctl.val); } }
@@ -240,7 +240,7 @@ static void change_VID(int vid) fidvidctl.bits.VID = vid; fidvidctl.bits.FIDC =0 ; fidvidctl.bits.VIDC =1 ; -wrmsrl (MSR_K7_FID_VID_CTL , fidvidctl.val); +wrmsrq (MSR_K7_FID_VID_CTL , fidvidctl.val); } }
drivers/crypto/ccp/sev-dev.c +1 -1
@@ -1060,7 +1060,7 @@ static inline int __sev_do_init_locked(int *psp_ret)static void snp_set_hsave_pa (void *arg) { -wrmsrl (MSR_VM_HSAVE_PA ,0 ); +wrmsrq (MSR_VM_HSAVE_PA ,0 ); }static int snp_filter_reserved_mem_regions (struct resource *rs,void *arg)
drivers/idle/intel_idle.c +5 -5
@@ -2082,8 +2082,8 @@ static void __init spr_idle_state_table_update(void)*/ static void __init byt_cht_auto_demotion_disable (void ) { -wrmsrl (MSR_CC6_DEMOTION_POLICY_CONFIG ,0 ); -wrmsrl (MSR_MC6_DEMOTION_POLICY_CONFIG ,0 ); +wrmsrq (MSR_CC6_DEMOTION_POLICY_CONFIG ,0 ); +wrmsrq (MSR_MC6_DEMOTION_POLICY_CONFIG ,0 ); }static bool __init intel_idle_verify_cstate (unsigned int mwait_hint)
@@ -2243,7 +2243,7 @@ static void auto_demotion_disable(void)rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr_bits); msr_bits &= ~auto_demotion_disable_flags; -wrmsrl (MSR_PKG_CST_CONFIG_CONTROL , msr_bits); +wrmsrq (MSR_PKG_CST_CONFIG_CONTROL , msr_bits); }static void c1e_promotion_enable (void )
@@ -2252,7 +2252,7 @@ static void c1e_promotion_enable(void)rdmsrq (MSR_IA32_POWER_CTL , msr_bits); msr_bits |=0x2 ; -wrmsrl (MSR_IA32_POWER_CTL , msr_bits); +wrmsrq (MSR_IA32_POWER_CTL , msr_bits); }static void c1e_promotion_disable (void )
@@ -2261,7 +2261,7 @@ static void c1e_promotion_disable(void)rdmsrq (MSR_IA32_POWER_CTL , msr_bits); msr_bits &= ~0x2 ; -wrmsrl (MSR_IA32_POWER_CTL , msr_bits); +wrmsrq (MSR_IA32_POWER_CTL , msr_bits); }/**
drivers/platform/x86/intel/ifs/load.c +5 -5
@@ -127,7 +127,7 @@ static void copy_hashes_authenticate_chunks(struct work_struct *work) ifsd =ifs_get_data (dev); msrs =ifs_get_test_msrs (dev);/* run scan hash copy */ -wrmsrl (msrs->copy_hashes, ifs_hash_ptr); +wrmsrq (msrs->copy_hashes, ifs_hash_ptr);rdmsrq (msrs->copy_hashes_status, hashes_status.data);/* enumerate the scan image information */
@@ -149,7 +149,7 @@ static void copy_hashes_authenticate_chunks(struct work_struct *work) linear_addr = base + i * chunk_size; linear_addr |= i; -wrmsrl (msrs->copy_chunks, linear_addr); +wrmsrq (msrs->copy_chunks, linear_addr);rdmsrq (msrs->copy_chunks_status, chunk_status.data); ifsd->valid_chunks = chunk_status.valid_chunks;
@@ -195,7 +195,7 @@ static int copy_hashes_authenticate_chunks_gen2(struct device *dev) msrs =ifs_get_test_msrs (dev);if (need_copy_scan_hashes (ifsd)) { -wrmsrl (msrs->copy_hashes, ifs_hash_ptr); +wrmsrq (msrs->copy_hashes, ifs_hash_ptr);rdmsrq (msrs->copy_hashes_status, hashes_status.data);/* enumerate the scan image information */
@@ -216,7 +216,7 @@ static int copy_hashes_authenticate_chunks_gen2(struct device *dev) }if (ifsd->generation >=IFS_GEN_STRIDE_AWARE ) { -wrmsrl (msrs->test_ctrl,INVALIDATE_STRIDE ); +wrmsrq (msrs->test_ctrl,INVALIDATE_STRIDE );rdmsrq (msrs->copy_chunks_status, chunk_status.data);if (chunk_status.valid_chunks !=0 ) { dev_err(dev, "Couldn't invalidate installed stride - %d\n",
@@ -238,7 +238,7 @@ static int copy_hashes_authenticate_chunks_gen2(struct device *dev) chunk_table[1 ] = linear_addr; do { local_irq_disable(); - wrmsrl(msrs->copy_chunks, (u64)chunk_table); + wrmsrq(msrs->copy_chunks, (u64)chunk_table); local_irq_enable(); rdmsrq(msrs->copy_chunks_status, chunk_status.data); err_code = chunk_status.error_code;
drivers/platform/x86/intel/ifs/runtest.c +4 -4
@@ -209,7 +209,7 @@ static int doscan(void *data)* take up to 200 milliseconds (in the case where all chunks * are processed in a single pass) before it retires. */ -wrmsrl (MSR_ACTIVATE_SCAN , params->activate->data); +wrmsrq (MSR_ACTIVATE_SCAN , params->activate->data);rdmsrq (MSR_SCAN_STATUS , status.data);trace_ifs_status (ifsd->cur_batch, start, stop, status.data);
@@ -321,7 +321,7 @@ static int do_array_test(void *data) first =cpumask_first (cpu_smt_mask (cpu));if (cpu == first) { -wrmsrl (MSR_ARRAY_BIST , command->data); +wrmsrq (MSR_ARRAY_BIST , command->data);/* Pass back the result of the test */ rdmsrq (MSR_ARRAY_BIST , command->data); }
@@ -374,7 +374,7 @@ static int do_array_test_gen1(void *status) first =cpumask_first (cpu_smt_mask (cpu));if (cpu == first) { -wrmsrl (MSR_ARRAY_TRIGGER ,ARRAY_GEN1_TEST_ALL_ARRAYS ); +wrmsrq (MSR_ARRAY_TRIGGER ,ARRAY_GEN1_TEST_ALL_ARRAYS );rdmsrq (MSR_ARRAY_STATUS , *((u64 *)status)); }
@@ -526,7 +526,7 @@ static int dosbaf(void *data)* starts scan of each requested bundle. The core test happens * during the "execution" of the WRMSR. */ -wrmsrl (MSR_ACTIVATE_SBAF , run_params->activate->data); +wrmsrq (MSR_ACTIVATE_SBAF , run_params->activate->data);rdmsrq (MSR_SBAF_STATUS , status.data);trace_ifs_sbaf (ifsd->cur_batch, *run_params->activate, status);
drivers/platform/x86/intel/pmc/cnp.c +2 -2
@@ -230,7 +230,7 @@ static void disable_c1_auto_demote(void *unused)rdmsrq (MSR_PKG_CST_CONFIG_CONTROL , val);per_cpu (pkg_cst_config, cpunum) = val; val &= ~NHM_C1_AUTO_DEMOTE ; -wrmsrl (MSR_PKG_CST_CONFIG_CONTROL , val); +wrmsrq (MSR_PKG_CST_CONFIG_CONTROL , val);pr_debug ("%s: cpu:%d cst %llx\n" , __func__, cpunum, val); }
@@ -239,7 +239,7 @@ static void restore_c1_auto_demote(void *unused) {int cpunum =smp_processor_id (); -wrmsrl (MSR_PKG_CST_CONFIG_CONTROL ,per_cpu (pkg_cst_config, cpunum)); +wrmsrq (MSR_PKG_CST_CONFIG_CONTROL ,per_cpu (pkg_cst_config, cpunum));pr_debug ("%s: cpu:%d cst %llx\n" , __func__, cpunum,per_cpu (pkg_cst_config, cpunum));
drivers/platform/x86/intel/speed_select_if/isst_if_mbox_msr.c +2 -2
@@ -52,14 +52,14 @@ static int isst_if_send_mbox_cmd(u8 command, u8 sub_command, u32 parameter,return ret;/* Write DATA register */ -wrmsrl (MSR_OS_MAILBOX_DATA , command_data); +wrmsrq (MSR_OS_MAILBOX_DATA , command_data);/* Write command register */ data =BIT_ULL (MSR_OS_MAILBOX_BUSY_BIT ) | (parameter &GENMASK_ULL (13 ,0 )) <<16 | (sub_command <<8 ) | command; -wrmsrl (MSR_OS_MAILBOX_INTERFACE , data); +wrmsrq (MSR_OS_MAILBOX_INTERFACE , data);/* Poll for rb bit == 0 */ retries =OS_MAILBOX_RETRY_COUNT ;
drivers/platform/x86/intel_ips.c +8 -8
@@ -382,12 +382,12 @@ static void ips_cpu_raise(struct ips_driver *ips)thm_writew (THM_MPCPC , (new_tdp_limit *10 ) /8 ); turbo_override |=TURBO_TDC_OVR_EN |TURBO_TDP_OVR_EN ; -wrmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_override); +wrmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_override); turbo_override &= ~TURBO_TDP_MASK ; turbo_override |= new_tdp_limit; -wrmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_override); +wrmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_override); }/**
@@ -417,12 +417,12 @@ static void ips_cpu_lower(struct ips_driver *ips)thm_writew (THM_MPCPC , (new_limit *10 ) /8 ); turbo_override |=TURBO_TDC_OVR_EN |TURBO_TDP_OVR_EN ; -wrmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_override); +wrmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_override); turbo_override &= ~TURBO_TDP_MASK ; turbo_override |= new_limit; -wrmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_override); +wrmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_override); }/**
@@ -440,7 +440,7 @@ static void do_enable_cpu_turbo(void *data)rdmsrq (IA32_PERF_CTL , perf_ctl);if (perf_ctl &IA32_PERF_TURBO_DIS ) { perf_ctl &= ~IA32_PERF_TURBO_DIS ; -wrmsrl (IA32_PERF_CTL , perf_ctl); +wrmsrq (IA32_PERF_CTL , perf_ctl); } }
@@ -478,7 +478,7 @@ static void do_disable_cpu_turbo(void *data)rdmsrq (IA32_PERF_CTL , perf_ctl);if (!(perf_ctl &IA32_PERF_TURBO_DIS )) { perf_ctl |=IA32_PERF_TURBO_DIS ; -wrmsrl (IA32_PERF_CTL , perf_ctl); +wrmsrq (IA32_PERF_CTL , perf_ctl); } }
@@ -1598,8 +1598,8 @@ static void ips_remove(struct pci_dev *dev)rdmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_override); turbo_override &= ~(TURBO_TDC_OVR_EN |TURBO_TDP_OVR_EN ); -wrmsrl (TURBO_POWER_CURRENT_LIMIT , turbo_override); -wrmsrl (TURBO_POWER_CURRENT_LIMIT , ips->orig_turbo_limit); +wrmsrq (TURBO_POWER_CURRENT_LIMIT , turbo_override); +wrmsrq (TURBO_POWER_CURRENT_LIMIT , ips->orig_turbo_limit);free_irq (ips->irq, ips);pci_free_irq_vectors (dev);
drivers/thermal/intel/intel_hfi.c +3 -3
@@ -358,7 +358,7 @@ static void hfi_enable(void)rdmsrq (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); msr_val |=HW_FEEDBACK_CONFIG_HFI_ENABLE_BIT ; -wrmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); +wrmsrq (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); }static void hfi_set_hw_table (struct hfi_instance *hfi_instance)
@@ -368,7 +368,7 @@ static void hfi_set_hw_table(struct hfi_instance *hfi_instance) hw_table_pa =virt_to_phys (hfi_instance->hw_table); msr_val = hw_table_pa |HW_FEEDBACK_PTR_VALID_BIT ; -wrmsrl (MSR_IA32_HW_FEEDBACK_PTR , msr_val); +wrmsrq (MSR_IA32_HW_FEEDBACK_PTR , msr_val); }/* Caller must hold hfi_instance_lock. */
@@ -379,7 +379,7 @@ static void hfi_disable(void)rdmsrq (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); msr_val &= ~HW_FEEDBACK_CONFIG_HFI_ENABLE_BIT ; -wrmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); +wrmsrq (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val);/* * Wait for hardware to acknowledge the disabling of HFI. Some
drivers/thermal/intel/therm_throt.c +1 -1
@@ -273,7 +273,7 @@ void thermal_clear_package_intr_status(int level, u64 bit_mask) } msr_val &= ~bit_mask; -wrmsrl (msr, msr_val); +wrmsrq (msr, msr_val); }EXPORT_SYMBOL_GPL (thermal_clear_package_intr_status);
drivers/video/fbdev/geode/lxfb_ops.c +5 -5
@@ -371,7 +371,7 @@ void lx_set_mode(struct fb_info *info) }else msrval |=MSR_LX_GLD_MSR_CONFIG_FMT_CRT ; -wrmsrl (MSR_LX_GLD_MSR_CONFIG , msrval); +wrmsrq (MSR_LX_GLD_MSR_CONFIG , msrval);/* Clear the various buffers */ /* FIXME: Adjust for panning here */
@@ -427,7 +427,7 @@ void lx_set_mode(struct fb_info *info) | MSR_LX_SPARE_MSR_WM_LPEN_OVRD); msrval |=MSR_LX_SPARE_MSR_DIS_VIFO_WM |MSR_LX_SPARE_MSR_DIS_INIT_V_PRI ; -wrmsrl (MSR_LX_SPARE_MSR , msrval); +wrmsrq (MSR_LX_SPARE_MSR , msrval); gcfg =DC_GENERAL_CFG_DFLE ;/* Display fifo enable */ gcfg |= (0x6 << DC_GENERAL_CFG_DFHPSL_SHIFT) | /* default priority */
@@ -664,7 +664,7 @@ static void lx_restore_display_ctlr(struct lxfb_par *par)uint32_t filt;int i; -wrmsrl (MSR_LX_SPARE_MSR , par->msr.dcspare); +wrmsrq (MSR_LX_SPARE_MSR , par->msr.dcspare);for (i =0 ; i <ARRAY_SIZE (par->dc); i++) {switch (i) {
@@ -729,8 +729,8 @@ static void lx_restore_video_proc(struct lxfb_par *par) {int i; -wrmsrl (MSR_LX_GLD_MSR_CONFIG , par->msr.dfglcfg); -wrmsrl (MSR_LX_MSR_PADSEL , par->msr.padsel); +wrmsrq (MSR_LX_GLD_MSR_CONFIG , par->msr.dfglcfg); +wrmsrq (MSR_LX_MSR_PADSEL , par->msr.padsel);for (i =0 ; i <ARRAY_SIZE (par->vp); i++) {switch (i) {
drivers/video/fbdev/geode/suspend_gx.c +1 -1
@@ -133,7 +133,7 @@ static void gx_restore_video_proc(struct gxfb_par *par) {int i; -wrmsrl (MSR_GX_MSR_PADSEL , par->msr.padsel); +wrmsrq (MSR_GX_MSR_PADSEL , par->msr.padsel);for (i =0 ; i <ARRAY_SIZE (par->vp); i++) {switch (i) {
drivers/video/fbdev/geode/video_gx.c +4 -4
@@ -151,7 +151,7 @@ void gx_set_dclk_frequency(struct fb_info *info) dotpll |=MSR_GLCP_DOTPLL_DOTRESET ; dotpll &= ~MSR_GLCP_DOTPLL_BYPASS ; -wrmsrl (MSR_GLCP_DOTPLL , dotpll); +wrmsrq (MSR_GLCP_DOTPLL , dotpll);/* Program dividers. */ sys_rstpll &= ~( MSR_GLCP_SYS_RSTPLL_DOTPREDIV2
@@ -159,11 +159,11 @@ void gx_set_dclk_frequency(struct fb_info *info) | MSR_GLCP_SYS_RSTPLL_DOTPOSTDIV3 ); sys_rstpll |= pll_table[best_i].sys_rstpll_bits; -wrmsrl (MSR_GLCP_SYS_RSTPLL , sys_rstpll); +wrmsrq (MSR_GLCP_SYS_RSTPLL , sys_rstpll);/* Clear reset bit to start PLL. */ dotpll &= ~(MSR_GLCP_DOTPLL_DOTRESET ); -wrmsrl (MSR_GLCP_DOTPLL , dotpll); +wrmsrq (MSR_GLCP_DOTPLL , dotpll);/* Wait for LOCK bit. */ do {
@@ -183,7 +183,7 @@ gx_configure_tft(struct fb_info *info)rdmsrq (MSR_GX_MSR_PADSEL , val); val &= ~MSR_GX_MSR_PADSEL_MASK ; val |=MSR_GX_MSR_PADSEL_TFT ; -wrmsrl (MSR_GX_MSR_PADSEL , val); +wrmsrq (MSR_GX_MSR_PADSEL , val);/* Turn off the panel */
include/hyperv/hvgdk_mini.h +1 -1
@@ -1013,7 +1013,7 @@ enum hv_register_name {/* * To support arch-generic code calling hv_set/get_register: -* - On x86, HV_MSR_ indicates an MSR accessed via rdmsrq/wrmsrl +* - On x86, HV_MSR_ indicates an MSR accessed via rdmsrq/wrmsrq * - On ARM, HV_MSR_ indicates a VP register accessed via hypercall */ #define HV_MSR_CRASH_P0 (HV_X64_MSR_CRASH_P0)
Signature · 1 line
2.45.2
PATCH 9/20 x86/msr: Rename 'rdmsrl_safe()' to 'rdmsrq_safe()'
In reply to Ingo Molnar--- arch/x86/events/amd/power.c | 2 +- arch/x86/events/core.c | 8 ++++---- arch/x86/events/intel/core.c | 4 ++-- arch/x86/events/probe.c | 2 +- arch/x86/events/rapl.c | 2 +- arch/x86/include/asm/apic.h | 2 +- arch/x86/include/asm/msr.h | 4 ++-- arch/x86/include/asm/paravirt.h | 2 +- arch/x86/kernel/amd_nb.c | 2 +- arch/x86/kernel/cpu/amd.c | 6 +++--- arch/x86/kernel/cpu/aperfmperf.c | 20 ++++++++++---------- arch/x86/kernel/cpu/bus_lock.c | 2 +- arch/x86/kernel/cpu/common.c | 4 ++-- arch/x86/kernel/cpu/feat_ctl.c | 2 +- arch/x86/kernel/cpu/hygon.c | 2 +- arch/x86/kernel/cpu/intel.c | 4 ++-- arch/x86/kernel/cpu/mce/inject.c | 2 +- arch/x86/kernel/cpu/mce/intel.c | 2 +- arch/x86/kvm/vmx/sgx.c | 2 +- arch/x86/kvm/vmx/vmx.c | 2 +- arch/x86/kvm/x86.c | 12 ++++++------ arch/x86/lib/msr.c | 2 +- arch/x86/power/cpu.c | 4 ++-- drivers/acpi/acpi_extlog.c | 2 +- drivers/acpi/acpi_lpit.c | 2 +- drivers/cpufreq/amd-pstate-ut.c | 4 ++-- drivers/cpufreq/amd_freq_sensitivity.c | 2 +- drivers/cpufreq/intel_pstate.c | 2 +- drivers/gpu/drm/i915/selftests/librapl.c | 4 ++-- drivers/hwmon/fam15h_power.c | 6 +++--- drivers/platform/x86/intel/ifs/core.c | 4 ++-- drivers/platform/x86/intel/pmc/core.c | 8 ++++---- .../x86/intel/speed_select_if/isst_if_common.c | 10 +++++----- .../x86/intel/speed_select_if/isst_if_mbox_msr.c | 4 ++-- drivers/platform/x86/intel/tpmi_power_domains.c | 4 ++-- drivers/platform/x86/intel/turbo_max_3.c | 2 +- drivers/powercap/intel_rapl_msr.c | 2 +- .../intel/int340x_thermal/processor_thermal_device.c | 2 +- drivers/thermal/intel/intel_powerclamp.c | 4 ++-- drivers/thermal/intel/intel_tcc_cooling.c | 4 ++-- 40 files changed, 80 insertions(+), 80 deletions(-)
arch/x86/events/amd/power.c +1 -1
@@ -272,7 +272,7 @@ static int __init amd_power_pmu_init(void) cpu_pwr_sample_ratio =cpuid_ecx (0x80000007 ); -if (rdmsrl_safe (MSR_F15H_CU_MAX_PWR_ACCUMULATOR , &max_cu_acc_power)) { +if (rdmsrq_safe (MSR_F15H_CU_MAX_PWR_ACCUMULATOR , &max_cu_acc_power)) {pr_err ("Failed to read max compute unit power accumulator MSR\n" );return -ENODEV ; }
arch/x86/events/core.c +4 -4
@@ -269,7 +269,7 @@ bool check_hw_exists(struct pmu *pmu, unsigned long *cntr_mask,*/ for_each_set_bit (i, cntr_mask,X86_PMC_IDX_MAX ) { reg =x86_pmu_config_addr (i); - ret =rdmsrl_safe (reg, &val); + ret =rdmsrq_safe (reg, &val);if (ret) goto msr_fail;if (val &ARCH_PERFMON_EVENTSEL_ENABLE ) {
@@ -283,7 +283,7 @@ bool check_hw_exists(struct pmu *pmu, unsigned long *cntr_mask,if (*(u64 *)fixed_cntr_mask) { reg =MSR_ARCH_PERFMON_FIXED_CTR_CTRL ; - ret =rdmsrl_safe (reg, &val); + ret =rdmsrq_safe (reg, &val);if (ret) goto msr_fail;for_each_set_bit (i, fixed_cntr_mask,X86_PMC_IDX_MAX ) {
@@ -314,11 +314,11 @@ bool check_hw_exists(struct pmu *pmu, unsigned long *cntr_mask,* (qemu/kvm) that don't trap on the MSR access and always return 0s. */ reg =x86_pmu_event_addr (reg_safe); -if (rdmsrl_safe (reg, &val)) +if (rdmsrq_safe (reg, &val)) goto msr_fail; val ^=0xffffUL ; ret =wrmsrl_safe (reg, val); - ret |=rdmsrl_safe (reg, &val_new); + ret |=rdmsrq_safe (reg, &val_new);if (ret || val != val_new) goto msr_fail;
arch/x86/events/intel/core.c +2 -2
@@ -5610,7 +5610,7 @@ static bool check_msr(unsigned long msr, u64 mask)* matches, this is needed to detect certain hardware emulators * (qemu/kvm) that don't trap on the MSR access and always return 0s. */ -if (rdmsrl_safe (msr, &val_old)) +if (rdmsrq_safe (msr, &val_old))return false;/*
@@ -5622,7 +5622,7 @@ static bool check_msr(unsigned long msr, u64 mask) val_tmp =lbr_from_signext_quirk_wr (val_tmp);if (wrmsrl_safe (msr, val_tmp) || -rdmsrl_safe (msr, &val_new)) +rdmsrq_safe (msr, &val_new))return false;/*
arch/x86/events/probe.c +1 -1
@@ -43,7 +43,7 @@ perf_msr_probe(struct perf_msr *msr, int cnt, bool zero, void *data)if (msr[bit].test && !msr[bit].test (bit, data))continue ;/* Virt sucks; you cannot tell if a R/O MSR is present :/ */ -if (rdmsrl_safe (msr[bit].msr, &val)) +if (rdmsrq_safe (msr[bit].msr, &val))continue ; mask = msr[bit].mask;
arch/x86/events/rapl.c +1 -1
@@ -611,7 +611,7 @@ static int rapl_check_hw_unit(void)int i;/* protect rdmsrq() to handle virtualization */ -if (rdmsrl_safe (rapl_model->msr_power_unit, &msr_rapl_power_unit_bits)) +if (rdmsrq_safe (rapl_model->msr_power_unit, &msr_rapl_power_unit_bits))return -1 ;for (i =0 ; i <NR_RAPL_PKG_DOMAINS ; i++) rapl_pkg_hw_unit[i] = (msr_rapl_power_unit_bits >>8 ) &0x1FULL ;
arch/x86/include/asm/apic.h +1 -1
@@ -120,7 +120,7 @@ static inline bool apic_is_x2apic_enabled(void) {u64 msr; -if (rdmsrl_safe (MSR_IA32_APICBASE , &msr)) +if (rdmsrq_safe (MSR_IA32_APICBASE , &msr))return false;return msr &X2APIC_ENABLE ; }
arch/x86/include/asm/msr.h +2 -2
@@ -279,7 +279,7 @@ static inline int wrmsr_safe(u32 msr, u32 low, u32 high) __err; \ }) -static inline int rdmsrl_safe (u32 msr,u64 *p) +static inline int rdmsrq_safe (u32 msr,u64 *p) {int err;
@@ -381,7 +381,7 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) }static inline int rdmsrl_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) { -return rdmsrl_safe (msr_no, q); +return rdmsrq_safe (msr_no, q); }static inline int wrmsrl_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 q) {
arch/x86/include/asm/paravirt.h +1 -1
@@ -231,7 +231,7 @@ static inline void wrmsrq(unsigned msr, u64 val) _err; \ }) -static inline int rdmsrl_safe (unsigned msr,u64 *p) +static inline int rdmsrq_safe (unsigned msr,u64 *p) {int err;
arch/x86/kernel/amd_nb.c +1 -1
@@ -151,7 +151,7 @@ struct resource *amd_get_mmconfig_range(struct resource *res)/* Assume CPUs from Fam10h have mmconfig, although not all VMs do */ if (boot_cpu_data.x86 <0x10 || -rdmsrl_safe (MSR_FAM10H_MMIO_CONF_BASE , &msr)) +rdmsrq_safe (MSR_FAM10H_MMIO_CONF_BASE , &msr))return NULL ;/* mmconfig is not enabled */
arch/x86/kernel/cpu/amd.c +3 -3
@@ -422,7 +422,7 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)* Try to cache the base value so further operations can * avoid RMW. If that faults, do not enable SSBD. */ -if (!rdmsrl_safe (MSR_AMD64_LS_CFG , &x86_amd_ls_cfg_base)) { +if (!rdmsrq_safe (MSR_AMD64_LS_CFG , &x86_amd_ls_cfg_base)) {setup_force_cpu_cap (X86_FEATURE_LS_CFG_SSBD );setup_force_cpu_cap (X86_FEATURE_SSBD ); x86_amd_ls_cfg_ssbd_mask =1ULL << bit;
@@ -788,7 +788,7 @@ static void init_amd_bd(struct cpuinfo_x86 *c)* Disable it on the affected CPUs. */ if ((c->x86_model >=0x02 ) && (c->x86_model <0x20 )) { -if (!rdmsrl_safe (MSR_F15H_IC_CFG , &value) && !(value &0x1E )) { +if (!rdmsrq_safe (MSR_F15H_IC_CFG , &value) && !(value &0x1E )) { value |=0x1E ;wrmsrl_safe (MSR_F15H_IC_CFG , value); }
@@ -838,7 +838,7 @@ void init_spectral_chicken(struct cpuinfo_x86 *c)* suppresses non-branch predictions. */ if (!cpu_has (c,X86_FEATURE_HYPERVISOR )) { -if (!rdmsrl_safe (MSR_ZEN2_SPECTRAL_CHICKEN , &value)) { +if (!rdmsrq_safe (MSR_ZEN2_SPECTRAL_CHICKEN , &value)) { value |=MSR_ZEN2_SPECTRAL_CHICKEN_BIT ;wrmsrl_safe (MSR_ZEN2_SPECTRAL_CHICKEN , value); }
arch/x86/kernel/cpu/aperfmperf.c +10 -10
@@ -99,7 +99,7 @@ static bool __init turbo_disabled(void)u64 misc_en;int err; - err =rdmsrl_safe (MSR_IA32_MISC_ENABLE , &misc_en); + err =rdmsrq_safe (MSR_IA32_MISC_ENABLE , &misc_en);if (err)return false;
@@ -110,11 +110,11 @@ static bool __init slv_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq) {int err; - err =rdmsrl_safe (MSR_ATOM_CORE_RATIOS , base_freq); + err =rdmsrq_safe (MSR_ATOM_CORE_RATIOS , base_freq);if (err)return false; - err =rdmsrl_safe (MSR_ATOM_CORE_TURBO_RATIOS , turbo_freq); + err =rdmsrq_safe (MSR_ATOM_CORE_TURBO_RATIOS , turbo_freq);if (err)return false;
@@ -152,13 +152,13 @@ static bool __init knl_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq,int err, i;u64 msr; - err =rdmsrl_safe (MSR_PLATFORM_INFO , base_freq); + err =rdmsrq_safe (MSR_PLATFORM_INFO , base_freq);if (err)return false; *base_freq = (*base_freq >>8 ) &0xFF ;/* max P state */ - err =rdmsrl_safe (MSR_TURBO_RATIO_LIMIT , &msr); + err =rdmsrq_safe (MSR_TURBO_RATIO_LIMIT , &msr);if (err)return false;
@@ -190,17 +190,17 @@ static bool __init skx_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq, int su32 group_size;int err, i; - err =rdmsrl_safe (MSR_PLATFORM_INFO , base_freq); + err =rdmsrq_safe (MSR_PLATFORM_INFO , base_freq);if (err)return false; *base_freq = (*base_freq >>8 ) &0xFF ;/* max P state */ - err =rdmsrl_safe (MSR_TURBO_RATIO_LIMIT , &ratios); + err =rdmsrq_safe (MSR_TURBO_RATIO_LIMIT , &ratios);if (err)return false; - err =rdmsrl_safe (MSR_TURBO_RATIO_LIMIT1 , &counts); + err =rdmsrq_safe (MSR_TURBO_RATIO_LIMIT1 , &counts);if (err)return false;
@@ -220,11 +220,11 @@ static bool __init core_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq)u64 msr;int err; - err =rdmsrl_safe (MSR_PLATFORM_INFO , base_freq); + err =rdmsrq_safe (MSR_PLATFORM_INFO , base_freq);if (err)return false; - err =rdmsrl_safe (MSR_TURBO_RATIO_LIMIT , &msr); + err =rdmsrq_safe (MSR_TURBO_RATIO_LIMIT , &msr);if (err)return false;
arch/x86/kernel/cpu/bus_lock.c +1 -1
@@ -95,7 +95,7 @@ static bool split_lock_verify_msr(bool on) {u64 ctrl, tmp; -if (rdmsrl_safe (MSR_TEST_CTRL , &ctrl)) +if (rdmsrq_safe (MSR_TEST_CTRL , &ctrl))return false;if (on) ctrl |=MSR_TEST_CTRL_SPLIT_LOCK_DETECT ;
arch/x86/kernel/cpu/common.c +2 -2
@@ -148,7 +148,7 @@ static void ppin_init(struct cpuinfo_x86 *c)*/ info = (struct ppin_info *)id->driver_data; -if (rdmsrl_safe (info->msr_ppin_ctl, &val)) +if (rdmsrq_safe (info->msr_ppin_ctl, &val)) goto clear_ppin;if ((val &3UL ) ==1UL ) {
@@ -159,7 +159,7 @@ static void ppin_init(struct cpuinfo_x86 *c)/* If PPIN is disabled, try to enable */ if (!(val &2UL )) {wrmsrl_safe (info->msr_ppin_ctl, val |2UL ); -rdmsrl_safe (info->msr_ppin_ctl, &val); +rdmsrq_safe (info->msr_ppin_ctl, &val); }/* Is the enable bit set? */
arch/x86/kernel/cpu/feat_ctl.c +1 -1
@@ -118,7 +118,7 @@ void init_ia32_feat_ctl(struct cpuinfo_x86 *c)bool enable_vmx;u64 msr; -if (rdmsrl_safe (MSR_IA32_FEAT_CTL , &msr)) { +if (rdmsrq_safe (MSR_IA32_FEAT_CTL , &msr)) {clear_cpu_cap (c,X86_FEATURE_VMX );clear_cpu_cap (c,X86_FEATURE_SGX );return ;
arch/x86/kernel/cpu/hygon.c +1 -1
@@ -110,7 +110,7 @@ static void bsp_init_hygon(struct cpuinfo_x86 *c)* Try to cache the base value so further operations can * avoid RMW. If that faults, do not enable SSBD. */ -if (!rdmsrl_safe (MSR_AMD64_LS_CFG , &x86_amd_ls_cfg_base)) { +if (!rdmsrq_safe (MSR_AMD64_LS_CFG , &x86_amd_ls_cfg_base)) {setup_force_cpu_cap (X86_FEATURE_LS_CFG_SSBD );setup_force_cpu_cap (X86_FEATURE_SSBD ); x86_amd_ls_cfg_ssbd_mask =1ULL <<10 ;
arch/x86/kernel/cpu/intel.c +2 -2
@@ -488,7 +488,7 @@ static void init_cpuid_fault(struct cpuinfo_x86 *c) {u64 msr; -if (!rdmsrl_safe (MSR_PLATFORM_INFO , &msr)) { +if (!rdmsrq_safe (MSR_PLATFORM_INFO , &msr)) {if (msr &MSR_PLATFORM_INFO_CPUID_FAULT )set_cpu_cap (c,X86_FEATURE_CPUID_FAULT ); }
@@ -498,7 +498,7 @@ static void init_intel_misc_features(struct cpuinfo_x86 *c) {u64 msr; -if (rdmsrl_safe (MSR_MISC_FEATURES_ENABLES , &msr)) +if (rdmsrq_safe (MSR_MISC_FEATURES_ENABLES , &msr))return ;/* Clear all MISC features */
arch/x86/kernel/cpu/mce/inject.c +1 -1
@@ -748,7 +748,7 @@ static void check_hw_inj_possible(void)toggle_hw_mce_inject (cpu, true);wrmsrl_safe (mca_msr_reg (bank,MCA_STATUS ), status); -rdmsrl_safe (mca_msr_reg (bank,MCA_STATUS ), &status); +rdmsrq_safe (mca_msr_reg (bank,MCA_STATUS ), &status);wrmsrl_safe (mca_msr_reg (bank,MCA_STATUS ),0 );if (!status) {
arch/x86/kernel/cpu/mce/intel.c +1 -1
@@ -460,7 +460,7 @@ static void intel_imc_init(struct cpuinfo_x86 *c)case INTEL_SANDYBRIDGE_X :case INTEL_IVYBRIDGE_X :case INTEL_HASWELL_X : -if (rdmsrl_safe (MSR_ERROR_CONTROL , &error_control)) +if (rdmsrq_safe (MSR_ERROR_CONTROL , &error_control))return ; error_control |=2 ;wrmsrl_safe (MSR_ERROR_CONTROL , error_control);
arch/x86/kvm/vmx/sgx.c +1 -1
@@ -411,7 +411,7 @@ void setup_default_sgx_lepubkeyhash(void)* MSRs exist but are read-only (locked and not writable). */ if (!enable_sgx ||boot_cpu_has (X86_FEATURE_SGX_LC ) || -rdmsrl_safe (MSR_IA32_SGXLEPUBKEYHASH0 , &sgx_pubkey_hash[0 ])) { +rdmsrq_safe (MSR_IA32_SGXLEPUBKEYHASH0 , &sgx_pubkey_hash[0 ])) { sgx_pubkey_hash[0 ] =0xa6053e051270b7acULL ; sgx_pubkey_hash[1 ] =0x6cfbe8ba8b3b413dULL ; sgx_pubkey_hash[2 ] =0xc4916d99f2b3735dULL ;
arch/x86/kvm/vmx/vmx.c +1 -1
@@ -2850,7 +2850,7 @@ static int kvm_cpu_vmxon(u64 vmxon_pointer) fault:WARN_ONCE (1 ,"VMXON faulted, MSR_IA32_FEAT_CTL (0x3a) = 0x%llx\n" , -rdmsrl_safe (MSR_IA32_FEAT_CTL , &msr) ?0xdeadbeef : msr); +rdmsrq_safe (MSR_IA32_FEAT_CTL , &msr) ?0xdeadbeef : msr);cr4_clear_bits (X86_CR4_VMXE );return -EFAULT ;
arch/x86/kvm/x86.c +6 -6
@@ -590,7 +590,7 @@ static int kvm_probe_user_return_msr(u32 msr)int ret;preempt_disable (); - ret =rdmsrl_safe (msr, &val); + ret =rdmsrq_safe (msr, &val);if (ret) goto out; ret =wrmsrl_safe (msr, val);
@@ -630,7 +630,7 @@ static void kvm_user_return_msr_cpu_online(void)int i;for (i =0 ; i < kvm_nr_uret_msrs; ++i) { -rdmsrl_safe (kvm_uret_msrs_list[i], &value); +rdmsrq_safe (kvm_uret_msrs_list[i], &value); msrs->values[i].host = value; msrs->values[i].curr = value; }
@@ -1660,7 +1660,7 @@ static int kvm_get_feature_msr(struct kvm_vcpu *vcpu, u32 index, u64 *data, *data =MSR_PLATFORM_INFO_CPUID_FAULT ;break ;case MSR_IA32_UCODE_REV : -rdmsrl_safe (index, data); +rdmsrq_safe (index, data);break ;default :return kvm_x86_call (get_feature_msr)(index, data);
@@ -9736,7 +9736,7 @@ int kvm_x86_vendor_init(struct kvm_x86_init_ops *ops)* with an exception. PAT[0] is set to WB on RESET and also by the * kernel, i.e. failure indicates a kernel bug or broken firmware. */ -if (rdmsrl_safe (MSR_IA32_CR_PAT , &host_pat) || +if (rdmsrq_safe (MSR_IA32_CR_PAT , &host_pat) || (host_pat &GENMASK (2 ,0 )) !=6 ) {pr_err ("host PAT[0] is not WB\n" );return -EIO ;
@@ -9770,7 +9770,7 @@ int kvm_x86_vendor_init(struct kvm_x86_init_ops *ops) kvm_caps.supported_xcr0 = kvm_host.xcr0 &KVM_SUPPORTED_XCR0 ; } -rdmsrl_safe (MSR_EFER , &kvm_host.efer); +rdmsrq_safe (MSR_EFER , &kvm_host.efer);if (boot_cpu_has (X86_FEATURE_XSAVES ))rdmsrq (MSR_IA32_XSS , kvm_host.xss);
@@ -13652,7 +13652,7 @@ int kvm_spec_ctrl_test_value(u64 value)local_irq_save (flags); -if (rdmsrl_safe (MSR_IA32_SPEC_CTRL , &saved_value)) +if (rdmsrq_safe (MSR_IA32_SPEC_CTRL , &saved_value)) ret =1 ;else if (wrmsrl_safe (MSR_IA32_SPEC_CTRL , value)) ret =1 ;
arch/x86/lib/msr.c +1 -1
@@ -41,7 +41,7 @@ static int msr_read(u32 msr, struct msr *m)int err;u64 val; - err =rdmsrl_safe (msr, &val); + err =rdmsrq_safe (msr, &val);if (!err) m->q = val;
arch/x86/power/cpu.c +2 -2
@@ -125,7 +125,7 @@ static void __save_processor_state(struct saved_context *ctxt) ctxt->cr2 =read_cr2 (); ctxt->cr3 =__read_cr3 (); ctxt->cr4 =__read_cr4 (); - ctxt->misc_enable_saved = !rdmsrl_safe (MSR_IA32_MISC_ENABLE , + ctxt->misc_enable_saved = !rdmsrq_safe (MSR_IA32_MISC_ENABLE , &ctxt->misc_enable);msr_save_context (ctxt); }
@@ -414,7 +414,7 @@ static int msr_build_context(const u32 *msr_id, const int num)u64 dummy; msr_array[i].info.msr_no = msr_id[j]; - msr_array[i].valid = !rdmsrl_safe (msr_id[j], &dummy); + msr_array[i].valid = !rdmsrq_safe (msr_id[j], &dummy); msr_array[i].info.reg.q =0 ; } saved_msrs->num = total_num;
drivers/acpi/acpi_extlog.c +1 -1
@@ -234,7 +234,7 @@ static int __init extlog_init(void)u64 cap;int rc; -if (rdmsrl_safe (MSR_IA32_MCG_CAP , &cap) || +if (rdmsrq_safe (MSR_IA32_MCG_CAP , &cap) || !(cap &MCG_ELOG_P ) || !extlog_get_l1addr ())return -ENODEV ;
drivers/acpi/acpi_lpit.c +1 -1
@@ -39,7 +39,7 @@ static int lpit_read_residency_counter_us(u64 *counter, bool io_mem)return 0 ; } - err =rdmsrl_safe (residency_info_ffh.gaddr.address, counter); + err =rdmsrq_safe (residency_info_ffh.gaddr.address, counter);if (!err) { u64 mask = GENMASK_ULL(residency_info_ffh.gaddr.bit_offset + residency_info_ffh.gaddr. bit_width - 1,
drivers/cpufreq/amd-pstate-ut.c +2 -2
@@ -90,9 +90,9 @@ static int amd_pstate_ut_check_enabled(u32 index)if (get_shared_mem ())return 0 ; - ret =rdmsrl_safe (MSR_AMD_CPPC_ENABLE , &cppc_enable); + ret =rdmsrq_safe (MSR_AMD_CPPC_ENABLE , &cppc_enable);if (ret) { -pr_err ("%s rdmsrl_safe MSR_AMD_CPPC_ENABLE ret=%d error!\n" , __func__, ret); +pr_err ("%s rdmsrq_safe MSR_AMD_CPPC_ENABLE ret=%d error!\n" , __func__, ret);return ret; }
drivers/cpufreq/amd_freq_sensitivity.c +1 -1
@@ -129,7 +129,7 @@ static int __init amd_freq_sensitivity_init(void)pci_dev_put (pcidev); } -if (rdmsrl_safe (MSR_AMD64_FREQ_SENSITIVITY_ACTUAL , &val)) +if (rdmsrq_safe (MSR_AMD64_FREQ_SENSITIVITY_ACTUAL , &val))return -ENODEV ;if (!(val >>CLASS_CODE_SHIFT ))
drivers/cpufreq/intel_pstate.c +1 -1
@@ -1877,7 +1877,7 @@ void notify_hwp_interrupt(void)if (cpu_feature_enabled (X86_FEATURE_HWP_HIGHEST_PERF_CHANGE )) status_mask |=HWP_HIGHEST_PERF_CHANGE_STATUS ; -rdmsrl_safe (MSR_HWP_STATUS , &value); +rdmsrq_safe (MSR_HWP_STATUS , &value);if (!(value & status_mask))return ;
drivers/gpu/drm/i915/selftests/librapl.c +2 -2
@@ -22,12 +22,12 @@ u64 librapl_energy_uJ(void)unsigned long long power;u32 units; -if (rdmsrl_safe (MSR_RAPL_POWER_UNIT , &power)) +if (rdmsrq_safe (MSR_RAPL_POWER_UNIT , &power))return 0 ; units = (power &0x1f00 ) >>8 ; -if (rdmsrl_safe (MSR_PP1_ENERGY_STATUS , &power)) +if (rdmsrq_safe (MSR_PP1_ENERGY_STATUS , &power))return 0 ;return (1000000 * power) >> units;/* convert to uJ */
drivers/hwmon/fam15h_power.c +3 -3
@@ -143,8 +143,8 @@ static void do_read_registers_on_cu(void *_data)*/ cu =topology_core_id (smp_processor_id ()); -rdmsrl_safe (MSR_F15H_CU_PWR_ACCUMULATOR , &data->cu_acc_power[cu]); -rdmsrl_safe (MSR_F15H_PTSC , &data->cpu_sw_pwr_ptsc[cu]); +rdmsrq_safe (MSR_F15H_CU_PWR_ACCUMULATOR , &data->cu_acc_power[cu]); +rdmsrq_safe (MSR_F15H_PTSC , &data->cpu_sw_pwr_ptsc[cu]); data->cu_on[cu] =1 ; }
@@ -424,7 +424,7 @@ static int fam15h_power_init_data(struct pci_dev *f4,*/ data->cpu_pwr_sample_ratio =cpuid_ecx (0x80000007 ); -if (rdmsrl_safe (MSR_F15H_CU_MAX_PWR_ACCUMULATOR , &tmp)) { +if (rdmsrq_safe (MSR_F15H_CU_MAX_PWR_ACCUMULATOR , &tmp)) {pr_err ("Failed to read max compute unit power accumulator MSR\n" );return -ENODEV ; }
drivers/platform/x86/intel/ifs/core.c +2 -2
@@ -115,13 +115,13 @@ static int __init ifs_init(void)if (!m)return -ENODEV ; -if (rdmsrl_safe (MSR_IA32_CORE_CAPS , &msrval)) +if (rdmsrq_safe (MSR_IA32_CORE_CAPS , &msrval))return -ENODEV ;if (!(msrval &MSR_IA32_CORE_CAPS_INTEGRITY_CAPS ))return -ENODEV ; -if (rdmsrl_safe (MSR_INTEGRITY_CAPS , &msrval)) +if (rdmsrq_safe (MSR_INTEGRITY_CAPS , &msrval))return -ENODEV ; ifs_pkg_auth =kmalloc_array (topology_max_packages (),sizeof (bool ),GFP_KERNEL );
drivers/platform/x86/intel/pmc/core.c +4 -4
@@ -1082,7 +1082,7 @@ static int pmc_core_pkgc_show(struct seq_file *s, void *unused)unsigned int index;for (index =0 ; map[index].name ; index++) { -if (rdmsrl_safe (map[index].bit_mask, &pcstate_count)) +if (rdmsrq_safe (map[index].bit_mask, &pcstate_count))continue ; pcstate_count *=1000 ;
@@ -1587,7 +1587,7 @@ static __maybe_unused int pmc_core_suspend(struct device *dev)/* Save PKGC residency for checking later */ for (i =0 ; i < pmcdev->num_of_pkgc; i++) { -if (rdmsrl_safe (msr_map[i].bit_mask, &pmcdev->pkgc_res_cnt[i])) +if (rdmsrq_safe (msr_map[i].bit_mask, &pmcdev->pkgc_res_cnt[i]))return -EIO ; }
@@ -1603,7 +1603,7 @@ static inline bool pmc_core_is_deepest_pkgc_failed(struct pmc_dev *pmcdev)u32 deepest_pkgc_msr = msr_map[pmcdev->num_of_pkgc -1 ].bit_mask;u64 deepest_pkgc_residency; -if (rdmsrl_safe (deepest_pkgc_msr, &deepest_pkgc_residency)) +if (rdmsrq_safe (deepest_pkgc_msr, &deepest_pkgc_residency))return false;if (deepest_pkgc_residency == pmcdev->pkgc_res_cnt[pmcdev->num_of_pkgc -1 ])
@@ -1655,7 +1655,7 @@ int pmc_core_resume_common(struct pmc_dev *pmcdev)for (i =0 ; i < pmcdev->num_of_pkgc; i++) {u64 pc_cnt; -if (!rdmsrl_safe (msr_map[i].bit_mask, &pc_cnt)) { +if (!rdmsrq_safe (msr_map[i].bit_mask, &pc_cnt)) {dev_info (dev,"Prev %s cnt = 0x%llx, Current %s cnt = 0x%llx\n" , msr_map[i].name, pmcdev->pkgc_res_cnt[i], msr_map[i].name, pc_cnt);
drivers/platform/x86/intel/speed_select_if/isst_if_common.c +5 -5
@@ -406,7 +406,7 @@ static int isst_if_cpu_online(unsigned int cpu) isst_cpu_info[cpu].numa_node =cpu_to_node (cpu); - ret =rdmsrl_safe (MSR_CPU_BUS_NUMBER , &data); + ret =rdmsrq_safe (MSR_CPU_BUS_NUMBER , &data);if (ret) {/* This is not a fatal error on MSR mailbox only I/F */ isst_cpu_info[cpu].bus_info[0 ] =-1 ;
@@ -420,12 +420,12 @@ static int isst_if_cpu_online(unsigned int cpu)if (isst_hpm_support) { - ret =rdmsrl_safe (MSR_PM_LOGICAL_ID , &data); + ret =rdmsrq_safe (MSR_PM_LOGICAL_ID , &data);if (!ret) goto set_punit_id; } - ret =rdmsrl_safe (MSR_THREAD_ID_INFO , &data); + ret =rdmsrq_safe (MSR_THREAD_ID_INFO , &data);if (ret) { isst_cpu_info[cpu].punit_cpu_id =-1 ;return ret;
@@ -831,8 +831,8 @@ static int __init isst_if_common_init(void)u64 data;/* Can fail only on some Skylake-X generations */ -if (rdmsrl_safe (MSR_OS_MAILBOX_INTERFACE , &data) || -rdmsrl_safe (MSR_OS_MAILBOX_DATA , &data)) +if (rdmsrq_safe (MSR_OS_MAILBOX_INTERFACE , &data) || +rdmsrq_safe (MSR_OS_MAILBOX_DATA , &data))return -ENODEV ; }
drivers/platform/x86/intel/speed_select_if/isst_if_mbox_msr.c +2 -2
@@ -176,11 +176,11 @@ static int __init isst_if_mbox_init(void)return -ENODEV ;/* Check presence of mailbox MSRs */ - ret =rdmsrl_safe (MSR_OS_MAILBOX_INTERFACE , &data); + ret =rdmsrq_safe (MSR_OS_MAILBOX_INTERFACE , &data);if (ret)return ret; - ret =rdmsrl_safe (MSR_OS_MAILBOX_DATA , &data); + ret =rdmsrq_safe (MSR_OS_MAILBOX_DATA , &data);if (ret)return ret;
drivers/platform/x86/intel/tpmi_power_domains.c +2 -2
@@ -157,7 +157,7 @@ static int tpmi_get_logical_id(unsigned int cpu, struct tpmi_cpu_info *info)u64 data;int ret; - ret =rdmsrl_safe (MSR_PM_LOGICAL_ID , &data); + ret =rdmsrq_safe (MSR_PM_LOGICAL_ID , &data);if (ret)return ret;
@@ -203,7 +203,7 @@ static int __init tpmi_init(void)return -ENODEV ;/* Check for MSR 0x54 presence */ - ret =rdmsrl_safe (MSR_PM_LOGICAL_ID , &data); + ret =rdmsrq_safe (MSR_PM_LOGICAL_ID , &data);if (ret)return ret;
drivers/platform/x86/intel/turbo_max_3.c +1 -1
@@ -48,7 +48,7 @@ static int get_oc_core_priority(unsigned int cpu) }for (i =0 ; i <OC_MAILBOX_RETRY_COUNT ; ++i) { - ret =rdmsrl_safe (MSR_OC_MAILBOX , &value); + ret =rdmsrq_safe (MSR_OC_MAILBOX , &value);if (ret) {pr_debug ("cpu %d OC mailbox read failed\n" , cpu);break ;
drivers/powercap/intel_rapl_msr.c +1 -1
@@ -116,7 +116,7 @@ static void rapl_msr_update_func(void *info)struct reg_action *ra = info;u64 val; - ra->err =rdmsrl_safe (ra->reg.msr, &val); + ra->err =rdmsrq_safe (ra->reg.msr, &val);if (ra->err)return ;
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +1 -1
@@ -153,7 +153,7 @@ static ssize_t tcc_offset_degree_celsius_store(struct device *dev,u64 val;int err; - err =rdmsrl_safe (MSR_PLATFORM_INFO , &val); + err =rdmsrq_safe (MSR_PLATFORM_INFO , &val);if (err)return err;
drivers/thermal/intel/intel_powerclamp.c +2 -2
@@ -340,7 +340,7 @@ static bool has_pkg_state_counter(void)/* check if any one of the counter msrs exists */ while (info->msr_index) { -if (!rdmsrl_safe (info->msr_index, &val)) +if (!rdmsrq_safe (info->msr_index, &val))return true; info++; }
@@ -356,7 +356,7 @@ static u64 pkg_state_counter(void)while (info->msr_index) {if (!info->skip) { -if (!rdmsrl_safe (info->msr_index, &val)) +if (!rdmsrq_safe (info->msr_index, &val)) count += val;else info->skip = true;
drivers/thermal/intel/intel_tcc_cooling.c +2 -2
@@ -81,14 +81,14 @@ static int __init tcc_cooling_init(void)if (!id)return -ENODEV ; - err =rdmsrl_safe (MSR_PLATFORM_INFO , &val); + err =rdmsrq_safe (MSR_PLATFORM_INFO , &val);if (err)return err;if (!(val &TCC_PROGRAMMABLE ))return -ENODEV ; - err =rdmsrl_safe (MSR_IA32_TEMPERATURE_TARGET , &val); + err =rdmsrq_safe (MSR_IA32_TEMPERATURE_TARGET , &val);if (err)return err;
Signature · 1 line
2.45.2
PATCH 10/20 x86/msr: Rename 'wrmsrl_safe()' to 'wrmsrq_safe()'
In reply to Ingo Molnar--- arch/x86/events/core.c | 2 +- arch/x86/events/intel/core.c | 8 ++++---- arch/x86/events/intel/knc.c | 4 ++-- arch/x86/events/intel/lbr.c | 2 +- arch/x86/events/intel/p4.c | 16 ++++++++-------- arch/x86/events/intel/p6.c | 4 ++-- arch/x86/include/asm/msr.h | 4 ++-- arch/x86/kernel/cpu/amd.c | 6 +++--- arch/x86/kernel/cpu/bus_lock.c | 2 +- arch/x86/kernel/cpu/common.c | 14 +++++++------- arch/x86/kernel/cpu/mce/inject.c | 4 ++-- arch/x86/kernel/cpu/mce/intel.c | 2 +- arch/x86/kernel/cpu/resctrl/core.c | 2 +- arch/x86/kvm/svm/sev.c | 2 +- arch/x86/kvm/x86.c | 6 +++--- arch/x86/lib/msr.c | 2 +- drivers/cpufreq/intel_pstate.c | 2 +- .../platform/x86/intel/speed_select_if/isst_if_common.c | 2 +- drivers/platform/x86/intel/turbo_max_3.c | 2 +- drivers/powercap/intel_rapl_msr.c | 2 +- drivers/thermal/intel/therm_throt.c | 2 +- 21 files changed, 45 insertions(+), 45 deletions(-)
arch/x86/events/core.c +1 -1
@@ -317,7 +317,7 @@ bool check_hw_exists(struct pmu *pmu, unsigned long *cntr_mask,if (rdmsrq_safe (reg, &val)) goto msr_fail; val ^=0xffffUL ; - ret =wrmsrl_safe (reg, val); + ret =wrmsrq_safe (reg, val); ret |=rdmsrq_safe (reg, &val_new);if (ret || val != val_new) goto msr_fail;
arch/x86/events/intel/core.c +4 -4
@@ -2976,13 +2976,13 @@ static void intel_pmu_reset(void)pr_info ("clearing PMU state on CPU#%d\n" ,smp_processor_id ());for_each_set_bit (idx, cntr_mask,INTEL_PMC_MAX_GENERIC ) { -wrmsrl_safe (x86_pmu_config_addr (idx),0ull ); -wrmsrl_safe (x86_pmu_event_addr (idx),0ull ); +wrmsrq_safe (x86_pmu_config_addr (idx),0ull ); +wrmsrq_safe (x86_pmu_event_addr (idx),0ull ); }for_each_set_bit (idx, fixed_cntr_mask,INTEL_PMC_MAX_FIXED ) {if (fixed_counter_disabled (idx, cpuc->pmu))continue ; -wrmsrl_safe (x86_pmu_fixed_ctr_addr (idx),0ull ); +wrmsrq_safe (x86_pmu_fixed_ctr_addr (idx),0ull ); }if (ds)
@@ -5621,7 +5621,7 @@ static bool check_msr(unsigned long msr, u64 mask)if (is_lbr_from (msr)) val_tmp =lbr_from_signext_quirk_wr (val_tmp); -if (wrmsrl_safe (msr, val_tmp) || +if (wrmsrq_safe (msr, val_tmp) ||rdmsrq_safe (msr, &val_new))return false;
arch/x86/events/intel/knc.c +2 -2
@@ -182,7 +182,7 @@ knc_pmu_disable_event(struct perf_event *event) val = hwc->config; val &= ~ARCH_PERFMON_EVENTSEL_ENABLE ; - (void )wrmsrl_safe (hwc->config_base + hwc->idx, val); + (void )wrmsrq_safe (hwc->config_base + hwc->idx, val); }static void knc_pmu_enable_event (struct perf_event *event)
@@ -193,7 +193,7 @@ static void knc_pmu_enable_event(struct perf_event *event) val = hwc->config; val |=ARCH_PERFMON_EVENTSEL_ENABLE ; - (void )wrmsrl_safe (hwc->config_base + hwc->idx, val); + (void )wrmsrq_safe (hwc->config_base + hwc->idx, val); }static inline u64 knc_pmu_get_status (void )
arch/x86/events/intel/lbr.c +1 -1
@@ -1602,7 +1602,7 @@ void __init intel_pmu_arch_lbr_init(void) goto clear_arch_lbr;/* Apply the max depth of Arch LBR */ -if (wrmsrl_safe (MSR_ARCH_LBR_DEPTH , lbr_nr)) +if (wrmsrq_safe (MSR_ARCH_LBR_DEPTH , lbr_nr)) goto clear_arch_lbr; x86_pmu.lbr_depth_mask = eax.split.lbr_depth_mask;
arch/x86/events/intel/p4.c +8 -8
@@ -897,8 +897,8 @@ static void p4_pmu_disable_pebs(void)* So at moment let leave metrics turned on forever -- it's * ok for now but need to be revisited! * -* (void)wrmsrl_safe(MSR_IA32_PEBS_ENABLE, 0); -* (void)wrmsrl_safe(MSR_P4_PEBS_MATRIX_VERT, 0); +* (void)wrmsrq_safe(MSR_IA32_PEBS_ENABLE, 0); +* (void)wrmsrq_safe(MSR_P4_PEBS_MATRIX_VERT, 0); */ }
@@ -911,7 +911,7 @@ static inline void p4_pmu_disable_event(struct perf_event *event)* state we need to clear P4_CCCR_OVF, otherwise interrupt get * asserted again and again */ - (void )wrmsrl_safe (hwc->config_base, + (void )wrmsrq_safe (hwc->config_base,p4_config_unpack_cccr (hwc->config) & ~P4_CCCR_ENABLE & ~P4_CCCR_OVF & ~P4_CCCR_RESERVED ); }
@@ -944,8 +944,8 @@ static void p4_pmu_enable_pebs(u64 config) bind = &p4_pebs_bind_map[idx]; - (void )wrmsrl_safe (MSR_IA32_PEBS_ENABLE , (u64 )bind->metric_pebs); - (void )wrmsrl_safe (MSR_P4_PEBS_MATRIX_VERT , (u64 )bind->metric_vert); + (void )wrmsrq_safe (MSR_IA32_PEBS_ENABLE , (u64 )bind->metric_pebs); + (void )wrmsrq_safe (MSR_P4_PEBS_MATRIX_VERT , (u64 )bind->metric_vert); }static void __p4_pmu_enable_event (struct perf_event *event)
@@ -979,8 +979,8 @@ static void __p4_pmu_enable_event(struct perf_event *event)*/ p4_pmu_enable_pebs (hwc->config); - (void )wrmsrl_safe (escr_addr, escr_conf); - (void )wrmsrl_safe (hwc->config_base, + (void )wrmsrq_safe (escr_addr, escr_conf); + (void )wrmsrq_safe (hwc->config_base, (cccr & ~P4_CCCR_RESERVED ) |P4_CCCR_ENABLE ); }
@@ -1398,7 +1398,7 @@ __init int p4_pmu_init(void)*/ for_each_set_bit (i, x86_pmu.cntr_mask,X86_PMC_IDX_MAX ) { reg =x86_pmu_config_addr (i); -wrmsrl_safe (reg,0ULL ); +wrmsrq_safe (reg,0ULL ); }return 0 ;
arch/x86/events/intel/p6.c +2 -2
@@ -163,7 +163,7 @@ p6_pmu_disable_event(struct perf_event *event)struct hw_perf_event *hwc = &event->hw;u64 val =P6_NOP_EVENT ; - (void )wrmsrl_safe (hwc->config_base, val); + (void )wrmsrq_safe (hwc->config_base, val); }static void p6_pmu_enable_event (struct perf_event *event)
@@ -180,7 +180,7 @@ static void p6_pmu_enable_event(struct perf_event *event)* to actually enable the events. */ - (void )wrmsrl_safe (hwc->config_base, val); + (void )wrmsrq_safe (hwc->config_base, val); }PMU_FORMAT_ATTR (event,"config:0-7" );
arch/x86/include/asm/msr.h +2 -2
@@ -316,7 +316,7 @@ static __always_inline void wrmsrns(u32 msr, u64 val)/* * 64-bit version of wrmsr_safe(): */ -static inline int wrmsrl_safe (u32 msr,u64 val) +static inline int wrmsrq_safe (u32 msr,u64 val) {return wrmsr_safe (msr, (u32 )val, (u32)(val >>32 )); }
@@ -385,7 +385,7 @@ static inline int rdmsrl_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 *q) }static inline int wrmsrl_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 q) { -return wrmsrl_safe (msr_no, q); +return wrmsrq_safe (msr_no, q); }static inline int rdmsr_safe_regs_on_cpu (unsigned int cpu,u32 regs[8 ]) {
arch/x86/kernel/cpu/amd.c +3 -3
@@ -612,7 +612,7 @@ static void early_init_amd(struct cpuinfo_x86 *c)if (!cpu_has (c,X86_FEATURE_HYPERVISOR ) && !cpu_has (c,X86_FEATURE_IBPB_BRTYPE )) {if (c->x86 ==0x17 &&boot_cpu_has (X86_FEATURE_AMD_IBPB ))setup_force_cpu_cap (X86_FEATURE_IBPB_BRTYPE ); -else if (c->x86 >=0x19 && !wrmsrl_safe (MSR_IA32_PRED_CMD ,PRED_CMD_SBPB )) { +else if (c->x86 >=0x19 && !wrmsrq_safe (MSR_IA32_PRED_CMD ,PRED_CMD_SBPB )) {setup_force_cpu_cap (X86_FEATURE_IBPB_BRTYPE );setup_force_cpu_cap (X86_FEATURE_SBPB ); }
@@ -790,7 +790,7 @@ static void init_amd_bd(struct cpuinfo_x86 *c)if ((c->x86_model >=0x02 ) && (c->x86_model <0x20 )) {if (!rdmsrq_safe (MSR_F15H_IC_CFG , &value) && !(value &0x1E )) { value |=0x1E ; -wrmsrl_safe (MSR_F15H_IC_CFG , value); +wrmsrq_safe (MSR_F15H_IC_CFG , value); } }
@@ -840,7 +840,7 @@ void init_spectral_chicken(struct cpuinfo_x86 *c)if (!cpu_has (c,X86_FEATURE_HYPERVISOR )) {if (!rdmsrq_safe (MSR_ZEN2_SPECTRAL_CHICKEN , &value)) { value |=MSR_ZEN2_SPECTRAL_CHICKEN_BIT ; -wrmsrl_safe (MSR_ZEN2_SPECTRAL_CHICKEN , value); +wrmsrq_safe (MSR_ZEN2_SPECTRAL_CHICKEN , value); } }#endif
arch/x86/kernel/cpu/bus_lock.c +1 -1
@@ -101,7 +101,7 @@ static bool split_lock_verify_msr(bool on) ctrl |=MSR_TEST_CTRL_SPLIT_LOCK_DETECT ; else ctrl &= ~MSR_TEST_CTRL_SPLIT_LOCK_DETECT; -if (wrmsrl_safe (MSR_TEST_CTRL , ctrl)) +if (wrmsrq_safe (MSR_TEST_CTRL , ctrl))return false;rdmsrq (MSR_TEST_CTRL , tmp);return ctrl == tmp;
arch/x86/kernel/cpu/common.c +7 -7
@@ -158,7 +158,7 @@ static void ppin_init(struct cpuinfo_x86 *c)/* If PPIN is disabled, try to enable */ if (!(val &2UL )) { -wrmsrl_safe (info->msr_ppin_ctl, val |2UL ); +wrmsrq_safe (info->msr_ppin_ctl, val |2UL );rdmsrq_safe (info->msr_ppin_ctl, &val); }
@@ -2114,15 +2114,15 @@ static inline void idt_syscall_init(void)* This does not cause SYSENTER to jump to the wrong location, because * AMD doesn't allow SYSENTER in long mode (either 32- or 64-bit). */ -wrmsrl_safe (MSR_IA32_SYSENTER_CS , (u64 )__KERNEL_CS); -wrmsrl_safe (MSR_IA32_SYSENTER_ESP , +wrmsrq_safe (MSR_IA32_SYSENTER_CS , (u64 )__KERNEL_CS); +wrmsrq_safe (MSR_IA32_SYSENTER_ESP , (unsigned long )(cpu_entry_stack (smp_processor_id ()) +1 )); -wrmsrl_safe (MSR_IA32_SYSENTER_EIP , (u64 )entry_SYSENTER_compat); +wrmsrq_safe (MSR_IA32_SYSENTER_EIP , (u64 )entry_SYSENTER_compat); }else {wrmsrl_cstar ((unsigned long )entry_SYSCALL32_ignore); -wrmsrl_safe (MSR_IA32_SYSENTER_CS , (u64 )GDT_ENTRY_INVALID_SEG ); -wrmsrl_safe (MSR_IA32_SYSENTER_ESP ,0ULL ); -wrmsrl_safe (MSR_IA32_SYSENTER_EIP ,0ULL ); +wrmsrq_safe (MSR_IA32_SYSENTER_CS , (u64 )GDT_ENTRY_INVALID_SEG ); +wrmsrq_safe (MSR_IA32_SYSENTER_ESP ,0ULL ); +wrmsrq_safe (MSR_IA32_SYSENTER_EIP ,0ULL ); }/*
arch/x86/kernel/cpu/mce/inject.c +2 -2
@@ -747,9 +747,9 @@ static void check_hw_inj_possible(void)toggle_hw_mce_inject (cpu, true); -wrmsrl_safe (mca_msr_reg (bank,MCA_STATUS ), status); +wrmsrq_safe (mca_msr_reg (bank,MCA_STATUS ), status);rdmsrq_safe (mca_msr_reg (bank,MCA_STATUS ), &status); -wrmsrl_safe (mca_msr_reg (bank,MCA_STATUS ),0 ); +wrmsrq_safe (mca_msr_reg (bank,MCA_STATUS ),0 );if (!status) { hw_injection_possible = false;
arch/x86/kernel/cpu/mce/intel.c +1 -1
@@ -463,7 +463,7 @@ static void intel_imc_init(struct cpuinfo_x86 *c)if (rdmsrq_safe (MSR_ERROR_CONTROL , &error_control))return ; error_control |=2 ; -wrmsrl_safe (MSR_ERROR_CONTROL , error_control); +wrmsrq_safe (MSR_ERROR_CONTROL , error_control);break ; } }
arch/x86/kernel/cpu/resctrl/core.c +1 -1
@@ -145,7 +145,7 @@ static inline void cache_alloc_hsw_probe(void)struct rdt_resource *r = &hw_res->r_resctrl;u64 max_cbm =BIT_ULL_MASK (20 ) -1 , l3_cbm_0; -if (wrmsrl_safe (MSR_IA32_L3_CBM_BASE , max_cbm)) +if (wrmsrq_safe (MSR_IA32_L3_CBM_BASE , max_cbm))return ;rdmsrq (MSR_IA32_L3_CBM_BASE , l3_cbm_0);
arch/x86/kvm/svm/sev.c +1 -1
@@ -3119,7 +3119,7 @@ static void sev_flush_encrypted_page(struct kvm_vcpu *vcpu, void *va)* back to WBINVD if this faults so as not to make any problems worse * by leaving stale encrypted data in the cache. */ -if (WARN_ON_ONCE (wrmsrl_safe (MSR_AMD64_VM_PAGE_FLUSH , addr | asid))) +if (WARN_ON_ONCE (wrmsrq_safe (MSR_AMD64_VM_PAGE_FLUSH , addr | asid))) goto do_wbinvd;return ;
arch/x86/kvm/x86.c +3 -3
@@ -593,7 +593,7 @@ static int kvm_probe_user_return_msr(u32 msr) ret =rdmsrq_safe (msr, &val);if (ret) goto out; - ret =wrmsrl_safe (msr, val); + ret =wrmsrq_safe (msr, val); out:preempt_enable ();return ret;
@@ -644,7 +644,7 @@ int kvm_set_user_return_msr(unsigned slot, u64 value, u64 mask) value = (value & mask) | (msrs->values[slot].host & ~mask);if (value == msrs->values[slot].curr)return 0 ; - err =wrmsrl_safe (kvm_uret_msrs_list[slot], value); + err =wrmsrq_safe (kvm_uret_msrs_list[slot], value);if (err)return 1 ;
@@ -13654,7 +13654,7 @@ int kvm_spec_ctrl_test_value(u64 value)if (rdmsrq_safe (MSR_IA32_SPEC_CTRL , &saved_value)) ret =1 ; -else if (wrmsrl_safe (MSR_IA32_SPEC_CTRL , value)) +else if (wrmsrq_safe (MSR_IA32_SPEC_CTRL , value)) ret =1 ;else wrmsrq (MSR_IA32_SPEC_CTRL , saved_value);
arch/x86/lib/msr.c +1 -1
@@ -58,7 +58,7 @@ static int msr_read(u32 msr, struct msr *m)*/ static int msr_write (u32 msr,struct msr *m) { -return wrmsrl_safe (msr, m->q); +return wrmsrq_safe (msr, m->q); }static inline int __flip_bit (u32 msr,u8 bit,bool set)
drivers/cpufreq/intel_pstate.c +1 -1
@@ -1894,7 +1894,7 @@ void notify_hwp_interrupt(void)return ; ack_intr: -wrmsrl_safe (MSR_HWP_STATUS ,0 ); +wrmsrq_safe (MSR_HWP_STATUS ,0 );raw_spin_unlock_irqrestore (&hwp_notify_lock, flags); }
drivers/platform/x86/intel/speed_select_if/isst_if_common.c +1 -1
@@ -211,7 +211,7 @@ static void isst_restore_msr_local(int cpu)hash_for_each_possible (isst_hash, sst_cmd, hnode, punit_msr_white_list[i]) {if (!sst_cmd->mbox_cmd_type && sst_cmd->cpu == cpu) -wrmsrl_safe (sst_cmd->cmd, sst_cmd->data); +wrmsrq_safe (sst_cmd->cmd, sst_cmd->data); } }mutex_unlock (&isst_hash_lock);
drivers/platform/x86/intel/turbo_max_3.c +1 -1
@@ -41,7 +41,7 @@ static int get_oc_core_priority(unsigned int cpu) value = cmd <<MSR_OC_MAILBOX_CMD_OFFSET ;/* Set the busy bit to indicate OS is trying to issue command */ value |=BIT_ULL (MSR_OC_MAILBOX_BUSY_BIT ); - ret =wrmsrl_safe (MSR_OC_MAILBOX , value); + ret =wrmsrq_safe (MSR_OC_MAILBOX , value);if (ret) {pr_debug ("cpu %d OC mailbox write failed\n" , cpu);return ret;
drivers/powercap/intel_rapl_msr.c +1 -1
@@ -123,7 +123,7 @@ static void rapl_msr_update_func(void *info) val &= ~ra->mask; val |= ra->value; - ra->err =wrmsrl_safe (ra->reg.msr, val); + ra->err =wrmsrq_safe (ra->reg.msr, val); }static int rapl_msr_write_raw (int cpu,struct reg_action *ra)
drivers/thermal/intel/therm_throt.c +1 -1
@@ -643,7 +643,7 @@ static void notify_thresholds(__u64 msr_val)void __weak notify_hwp_interrupt (void ) { -wrmsrl_safe (MSR_HWP_STATUS ,0 ); +wrmsrq_safe (MSR_HWP_STATUS ,0 ); }/* Thermal transition interrupt handler */
Signature · 1 line
2.45.2
PATCH 11/20 x86/msr: Rename 'rdmsrl_safe_on_cpu()' to 'rdmsrq_safe_on_cpu()'
In reply to Ingo Molnar--- arch/x86/events/intel/pt.c | 2 +- arch/x86/include/asm/msr.h | 4 ++-- arch/x86/kernel/acpi/cppc.c | 6 +++--- arch/x86/lib/msr-smp.c | 4 ++-- drivers/cpufreq/amd-pstate-ut.c | 2 +- drivers/cpufreq/amd-pstate.c | 2 +- drivers/cpufreq/intel_pstate.c | 6 +++--- drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 2 +- drivers/powercap/intel_rapl_msr.c | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-)
arch/x86/events/intel/pt.c +1 -1
@@ -1839,7 +1839,7 @@ static __init int pt_init(void)for_each_online_cpu (cpu) {u64 ctl; - ret =rdmsrl_safe_on_cpu (cpu,MSR_IA32_RTIT_CTL , &ctl); + ret =rdmsrq_safe_on_cpu (cpu,MSR_IA32_RTIT_CTL , &ctl);if (!ret && (ctl &RTIT_CTL_TRACEEN )) prior_warn++; }
arch/x86/include/asm/msr.h +2 -2
@@ -335,7 +335,7 @@ void rdmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr __percpu *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 rdmsrl_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 *q); +int rdmsrq_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 *q);int wrmsrl_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 q);int rdmsr_safe_regs_on_cpu (unsigned int cpu,u32 regs[8 ]);int wrmsr_safe_regs_on_cpu (unsigned int cpu,u32 regs[8 ]);
@@ -379,7 +379,7 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) {return wrmsr_safe (msr_no, l, h); } -static inline int rdmsrl_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) +static inline int rdmsrq_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) {return rdmsrq_safe (msr_no, q); }
arch/x86/kernel/acpi/cppc.c +3 -3
@@ -49,7 +49,7 @@ int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val) {int err; - err =rdmsrl_safe_on_cpu (cpunum, reg->address, val); + err =rdmsrq_safe_on_cpu (cpunum, reg->address, val);if (!err) {u64 mask =GENMASK_ULL (reg->bit_offset + reg->bit_width -1 , reg->bit_offset);
@@ -65,7 +65,7 @@ int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val)u64 rd_val;int err; - err =rdmsrl_safe_on_cpu (cpunum, reg->address, &rd_val); + err =rdmsrq_safe_on_cpu (cpunum, reg->address, &rd_val);if (!err) {u64 mask =GENMASK_ULL (reg->bit_offset + reg->bit_width -1 , reg->bit_offset);
@@ -147,7 +147,7 @@ int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf)int ret;if (cpu_feature_enabled (X86_FEATURE_CPPC )) { - ret =rdmsrl_safe_on_cpu (cpu,MSR_AMD_CPPC_CAP1 , &val); + ret =rdmsrq_safe_on_cpu (cpu,MSR_AMD_CPPC_CAP1 , &val);if (ret) goto out;
arch/x86/lib/msr-smp.c +2 -2
@@ -220,7 +220,7 @@ int wrmsrl_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 q) }EXPORT_SYMBOL (wrmsrl_safe_on_cpu); -int rdmsrl_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) +int rdmsrq_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) {u32 low, high;int err;
@@ -230,7 +230,7 @@ int rdmsrl_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 *q)return err; } -EXPORT_SYMBOL (rdmsrl_safe_on_cpu); +EXPORT_SYMBOL (rdmsrq_safe_on_cpu);/* * These variants are significantly slower, but allows control over
drivers/cpufreq/amd-pstate-ut.c +1 -1
@@ -137,7 +137,7 @@ static int amd_pstate_ut_check_perf(u32 index) lowest_nonlinear_perf = cppc_perf.lowest_nonlinear_perf; lowest_perf = cppc_perf.lowest_perf; }else { - ret =rdmsrl_safe_on_cpu (cpu,MSR_AMD_CPPC_CAP1 , &cap1); + ret =rdmsrq_safe_on_cpu (cpu,MSR_AMD_CPPC_CAP1 , &cap1);if (ret) {pr_err ("%s read CPPC_CAP1 ret=%d error!\n" , __func__, ret);return ret;
drivers/cpufreq/amd-pstate.c +1 -1
@@ -391,7 +391,7 @@ static int msr_init_perf(struct amd_cpudata *cpudata)union perf_cached perf =READ_ONCE (cpudata->perf);u64 cap1, numerator; -int ret =rdmsrl_safe_on_cpu (cpudata->cpu,MSR_AMD_CPPC_CAP1 , +int ret =rdmsrq_safe_on_cpu (cpudata->cpu,MSR_AMD_CPPC_CAP1 , &cap1);if (ret)return ret;
drivers/cpufreq/intel_pstate.c +3 -3
@@ -2106,13 +2106,13 @@ static int core_get_tdp_ratio(int cpu, u64 plat_info)int err;/* Get the TDP level (0, 1, 2) to get ratios */ - err =rdmsrl_safe_on_cpu (cpu,MSR_CONFIG_TDP_CONTROL , &tdp_ctrl); + err =rdmsrq_safe_on_cpu (cpu,MSR_CONFIG_TDP_CONTROL , &tdp_ctrl);if (err)return err;/* TDP MSR are continuous starting at 0x648 */ tdp_msr =MSR_CONFIG_TDP_NOMINAL + (tdp_ctrl &0x03 ); - err =rdmsrl_safe_on_cpu (cpu, tdp_msr, &tdp_ratio); + err =rdmsrq_safe_on_cpu (cpu, tdp_msr, &tdp_ratio);if (err)return err;
@@ -2149,7 +2149,7 @@ static int core_get_max_pstate(int cpu)return tdp_ratio; } - err =rdmsrl_safe_on_cpu (cpu,MSR_TURBO_ACTIVATION_RATIO , &tar); + err =rdmsrq_safe_on_cpu (cpu,MSR_TURBO_ACTIVATION_RATIO , &tar);if (!err) {int tar_levels;
drivers/platform/x86/intel/speed_select_if/isst_if_common.c +1 -1
@@ -535,7 +535,7 @@ static long isst_if_msr_cmd_req(u8 *cmd_ptr, int *write_only, int resume) }else {u64 data; - ret =rdmsrl_safe_on_cpu (msr_cmd->logical_cpu, + ret =rdmsrq_safe_on_cpu (msr_cmd->logical_cpu, msr_cmd->msr, &data);if (!ret) { msr_cmd->data = data;
drivers/powercap/intel_rapl_msr.c +1 -1
@@ -103,7 +103,7 @@ static int rapl_cpu_down_prep(unsigned int cpu)static int rapl_msr_read_raw (int cpu,struct reg_action *ra) { -if (rdmsrl_safe_on_cpu (cpu, ra->reg.msr, &ra->value)) { +if (rdmsrq_safe_on_cpu (cpu, ra->reg.msr, &ra->value)) {pr_debug ("failed to read msr 0x%x on cpu %d\n" , ra->reg.msr, cpu);return -EIO ; }
Signature · 1 line
2.45.2
PATCH 12/20 x86/msr: Rename 'wrmsrl_safe_on_cpu()' to 'wrmsrq_safe_on_cpu()'
In reply to Ingo Molnar--- arch/x86/include/asm/msr.h | 4 ++-- arch/x86/kernel/acpi/cppc.c | 2 +- arch/x86/lib/msr-smp.c | 4 ++-- drivers/cpufreq/amd-pstate.c | 2 +- drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-)
arch/x86/include/asm/msr.h +2 -2
@@ -336,7 +336,7 @@ void wrmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr __percpu *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 wrmsrl_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 q); +int wrmsrq_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 q);int rdmsr_safe_regs_on_cpu (unsigned int cpu,u32 regs[8 ]);int wrmsr_safe_regs_on_cpu (unsigned int cpu,u32 regs[8 ]);#else /* CONFIG_SMP */
@@ -383,7 +383,7 @@ static inline int rdmsrq_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 *q) {return rdmsrq_safe (msr_no, q); } -static inline int wrmsrl_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 q) +static inline int wrmsrq_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 q) {return wrmsrq_safe (msr_no, q); }
arch/x86/kernel/acpi/cppc.c +1 -1
@@ -74,7 +74,7 @@ int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val) val &= mask; rd_val &= ~mask; rd_val |= val; - err =wrmsrl_safe_on_cpu (cpunum, reg->address, rd_val); + err =wrmsrq_safe_on_cpu (cpunum, reg->address, rd_val); }return err; }
arch/x86/lib/msr-smp.c +2 -2
@@ -204,7 +204,7 @@ int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) }EXPORT_SYMBOL (wrmsr_safe_on_cpu); -int wrmsrl_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 q) +int wrmsrq_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 q) {int err;struct msr_info rv;
@@ -218,7 +218,7 @@ int wrmsrl_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 q)return err ? err : rv.err; } -EXPORT_SYMBOL (wrmsrl_safe_on_cpu); +EXPORT_SYMBOL (wrmsrq_safe_on_cpu);int rdmsrq_safe_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) {
drivers/cpufreq/amd-pstate.c +1 -1
@@ -371,7 +371,7 @@ static int shmem_set_epp(struct cpufreq_policy *policy, u8 epp)static inline int msr_cppc_enable (struct cpufreq_policy *policy) { -return wrmsrl_safe_on_cpu (policy->cpu,MSR_AMD_CPPC_ENABLE ,1 ); +return wrmsrq_safe_on_cpu (policy->cpu,MSR_AMD_CPPC_ENABLE ,1 ); }static int shmem_cppc_enable (struct cpufreq_policy *policy)
drivers/platform/x86/intel/speed_select_if/isst_if_common.c +2 -2
@@ -191,7 +191,7 @@ void isst_resume_common(void)if (cb->registered)isst_mbox_resume_command (cb, sst_cmd); }else { -wrmsrl_safe_on_cpu (sst_cmd->cpu, sst_cmd->cmd, +wrmsrq_safe_on_cpu (sst_cmd->cpu, sst_cmd->cmd, sst_cmd->data); } }
@@ -524,7 +524,7 @@ static long isst_if_msr_cmd_req(u8 *cmd_ptr, int *write_only, int resume)if (!capable (CAP_SYS_ADMIN ))return -EPERM ; - ret =wrmsrl_safe_on_cpu (msr_cmd->logical_cpu, + ret =wrmsrq_safe_on_cpu (msr_cmd->logical_cpu, msr_cmd->msr, msr_cmd->data); *write_only =1 ;
Signature · 1 line
2.45.2
PATCH 13/20 x86/msr: Rename 'rdmsrl_on_cpu()' to 'rdmsrq_on_cpu()'
In reply to Ingo Molnar--- arch/x86/events/intel/uncore_snbep.c | 2 +- arch/x86/include/asm/msr.h | 4 ++-- arch/x86/kernel/cpu/intel_epb.c | 4 ++-- arch/x86/kernel/cpu/mce/inject.c | 4 ++-- arch/x86/lib/msr-smp.c | 4 ++-- drivers/cpufreq/acpi-cpufreq.c | 4 ++-- drivers/cpufreq/amd-pstate.c | 6 +++--- drivers/cpufreq/intel_pstate.c | 24 +++++++++++----------- .../x86/intel/uncore-frequency/uncore-frequency.c | 6 +++--- 9 files changed, 29 insertions(+), 29 deletions(-)
arch/x86/events/intel/uncore_snbep.c +1 -1
@@ -3765,7 +3765,7 @@ static int skx_msr_cpu_bus_read(int cpu, u64 *topology) {u64 msr_value; -if (rdmsrl_on_cpu (cpu,SKX_MSR_CPU_BUS_NUMBER , &msr_value) || +if (rdmsrq_on_cpu (cpu,SKX_MSR_CPU_BUS_NUMBER , &msr_value) || !(msr_value &SKX_MSR_CPU_BUS_VALID_BIT ))return -ENXIO ;
arch/x86/include/asm/msr.h +2 -2
@@ -329,7 +329,7 @@ int msr_clear_bit(u32 msr, u8 bit);#ifdef CONFIG_SMP int rdmsr_on_cpu (unsigned int cpu,u32 msr_no,u32 *l,u32 *h);int wrmsr_on_cpu (unsigned int cpu,u32 msr_no,u32 l,u32 h); -int rdmsrl_on_cpu (unsigned int cpu,u32 msr_no,u64 *q); +int rdmsrq_on_cpu (unsigned int cpu,u32 msr_no,u64 *q);int wrmsrl_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);
@@ -350,7 +350,7 @@ static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)wrmsr (msr_no, l, h);return 0 ; } -static inline int rdmsrl_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) +static inline int rdmsrq_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) {rdmsrq (msr_no, *q);return 0 ;
arch/x86/kernel/cpu/intel_epb.c +2 -2
@@ -135,7 +135,7 @@ static ssize_t energy_perf_bias_show(struct device *dev,u64 epb;int ret; - ret =rdmsrl_on_cpu (cpu,MSR_IA32_ENERGY_PERF_BIAS , &epb); + ret =rdmsrq_on_cpu (cpu,MSR_IA32_ENERGY_PERF_BIAS , &epb);if (ret <0 )return ret;
@@ -157,7 +157,7 @@ static ssize_t energy_perf_bias_store(struct device *dev,else if (kstrtou64 (buf,0 , &val) || val >MAX_EPB )return -EINVAL ; - ret =rdmsrl_on_cpu (cpu,MSR_IA32_ENERGY_PERF_BIAS , &epb); + ret =rdmsrq_on_cpu (cpu,MSR_IA32_ENERGY_PERF_BIAS , &epb);if (ret <0 )return ret;
arch/x86/kernel/cpu/mce/inject.c +2 -2
@@ -589,7 +589,7 @@ static int inj_bank_set(void *data, u64 val)u64 cap;/* Get bank count on target CPU so we can handle non-uniform values. */ -rdmsrl_on_cpu (m->extcpu,MSR_IA32_MCG_CAP , &cap); +rdmsrq_on_cpu (m->extcpu,MSR_IA32_MCG_CAP , &cap); n_banks = cap &MCG_BANKCNT_MASK ;if (val >= n_banks) {
@@ -613,7 +613,7 @@ static int inj_bank_set(void *data, u64 val)if (cpu_feature_enabled (X86_FEATURE_SMCA )) {u64 ipid; -if (rdmsrl_on_cpu (m->extcpu,MSR_AMD64_SMCA_MCx_IPID (val), &ipid)) { +if (rdmsrq_on_cpu (m->extcpu,MSR_AMD64_SMCA_MCx_IPID (val), &ipid)) {pr_err ("Error reading IPID on CPU%d\n" , m->extcpu);return -EINVAL ; }
arch/x86/lib/msr-smp.c +2 -2
@@ -47,7 +47,7 @@ int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) }EXPORT_SYMBOL (rdmsr_on_cpu); -int rdmsrl_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) +int rdmsrq_on_cpu (unsigned int cpu,u32 msr_no,u64 *q) {int err;struct msr_info rv;
@@ -60,7 +60,7 @@ int rdmsrl_on_cpu(unsigned int cpu, u32 msr_no, u64 *q)return err; } -EXPORT_SYMBOL (rdmsrl_on_cpu); +EXPORT_SYMBOL (rdmsrq_on_cpu);int wrmsr_on_cpu (unsigned int cpu,u32 msr_no,u32 l,u32 h) {
drivers/cpufreq/acpi-cpufreq.c +2 -2
@@ -79,11 +79,11 @@ static bool boost_state(unsigned int cpu)case X86_VENDOR_INTEL :case X86_VENDOR_CENTAUR :case X86_VENDOR_ZHAOXIN : -rdmsrl_on_cpu (cpu,MSR_IA32_MISC_ENABLE , &msr); +rdmsrq_on_cpu (cpu,MSR_IA32_MISC_ENABLE , &msr);return !(msr &MSR_IA32_MISC_ENABLE_TURBO_DISABLE );case X86_VENDOR_HYGON :case X86_VENDOR_AMD : -rdmsrl_on_cpu (cpu,MSR_K7_HWCR , &msr); +rdmsrq_on_cpu (cpu,MSR_K7_HWCR , &msr);return !(msr &MSR_K7_HWCR_CPB_DIS ); }return false;
drivers/cpufreq/amd-pstate.c +3 -3
@@ -197,7 +197,7 @@ static u8 msr_get_epp(struct amd_cpudata *cpudata)u64 value;int ret; - ret =rdmsrl_on_cpu (cpudata->cpu,MSR_AMD_CPPC_REQ , &value); + ret =rdmsrq_on_cpu (cpudata->cpu,MSR_AMD_CPPC_REQ , &value);if (ret <0 ) {pr_debug ("Could not retrieve energy perf value (%d)\n" , ret);return ret;
@@ -769,7 +769,7 @@ static int amd_pstate_init_boost_support(struct amd_cpudata *cpudata) goto exit_err; } - ret =rdmsrl_on_cpu (cpudata->cpu,MSR_K7_HWCR , &boost_val); + ret =rdmsrq_on_cpu (cpudata->cpu,MSR_K7_HWCR , &boost_val);if (ret) {pr_err_once ("failed to read initial CPU boost state!\n" ); ret = -EIO ;
@@ -1491,7 +1491,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) }if (cpu_feature_enabled (X86_FEATURE_CPPC )) { - ret =rdmsrl_on_cpu (cpudata->cpu,MSR_AMD_CPPC_REQ , &value); + ret =rdmsrq_on_cpu (cpudata->cpu,MSR_AMD_CPPC_REQ , &value);if (ret)return ret;WRITE_ONCE (cpudata->cppc_req_cached, value);
drivers/cpufreq/intel_pstate.c +12 -12
@@ -620,7 +620,7 @@ static s16 intel_pstate_get_epb(struct cpudata *cpu_data)if (!boot_cpu_has (X86_FEATURE_EPB ))return -ENXIO ; - ret =rdmsrl_on_cpu (cpu_data->cpu,MSR_IA32_ENERGY_PERF_BIAS , &epb); + ret =rdmsrq_on_cpu (cpu_data->cpu,MSR_IA32_ENERGY_PERF_BIAS , &epb);if (ret)return (s16 )ret;
@@ -637,7 +637,7 @@ static s16 intel_pstate_get_epp(struct cpudata *cpu_data, u64 hwp_req_data)* MSR_HWP_REQUEST, so need to read and get EPP. */ if (!hwp_req_data) { - epp =rdmsrl_on_cpu (cpu_data->cpu,MSR_HWP_REQUEST , + epp =rdmsrq_on_cpu (cpu_data->cpu,MSR_HWP_REQUEST , &hwp_req_data);if (epp)return epp;
@@ -659,7 +659,7 @@ static int intel_pstate_set_epb(int cpu, s16 pref)if (!boot_cpu_has (X86_FEATURE_EPB ))return -ENXIO ; - ret =rdmsrl_on_cpu (cpu,MSR_IA32_ENERGY_PERF_BIAS , &epb); + ret =rdmsrq_on_cpu (cpu,MSR_IA32_ENERGY_PERF_BIAS , &epb);if (ret)return ret;
@@ -916,7 +916,7 @@ static ssize_t show_base_frequency(struct cpufreq_policy *policy, char *buf)if (ratio <=0 ) {u64 cap; -rdmsrl_on_cpu (policy->cpu,MSR_HWP_CAPABILITIES , &cap); +rdmsrq_on_cpu (policy->cpu,MSR_HWP_CAPABILITIES , &cap); ratio =HWP_GUARANTEED_PERF (cap); }
@@ -1088,7 +1088,7 @@ static void __intel_pstate_get_hwp_cap(struct cpudata *cpu) {u64 cap; -rdmsrl_on_cpu (cpu->cpu,MSR_HWP_CAPABILITIES , &cap); +rdmsrq_on_cpu (cpu->cpu,MSR_HWP_CAPABILITIES , &cap);WRITE_ONCE (cpu->hwp_cap_cached, cap); cpu->pstate.max_pstate =HWP_GUARANTEED_PERF (cap); cpu->pstate.turbo_pstate =HWP_HIGHEST_PERF (cap);
@@ -1162,7 +1162,7 @@ static void intel_pstate_hwp_set(unsigned int cpu)if (cpu_data->policy ==CPUFREQ_POLICY_PERFORMANCE ) min = max; -rdmsrl_on_cpu (cpu,MSR_HWP_REQUEST , &value); +rdmsrq_on_cpu (cpu,MSR_HWP_REQUEST , &value); value &= ~HWP_MIN_PERF (~0L ); value |=HWP_MIN_PERF (min);
@@ -2084,7 +2084,7 @@ static int core_get_min_pstate(int cpu) {u64 value; -rdmsrl_on_cpu (cpu,MSR_PLATFORM_INFO , &value); +rdmsrq_on_cpu (cpu,MSR_PLATFORM_INFO , &value);return (value >>40 ) &0xFF ; }
@@ -2092,7 +2092,7 @@ static int core_get_max_pstate_physical(int cpu) {u64 value; -rdmsrl_on_cpu (cpu,MSR_PLATFORM_INFO , &value); +rdmsrq_on_cpu (cpu,MSR_PLATFORM_INFO , &value);return (value >>8 ) &0xFF ; }
@@ -2137,7 +2137,7 @@ static int core_get_max_pstate(int cpu)int tdp_ratio;int err; -rdmsrl_on_cpu (cpu,MSR_PLATFORM_INFO , &plat_info); +rdmsrq_on_cpu (cpu,MSR_PLATFORM_INFO , &plat_info); max_pstate = (plat_info >>8 ) &0xFF ; tdp_ratio =core_get_tdp_ratio (cpu, plat_info);
@@ -2169,7 +2169,7 @@ static int core_get_turbo_pstate(int cpu)u64 value;int nont, ret; -rdmsrl_on_cpu (cpu,MSR_TURBO_RATIO_LIMIT , &value); +rdmsrq_on_cpu (cpu,MSR_TURBO_RATIO_LIMIT , &value); nont =core_get_max_pstate (cpu); ret = (value) &255 ;if (ret <= nont)
@@ -2198,7 +2198,7 @@ static int knl_get_turbo_pstate(int cpu)u64 value;int nont, ret; -rdmsrl_on_cpu (cpu,MSR_TURBO_RATIO_LIMIT , &value); +rdmsrq_on_cpu (cpu,MSR_TURBO_RATIO_LIMIT , &value); nont =core_get_max_pstate (cpu); ret = (((value) >>8 ) &0xFF );if (ret <= nont)
@@ -3256,7 +3256,7 @@ static int intel_cpufreq_cpu_init(struct cpufreq_policy *policy)intel_pstate_get_hwp_cap (cpu); -rdmsrl_on_cpu (cpu->cpu,MSR_HWP_REQUEST , &value); +rdmsrq_on_cpu (cpu->cpu,MSR_HWP_REQUEST , &value);WRITE_ONCE (cpu->hwp_req_cached, value); cpu->epp_cached =intel_pstate_get_epp (cpu, value);
drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c +3 -3
@@ -51,7 +51,7 @@ static int uncore_read_control_freq(struct uncore_data *data, unsigned int *valuif (data->control_cpu <0 )return -ENXIO ; - ret =rdmsrl_on_cpu (data->control_cpu,MSR_UNCORE_RATIO_LIMIT , &cap); + ret =rdmsrq_on_cpu (data->control_cpu,MSR_UNCORE_RATIO_LIMIT , &cap);if (ret)return ret;
@@ -76,7 +76,7 @@ static int uncore_write_control_freq(struct uncore_data *data, unsigned int inpuif (data->control_cpu <0 )return -ENXIO ; - ret =rdmsrl_on_cpu (data->control_cpu,MSR_UNCORE_RATIO_LIMIT , &cap); + ret =rdmsrq_on_cpu (data->control_cpu,MSR_UNCORE_RATIO_LIMIT , &cap);if (ret)return ret;
@@ -105,7 +105,7 @@ static int uncore_read_freq(struct uncore_data *data, unsigned int *freq)if (data->control_cpu <0 )return -ENXIO ; - ret =rdmsrl_on_cpu (data->control_cpu,MSR_UNCORE_PERF_STATUS , &ratio); + ret =rdmsrq_on_cpu (data->control_cpu,MSR_UNCORE_PERF_STATUS , &ratio);if (ret)return ret;
Signature · 1 line
2.45.2
PATCH 14/20 x86/msr: Rename 'wrmsrl_on_cpu()' to 'wrmsrq_on_cpu()'
In reply to Ingo Molnar--- arch/x86/include/asm/msr.h | 4 +-- arch/x86/kernel/cpu/intel_epb.c | 2 +- arch/x86/lib/msr-smp.c | 4 +-- drivers/cpufreq/amd-pstate.c | 6 ++-- drivers/cpufreq/intel_pstate.c | 34 +++++++++++----------- .../x86/intel/uncore-frequency/uncore-frequency.c | 4 +-- 6 files changed, 27 insertions(+), 27 deletions(-)
arch/x86/include/asm/msr.h +2 -2
@@ -330,7 +330,7 @@ int msr_clear_bit(u32 msr, u8 bit);int rdmsr_on_cpu (unsigned int cpu,u32 msr_no,u32 *l,u32 *h);int wrmsr_on_cpu (unsigned int cpu,u32 msr_no,u32 l,u32 h);int rdmsrq_on_cpu (unsigned int cpu,u32 msr_no,u64 *q); -int wrmsrl_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);
@@ -355,7 +355,7 @@ static inline int rdmsrq_on_cpu(unsigned int cpu, u32 msr_no, u64 *q)rdmsrq (msr_no, *q);return 0 ; } -static inline int wrmsrl_on_cpu (unsigned int cpu,u32 msr_no,u64 q) +static inline int wrmsrq_on_cpu (unsigned int cpu,u32 msr_no,u64 q) {wrmsrq (msr_no, q);return 0 ;
arch/x86/kernel/cpu/intel_epb.c +1 -1
@@ -161,7 +161,7 @@ static ssize_t energy_perf_bias_store(struct device *dev,if (ret <0 )return ret; - ret =wrmsrl_on_cpu (cpu,MSR_IA32_ENERGY_PERF_BIAS , + ret =wrmsrq_on_cpu (cpu,MSR_IA32_ENERGY_PERF_BIAS , (epb & ~EPB_MASK ) | val);if (ret <0 )return ret;
arch/x86/lib/msr-smp.c +2 -2
@@ -78,7 +78,7 @@ int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) }EXPORT_SYMBOL (wrmsr_on_cpu); -int wrmsrl_on_cpu (unsigned int cpu,u32 msr_no,u64 q) +int wrmsrq_on_cpu (unsigned int cpu,u32 msr_no,u64 q) {int err;struct msr_info rv;
@@ -92,7 +92,7 @@ int wrmsrl_on_cpu(unsigned int cpu, u32 msr_no, u64 q)return err; } -EXPORT_SYMBOL (wrmsrl_on_cpu); +EXPORT_SYMBOL (wrmsrq_on_cpu); static void __rwmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr __percpu *msrs,
drivers/cpufreq/amd-pstate.c +3 -3
@@ -261,7 +261,7 @@ static int msr_update_perf(struct cpufreq_policy *policy, u8 min_perf,wrmsrq (MSR_AMD_CPPC_REQ , value);return 0 ; }else { -int ret =wrmsrl_on_cpu (cpudata->cpu,MSR_AMD_CPPC_REQ , value); +int ret =wrmsrq_on_cpu (cpudata->cpu,MSR_AMD_CPPC_REQ , value);if (ret)return ret;
@@ -309,7 +309,7 @@ static int msr_set_epp(struct cpufreq_policy *policy, u8 epp)if (value == prev)return 0 ; - ret =wrmsrl_on_cpu (cpudata->cpu,MSR_AMD_CPPC_REQ , value); + ret =wrmsrq_on_cpu (cpudata->cpu,MSR_AMD_CPPC_REQ , value);if (ret) {pr_err ("failed to set energy perf value (%d)\n" , ret);return ret;
@@ -788,7 +788,7 @@ static int amd_pstate_init_boost_support(struct amd_cpudata *cpudata)static void amd_perf_ctl_reset (unsigned int cpu) { -wrmsrl_on_cpu (cpu,MSR_AMD_PERF_CTL ,0 ); +wrmsrq_on_cpu (cpu,MSR_AMD_PERF_CTL ,0 ); }/*
drivers/cpufreq/intel_pstate.c +17 -17
@@ -664,7 +664,7 @@ static int intel_pstate_set_epb(int cpu, s16 pref)return ret; epb = (epb & ~0x0f ) | pref; -wrmsrl_on_cpu (cpu,MSR_IA32_ENERGY_PERF_BIAS , epb); +wrmsrq_on_cpu (cpu,MSR_IA32_ENERGY_PERF_BIAS , epb);return 0 ; }
@@ -762,7 +762,7 @@ static int intel_pstate_set_epp(struct cpudata *cpu, u32 epp)* function, so it cannot run in parallel with the update below. */ WRITE_ONCE (cpu->hwp_req_cached, value); - ret =wrmsrl_on_cpu (cpu->cpu,MSR_HWP_REQUEST , value); + ret =wrmsrq_on_cpu (cpu->cpu,MSR_HWP_REQUEST , value);if (!ret) cpu->epp_cached = epp;
@@ -1209,7 +1209,7 @@ static void intel_pstate_hwp_set(unsigned int cpu) } skip_epp:WRITE_ONCE (cpu_data->hwp_req_cached, value); -wrmsrl_on_cpu (cpu,MSR_HWP_REQUEST , value); +wrmsrq_on_cpu (cpu,MSR_HWP_REQUEST , value); }static void intel_pstate_disable_hwp_interrupt (struct cpudata *cpudata);
@@ -1256,7 +1256,7 @@ static void intel_pstate_hwp_offline(struct cpudata *cpu)if (boot_cpu_has (X86_FEATURE_HWP_EPP )) value |=HWP_ENERGY_PERF_PREFERENCE (HWP_EPP_POWERSAVE ); -wrmsrl_on_cpu (cpu->cpu,MSR_HWP_REQUEST , value); +wrmsrq_on_cpu (cpu->cpu,MSR_HWP_REQUEST , value);mutex_lock (&hybrid_capacity_lock);
@@ -1302,7 +1302,7 @@ static void intel_pstate_hwp_enable(struct cpudata *cpudata);static void intel_pstate_hwp_reenable (struct cpudata *cpu) {intel_pstate_hwp_enable (cpu); -wrmsrl_on_cpu (cpu->cpu,MSR_HWP_REQUEST ,READ_ONCE (cpu->hwp_req_cached)); +wrmsrq_on_cpu (cpu->cpu,MSR_HWP_REQUEST ,READ_ONCE (cpu->hwp_req_cached)); }static int intel_pstate_suspend (struct cpufreq_policy *policy)
@@ -1855,7 +1855,7 @@ static void intel_pstate_notify_work(struct work_struct *work)hybrid_update_capacity (cpudata); } -wrmsrl_on_cpu (cpudata->cpu,MSR_HWP_STATUS ,0 ); +wrmsrq_on_cpu (cpudata->cpu,MSR_HWP_STATUS ,0 ); }static DEFINE_RAW_SPINLOCK (hwp_notify_lock);
@@ -1905,8 +1905,8 @@ static void intel_pstate_disable_hwp_interrupt(struct cpudata *cpudata)if (!cpu_feature_enabled (X86_FEATURE_HWP_NOTIFY ))return ; -/* wrmsrl_on_cpu has to be outside spinlock as this can result in IPC */ -wrmsrl_on_cpu (cpudata->cpu,MSR_HWP_INTERRUPT ,0x00 ); +/* wrmsrq_on_cpu has to be outside spinlock as this can result in IPC */ +wrmsrq_on_cpu (cpudata->cpu,MSR_HWP_INTERRUPT ,0x00 );raw_spin_lock_irq (&hwp_notify_lock); cancel_work =cpumask_test_and_clear_cpu (cpudata->cpu, &hwp_intr_enable_mask);
@@ -1933,9 +1933,9 @@ static void intel_pstate_enable_hwp_interrupt(struct cpudata *cpudata)if (cpu_feature_enabled (X86_FEATURE_HWP_HIGHEST_PERF_CHANGE )) interrupt_mask |=HWP_HIGHEST_PERF_CHANGE_REQ ; -/* wrmsrl_on_cpu has to be outside spinlock as this can result in IPC */ -wrmsrl_on_cpu (cpudata->cpu,MSR_HWP_INTERRUPT , interrupt_mask); -wrmsrl_on_cpu (cpudata->cpu,MSR_HWP_STATUS ,0 ); +/* wrmsrq_on_cpu has to be outside spinlock as this can result in IPC */ +wrmsrq_on_cpu (cpudata->cpu,MSR_HWP_INTERRUPT , interrupt_mask); +wrmsrq_on_cpu (cpudata->cpu,MSR_HWP_STATUS ,0 ); } }
@@ -1974,9 +1974,9 @@ static void intel_pstate_hwp_enable(struct cpudata *cpudata) {/* First disable HWP notification interrupt till we activate again */ if (boot_cpu_has (X86_FEATURE_HWP_NOTIFY )) -wrmsrl_on_cpu (cpudata->cpu,MSR_HWP_INTERRUPT ,0x00 ); +wrmsrq_on_cpu (cpudata->cpu,MSR_HWP_INTERRUPT ,0x00 ); -wrmsrl_on_cpu (cpudata->cpu,MSR_PM_ENABLE ,0x1 ); +wrmsrq_on_cpu (cpudata->cpu,MSR_PM_ENABLE ,0x1 );intel_pstate_enable_hwp_interrupt (cpudata);
@@ -2244,7 +2244,7 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate)* the CPU being updated, so force the register update to run on the * right CPU. */ -wrmsrl_on_cpu (cpu->cpu,MSR_IA32_PERF_CTL , +wrmsrq_on_cpu (cpu->cpu,MSR_IA32_PERF_CTL , pstate_funcs.get_val (cpu, pstate)); }
@@ -3102,7 +3102,7 @@ static void intel_cpufreq_hwp_update(struct cpudata *cpu, u32 min, u32 max,if (fast_switch)wrmsrq (MSR_HWP_REQUEST , value);else -wrmsrl_on_cpu (cpu->cpu,MSR_HWP_REQUEST , value); +wrmsrq_on_cpu (cpu->cpu,MSR_HWP_REQUEST , value); } static void intel_cpufreq_perf_ctl_update(struct cpudata *cpu,
@@ -3112,7 +3112,7 @@ static void intel_cpufreq_perf_ctl_update(struct cpudata *cpu,wrmsrq (MSR_IA32_PERF_CTL , pstate_funcs.get_val (cpu, target_pstate)); else - wrmsrl_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL, + wrmsrq_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, target_pstate)); }
@@ -3323,7 +3323,7 @@ static int intel_cpufreq_suspend(struct cpufreq_policy *policy)* written by it may not be suitable. */ value &= ~HWP_DESIRED_PERF (~0L ); -wrmsrl_on_cpu (cpu->cpu,MSR_HWP_REQUEST , value); +wrmsrq_on_cpu (cpu->cpu,MSR_HWP_REQUEST , value);WRITE_ONCE (cpu->hwp_req_cached, value); }
drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c +2 -2
@@ -88,7 +88,7 @@ static int uncore_write_control_freq(struct uncore_data *data, unsigned int inpu cap |=FIELD_PREP (UNCORE_MIN_RATIO_MASK , input); } - ret =wrmsrl_on_cpu (data->control_cpu,MSR_UNCORE_RATIO_LIMIT , cap); + ret =wrmsrq_on_cpu (data->control_cpu,MSR_UNCORE_RATIO_LIMIT , cap);if (ret)return ret;
@@ -207,7 +207,7 @@ static int uncore_pm_notify(struct notifier_block *nb, unsigned long mode,if (!data || !data->valid || !data->stored_uncore_data)return 0 ; -wrmsrl_on_cpu (data->control_cpu,MSR_UNCORE_RATIO_LIMIT , +wrmsrq_on_cpu (data->control_cpu,MSR_UNCORE_RATIO_LIMIT , data->stored_uncore_data); }break ;
Signature · 1 line
2.45.2
PATCH 15/20 x86/msr: Rename 'mce_rdmsrl()' to 'mce_rdmsrq()'
In reply to Ingo Molnar--- arch/x86/kernel/cpu/mce/core.c | 32 ++++++++++++++++---------------- arch/x86/kernel/cpu/mce/internal.h | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-)
arch/x86/kernel/cpu/mce/core.c +16 -16
@@ -388,7 +388,7 @@ void ex_handler_msr_mce(struct pt_regs *regs, bool wrmsr) }/* MSR access wrappers used for error injection */ -noinstr u64 mce_rdmsrl(u32 msr) +noinstr u64 mce_rdmsrq(u32 msr) {DECLARE_ARGS (val, low, high);
@@ -444,7 +444,7 @@ static noinstr void mce_wrmsrl(u32 msr, u64 v) low = (u32 )v; high = (u32)(v >>32 ); -/* See comment in mce_rdmsrl() */ +/* See comment in mce_rdmsrq() */ asmvolatile ("1: wrmsr\n" "2:\n" _ASM_EXTABLE_TYPE(1b, 2b, EX_TYPE_WRMSR_IN_MCE)
@@ -468,7 +468,7 @@ static noinstr void mce_gather_info(struct mce_hw_err *err, struct pt_regs *regsinstrumentation_end (); m = &err->m; - m->mcgstatus =mce_rdmsrl (MSR_IA32_MCG_STATUS ); + m->mcgstatus =mce_rdmsrq (MSR_IA32_MCG_STATUS );if (regs) {/* * Get the address of the instruction at the time of
@@ -488,7 +488,7 @@ static noinstr void mce_gather_info(struct mce_hw_err *err, struct pt_regs *regs }/* Use accurate RIP reporting if available. */ if (mca_cfg.rip_msr) - m->ip =mce_rdmsrl (mca_cfg.rip_msr); + m->ip =mce_rdmsrq (mca_cfg.rip_msr); } }
@@ -684,10 +684,10 @@ static noinstr void mce_read_aux(struct mce_hw_err *err, int i)struct mce *m = &err->m;if (m->status &MCI_STATUS_MISCV ) - m->misc =mce_rdmsrl (mca_msr_reg (i,MCA_MISC )); + m->misc =mce_rdmsrq (mca_msr_reg (i,MCA_MISC ));if (m->status &MCI_STATUS_ADDRV ) { - m->addr =mce_rdmsrl (mca_msr_reg (i,MCA_ADDR )); + m->addr =mce_rdmsrq (mca_msr_reg (i,MCA_ADDR ));/* * Mask the reported address by the reported granularity.
@@ -702,12 +702,12 @@ static noinstr void mce_read_aux(struct mce_hw_err *err, int i) }if (mce_flags.smca) { - m->ipid =mce_rdmsrl (MSR_AMD64_SMCA_MCx_IPID (i)); + m->ipid =mce_rdmsrq (MSR_AMD64_SMCA_MCx_IPID (i));if (m->status &MCI_STATUS_SYNDV ) { - m->synd =mce_rdmsrl (MSR_AMD64_SMCA_MCx_SYND (i)); - err->vendor.amd.synd1 =mce_rdmsrl (MSR_AMD64_SMCA_MCx_SYND1 (i)); - err->vendor.amd.synd2 =mce_rdmsrl (MSR_AMD64_SMCA_MCx_SYND2 (i)); + m->synd =mce_rdmsrq (MSR_AMD64_SMCA_MCx_SYND (i)); + err->vendor.amd.synd1 =mce_rdmsrq (MSR_AMD64_SMCA_MCx_SYND1 (i)); + err->vendor.amd.synd2 =mce_rdmsrq (MSR_AMD64_SMCA_MCx_SYND2 (i)); } } }
@@ -753,7 +753,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b) m->bank = i;barrier (); - m->status =mce_rdmsrl (mca_msr_reg (i,MCA_STATUS )); + m->status =mce_rdmsrq (mca_msr_reg (i,MCA_STATUS ));/* * Update storm tracking here, before checking for the
@@ -887,8 +887,8 @@ quirk_sandybridge_ifu(int bank, struct mce *m, struct pt_regs *regs)*/ static noinstr bool quirk_skylake_repmov(void) { -u64 mcgstatus =mce_rdmsrl (MSR_IA32_MCG_STATUS ); -u64 misc_enable =mce_rdmsrl (MSR_IA32_MISC_ENABLE ); +u64 mcgstatus =mce_rdmsrq (MSR_IA32_MCG_STATUS ); +u64 misc_enable =mce_rdmsrq (MSR_IA32_MISC_ENABLE );u64 mc1_status;/*
@@ -899,7 +899,7 @@ static noinstr bool quirk_skylake_repmov(void) !(misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING))return false; - mc1_status =mce_rdmsrl (MSR_IA32_MCx_STATUS (1 )); + mc1_status =mce_rdmsrq (MSR_IA32_MCx_STATUS (1 ));/* Check for a software-recoverable data fetch error. */ if ((mc1_status &
@@ -955,7 +955,7 @@ static __always_inline int mce_no_way_out(struct mce_hw_err *err, char **msg, unint i;for (i =0 ; i <this_cpu_read (mce_num_banks); i++) { - m->status =mce_rdmsrl (mca_msr_reg (i,MCA_STATUS )); + m->status =mce_rdmsrq (mca_msr_reg (i,MCA_STATUS ));if (!(m->status &MCI_STATUS_VAL ))continue ;
@@ -1335,7 +1335,7 @@ __mc_scan_banks(struct mce_hw_err *err, struct pt_regs *regs, m->addr =0 ; m->bank = i; - m->status =mce_rdmsrl (mca_msr_reg (i,MCA_STATUS )); + m->status =mce_rdmsrq (mca_msr_reg (i,MCA_STATUS ));if (!(m->status &MCI_STATUS_VAL ))continue ;
arch/x86/kernel/cpu/mce/internal.h +1 -1
@@ -312,7 +312,7 @@ static __always_inline void pentium_machine_check(struct pt_regs *regs) {} static __always_inline void winchip_machine_check(struct pt_regs *regs) {}#endif -noinstr u64 mce_rdmsrl(u32 msr); +noinstr u64 mce_rdmsrq(u32 msr); static __always_inline u32 mca_msr_reg(int bank, enum mca_msr reg) {
Signature · 1 line
2.45.2
PATCH 16/20 x86/msr: Rename 'mce_wrmsrl()' to 'mce_wrmsrq()'
In reply to Ingo Molnar--- arch/x86/kernel/cpu/mce/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/mce/core.c +6 -6
@@ -423,7 +423,7 @@ noinstr u64 mce_rdmsrq(u32 msr)return EAX_EDX_VAL (val, low, high); } -static noinstr void mce_wrmsrl(u32 msr, u64 v) +static noinstr void mce_wrmsrq(u32 msr, u64 v) {u32 low, high;
@@ -829,7 +829,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)/* * Clear state for this bank. */ -mce_wrmsrl (mca_msr_reg (i,MCA_STATUS ),0 ); +mce_wrmsrq (mca_msr_reg (i,MCA_STATUS ),0 ); }/*
@@ -910,8 +910,8 @@ static noinstr bool quirk_skylake_repmov(void) MCI_STATUS_ADDRV | MCI_STATUS_MISCV | MCI_STATUS_AR | MCI_STATUS_S)) { misc_enable &= ~MSR_IA32_MISC_ENABLE_FAST_STRING ; -mce_wrmsrl (MSR_IA32_MISC_ENABLE , misc_enable); -mce_wrmsrl (MSR_IA32_MCx_STATUS (1 ),0 ); +mce_wrmsrq (MSR_IA32_MISC_ENABLE , misc_enable); +mce_wrmsrq (MSR_IA32_MCx_STATUS (1 ),0 );instrumentation_begin ();pr_err_once ("Erratum detected, disable fast string copy instructions.\n" );
@@ -1274,7 +1274,7 @@ static __always_inline void mce_clear_state(unsigned long *toclear)for (i =0 ; i <this_cpu_read (mce_num_banks); i++) {if (arch_test_bit (i, toclear)) -mce_wrmsrl (mca_msr_reg (i,MCA_STATUS ),0 ); +mce_wrmsrq (mca_msr_reg (i,MCA_STATUS ),0 ); } }
@@ -1693,7 +1693,7 @@ noinstr void do_machine_check(struct pt_regs *regs)instrumentation_end (); clear: -mce_wrmsrl (MSR_IA32_MCG_STATUS ,0 ); +mce_wrmsrq (MSR_IA32_MCG_STATUS ,0 ); }EXPORT_SYMBOL_GPL (do_machine_check);
Signature · 1 line
2.45.2
PATCH 17/20 x86/msr: Rename 'rdmsrl_amd_safe()' to 'rdmsrq_amd_safe()'
In reply to Ingo Molnar--- arch/x86/kernel/cpu/amd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/amd.c +2 -2
@@ -31,7 +31,7 @@u16 invlpgb_count_max__ro_after_init ; -static inline int rdmsrl_amd_safe (unsigned msr,u64 *p) +static inline int rdmsrq_amd_safe (unsigned msr,u64 *p) {u32 gprs[8 ] = {0 };int err;
@@ -636,7 +636,7 @@ static void init_amd_k8(struct cpuinfo_x86 *c)*/ if (c->x86_model <0x14 &&cpu_has (c,X86_FEATURE_LAHF_LM ) && !cpu_has (c,X86_FEATURE_HYPERVISOR )) {clear_cpu_cap (c,X86_FEATURE_LAHF_LM ); -if (!rdmsrl_amd_safe (0xc001100d , &value)) { +if (!rdmsrq_amd_safe (0xc001100d , &value)) { value &= ~BIT_64 (32 );wrmsrl_amd_safe (0xc001100d , value); }
Signature · 1 line
2.45.2
PATCH 18/20 x86/msr: Rename 'wrmsrl_amd_safe()' to 'wrmsrq_amd_safe()'
In reply to Ingo Molnar--- arch/x86/kernel/cpu/amd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/amd.c +2 -2
@@ -49,7 +49,7 @@ static inline int rdmsrq_amd_safe(unsigned msr, u64 *p)return err; } -static inline int wrmsrl_amd_safe (unsigned msr,u64 val) +static inline int wrmsrq_amd_safe (unsigned msr,u64 val) {u32 gprs[8 ] = {0 };
@@ -638,7 +638,7 @@ static void init_amd_k8(struct cpuinfo_x86 *c)clear_cpu_cap (c,X86_FEATURE_LAHF_LM );if (!rdmsrq_amd_safe (0xc001100d , &value)) { value &= ~BIT_64 (32 ); -wrmsrl_amd_safe (0xc001100d , value); +wrmsrq_amd_safe (0xc001100d , value); } }
Signature · 1 line
2.45.2
PATCH 19/20 x86/msr: Rename 'native_wrmsrl()' to 'native_wrmsrq()'
In reply to Ingo Molnar--- arch/x86/hyperv/ivm.c | 2 +- arch/x86/include/asm/microcode.h | 2 +- arch/x86/include/asm/msr.h | 2 +- arch/x86/include/asm/spec-ctrl.h | 2 +- arch/x86/kernel/cpu/microcode/amd.c | 2 +- arch/x86/kernel/cpu/microcode/intel.c | 2 +- arch/x86/kvm/vmx/vmx.c | 8 ++++---- 7 files changed, 10 insertions(+), 10 deletions(-)
arch/x86/hyperv/ivm.c +1 -1
@@ -115,7 +115,7 @@ static inline u64 rd_ghcb_msr(void)static inline void wr_ghcb_msr (u64 val) { -native_wrmsrl (MSR_AMD64_SEV_ES_GHCB , val); +native_wrmsrq (MSR_AMD64_SEV_ES_GHCB , val); } static enum es_result hv_ghcb_hv_call(struct ghcb *ghcb, u64 exit_code,
arch/x86/include/asm/microcode.h +1 -1
@@ -61,7 +61,7 @@ static inline u32 intel_get_microcode_revision(void) {u32 rev, dummy; -native_wrmsrl (MSR_IA32_UCODE_REV ,0 ); +native_wrmsrq (MSR_IA32_UCODE_REV ,0 );/* As documented in the SDM: Do a CPUID 1 here */ native_cpuid_eax (1 );
arch/x86/include/asm/msr.h +1 -1
@@ -109,7 +109,7 @@ do { \#define native_wrmsr (msr, low, high) \ __wrmsr(msr, low, high) -#define native_wrmsrl (msr, val) \ +#define native_wrmsrq (msr, val) \ __wrmsr((msr), (u32)((u64)(val)), \ (u32)((u64)(val) >> 32))
arch/x86/include/asm/spec-ctrl.h +1 -1
@@ -84,7 +84,7 @@ static inline u64 ssbd_tif_to_amd_ls_cfg(u64 tifn) static __always_inline void __update_spec_ctrl(u64 val) {__this_cpu_write (x86_spec_ctrl_current, val); -native_wrmsrl (MSR_IA32_SPEC_CTRL , val); +native_wrmsrq (MSR_IA32_SPEC_CTRL , val); }#ifdef CONFIG_SMP
arch/x86/kernel/cpu/microcode/amd.c +1 -1
@@ -602,7 +602,7 @@ static bool __apply_microcode_amd(struct microcode_amd *mc, u32 *cur_rev,if (!verify_sha256_digest (mc->hdr.patch_id, *cur_rev, (const u8 *)p_addr, psize))return false; -native_wrmsrl (MSR_AMD64_PATCH_LOADER , p_addr); +native_wrmsrq (MSR_AMD64_PATCH_LOADER , p_addr);if (x86_family (bsp_cpuid_1_eax) ==0x17 ) {unsigned long p_addr_end = p_addr + psize -1 ;
arch/x86/kernel/cpu/microcode/intel.c +1 -1
@@ -320,7 +320,7 @@ static enum ucode_state __apply_microcode(struct ucode_cpu_info *uci, }/* write microcode via MSR 0x79 */ -native_wrmsrl (MSR_IA32_UCODE_WRITE , (unsigned long )mc->bits); +native_wrmsrq (MSR_IA32_UCODE_WRITE , (unsigned long )mc->bits); rev =intel_get_microcode_revision ();if (rev != mc->hdr.rev)
arch/x86/kvm/vmx/vmx.c +4 -4
@@ -382,7 +382,7 @@ static __always_inline void vmx_disable_fb_clear(struct vcpu_vmx *vmx) msr =__rdmsr (MSR_IA32_MCU_OPT_CTRL ); msr |=FB_CLEAR_DIS ; -native_wrmsrl (MSR_IA32_MCU_OPT_CTRL , msr); +native_wrmsrq (MSR_IA32_MCU_OPT_CTRL , msr);/* Cache the MSR value to avoid reading it later */ vmx->msr_ia32_mcu_opt_ctrl = msr; }
@@ -393,7 +393,7 @@ static __always_inline void vmx_enable_fb_clear(struct vcpu_vmx *vmx)return ; vmx->msr_ia32_mcu_opt_ctrl &= ~FB_CLEAR_DIS ; -native_wrmsrl (MSR_IA32_MCU_OPT_CTRL , vmx->msr_ia32_mcu_opt_ctrl); +native_wrmsrq (MSR_IA32_MCU_OPT_CTRL , vmx->msr_ia32_mcu_opt_ctrl); }static void vmx_update_fb_clear_dis (struct kvm_vcpu *vcpu,struct vcpu_vmx *vmx)
@@ -6745,7 +6745,7 @@ static noinstr void vmx_l1d_flush(struct kvm_vcpu *vcpu) vcpu->stat.l1d_flush++;if (static_cpu_has (X86_FEATURE_FLUSH_L1D )) { -native_wrmsrl (MSR_IA32_FLUSH_CMD ,L1D_FLUSH ); +native_wrmsrq (MSR_IA32_FLUSH_CMD ,L1D_FLUSH );return ; }
@@ -7318,7 +7318,7 @@ void noinstr vmx_spec_ctrl_restore_host(struct vcpu_vmx *vmx,*/ if (cpu_feature_enabled (X86_FEATURE_KERNEL_IBRS ) || vmx->spec_ctrl != hostval) -native_wrmsrl (MSR_IA32_SPEC_CTRL , hostval); +native_wrmsrq (MSR_IA32_SPEC_CTRL , hostval);barrier_nospec (); }
Signature · 1 line
2.45.2
PATCH 20/20 x86/msr: Rename 'wrmsrl_cstar()' to 'wrmsrq_cstar()'
In reply to Ingo Molnar--- arch/x86/kernel/cpu/common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/common.c +3 -3
@@ -2091,7 +2091,7 @@ DEFINE_PER_CPU_CACHE_HOT(unsigned long, cpu_current_top_of_stack) = TOP_OF_INIT_DEFINE_PER_CPU_CACHE_HOT (u64, __x86_call_depth);EXPORT_PER_CPU_SYMBOL (__x86_call_depth); -static void wrmsrl_cstar (unsigned long val) +static void wrmsrq_cstar (unsigned long val) {/* * Intel CPUs do not support 32-bit SYSCALL. Writing to MSR_CSTAR
@@ -2107,7 +2107,7 @@ static inline void idt_syscall_init(void)wrmsrq (MSR_LSTAR , (unsigned long )entry_SYSCALL_64);if (ia32_enabled ()) { -wrmsrl_cstar ((unsigned long )entry_SYSCALL_compat); +wrmsrq_cstar ((unsigned long )entry_SYSCALL_compat);/* * This only works on Intel CPUs. * On AMD CPUs these MSRs are 32-bit, CPU truncates MSR_IA32_SYSENTER_EIP.
@@ -2119,7 +2119,7 @@ static inline void idt_syscall_init(void) (unsigned long)(cpu_entry_stack(smp_processor_id()) + 1));wrmsrq_safe (MSR_IA32_SYSENTER_EIP , (u64 )entry_SYSENTER_compat); }else { -wrmsrl_cstar ((unsigned long )entry_SYSCALL32_ignore); +wrmsrq_cstar ((unsigned long )entry_SYSCALL32_ignore);wrmsrq_safe (MSR_IA32_SYSENTER_CS , (u64 )GDT_ENTRY_INVALID_SEG );wrmsrq_safe (MSR_IA32_SYSENTER_ESP ,0ULL );wrmsrq_safe (MSR_IA32_SYSENTER_EIP ,0ULL );
Signature · 1 line
2.45.2
Xin Li
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
In reply to Ingo MolnarQuoted 10 lines · Ingo Molnar
arch/x86/include/asm/msr.h +1
-1@@ -79,7 +79,7 @@ static inline void do_trace_rdpmc(u32 msr, u64 val, int failed) {}* think of extending them - you will be slapped with a stinking trout or a frozen * shark will reach you, wherever you are! You've been warned. */ -static __always_inline u64 __rdmsr(unsigned int msr) +static __always_inline u64 __rdmsr(u32 msr) {DECLARE_ARGS (val, low, high);
arch/x86/include/asm/msr.h static __always_inline u64 __rdmsr(unsigned int msr) · line 97
Quoted 8 lines
arch/x86/include/asm/msr.h +1
-1@@ -91,7 +91,7 @@ static __always_inline u64 __rdmsr(unsigned int msr)return EAX_EDX_VAL (val, low, high); } -static __always_inline void __wrmsr(unsigned int msr, u32 low, u32 high) +static __always_inline void __wrmsr(u32 msr, u32 low, u32 high) { asmvolatile ("1: wrmsr\n" "2:\n"
It looks to me that we don't use the "const" qualifier in the code a lot. However since the MSR index is usually not expected to change inside the MSR API implementations, would it be nicer to add the "const" qualifier?
The same to the MSR value of MSR write APIs.
Thanks!
Xin
H. Peter Anvin
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
Quoted 8 lines · Xin Li
It looks to me that we don't use the "const" qualifier in the code a lot. However since the MSR index is usually not expected to change inside the MSR API implementations, would it be nicer to add the "const" qualifier?
The same to the MSR value of MSR write APIs.
"const" on an automatic variable (including function arguments) is usually not very meaningful, unless it is manifest as a memory object (see below.)
Personally I tend to use "const" anyway in more complex functions to make it clear that a variable is not expected to change while in scope (and I also prefer to reduce the scope of a variable as much as possible), but for a simple function like this it is more clutter than anything else.
Now, "const" on a *memory object* (pointer target) is a very different thing and should in general be used where ever writing to an object is not going to happen.
An automatic variable becomes manifest as a memory object if its address is taken anywhere in its scope (using the & operator or an unindexed array) and the address of that pointer stored. The last part means that the compiler (if it is is smart enough) can take a sequence of operations equivalent to *& and eliminate it.
Keep in mind that, for C (not necessarily C++):
1. in *all* cases "foo[x]" is exactly equivalent to "*(foo + x)"
2. *if* "foo" is declared as an array type, then "foo" is exactly equivalent to "&foo[0]".
"const" in C a little less strict than you would like; the only way in C before C23 to declare a "true" constant is using enum or a #define macro (which of course pollutes the global namespace). In block scope it usually doesn't matter for scalar types and const or static const will work just fine, but it is only in C23 than C imported "constexpr" from C++ (which has had it since C++11.)
-hpa
Xin Li
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
Quoted 7 lines · H. Peter Anvin
Quoted 6 lines · Xin Li
It looks to me that we don't use the "const" qualifier in the code a lot. However since the MSR index is usually not expected to change inside the MSR API implementations, would it be nicer to add the "const" qualifier?
Quoted 6 lines
Quoted 2 lines
The same to the MSR value of MSR write APIs.
"const" on an automatic variable (including function arguments) is usually not very meaningful, unless it is manifest as a memory object (see below.)
Personally I tend to use "const" anyway in more complex functions to make it clear that a variable is not expected to change while in scope (and I also prefer to reduce the scope of a variable as much as possible), but for a simple function like this it is more clutter than anything else.
Good point!
A question NOT related to this patch set, the MSR write API prototype defined in struct pv_cpu_ops as:
void (*write_msr)(unsigned int msr, unsigned low, unsigned high);
Will it be better to add "const" to its arguments? I.e.,
void (*write_msr)(const u32 msr, const u32 low, const u32 high);
Quoted 10 lines
Now, "const" on a *memory object* (pointer target) is a very different thing and should in general be used where ever writing to an object is not going to happen.
An automatic variable becomes manifest as a memory object if its address is taken anywhere in its scope (using the & operator or an unindexed array) and the address of that pointer stored. The last part means that the compiler (if it is is smart enough) can take a sequence of operations equivalent to *& and eliminate it.
Keep in mind that, for C (not necessarily C++):
1. in *all* cases "foo[x]" is exactly equivalent to "*(foo + x)"
2. *if* "foo" is declared as an array type, then "foo" is exactly equivalent to "&foo[0]"."const" in C a little less strict than you would like; the only way in C before C23 to declare a "true" constant is using enum or a #define macro (which of course pollutes the global namespace). In block scope it usually doesn't matter for scalar types and const or static const will work just fine, but it is only in C23 than C imported "constexpr" from C++ (which has had it since C++11.)
Nice to know.
Thanks!
Xin
H. Peter Anvin
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
Quoted 30 lines · Xin Li
Quoted 7 lines · H. Peter Anvin
Quoted 6 lines · Xin Li
It looks to me that we don't use the "const" qualifier in the code a lot. However since the MSR index is usually not expected to change inside the MSR API implementations, would it be nicer to add the "const" qualifier?
Quoted 6 lines
Quoted 2 lines
The same to the MSR value of MSR write APIs.
"const" on an automatic variable (including function arguments) is usually not very meaningful, unless it is manifest as a memory object (see below.)
Personally I tend to use "const" anyway in more complex functions to make it clear that a variable is not expected to change while in scope (and I also prefer to reduce the scope of a variable as much as possible), but for a simple function like this it is more clutter than anything else.
Good point!
A question NOT related to this patch set, the MSR write API prototype defined in struct
pv_cpu_opsas:void (*write_msr)(unsigned int msr, unsigned low, unsigned high);Will it be better to add "const" to its arguments? I.e.,
void (*write_msr)(const u32 msr, const u32 low, const u32 high);Quoted 6 lines
Now, "const" on a *memory object* (pointer target) is a very different thing and should in general be used where ever writing to an object is not going to happen.
An automatic variable becomes manifest as a memory object if its address is taken anywhere in its scope (using the & operator or an unindexed array) and the address of that pointer stored. The last part means that the compiler (if it is is smart enough) can take a sequence of operations equivalent to *& and eliminate it.
Keep in mind that, for C (not necessarily C++):
Quoted 7 lines
Quoted 4 lines
1. in *all* cases "foo[x]" is exactly equivalent to "*(foo + x)"
2. *if* "foo" is declared as an array type, then "foo" is exactly equivalent to "&foo[0]"."const" in C a little less strict than you would like; the only way in C before C23 to declare a "true" constant is using enum or a #define macro (which of course pollutes the global namespace). In block scope it usually doesn't matter for scalar types and const or static const will work just fine, but it is only in C23 than C imported "constexpr" from C++ (which has had it since C++11.)
Nice to know.
Thanks!
Xin
No, that makes no sense (it would have absolutely no effect.)
Xin Li
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
Quoted 11 lines · H. Peter Anvin
Quoted 7 lines · Xin Li
A question NOT related to this patch set, the MSR write API prototype defined in struct
pv_cpu_opsas:void (*write_msr)(unsigned int msr, unsigned low, unsigned high);Will it be better to add "const" to its arguments? I.e.,
void (*write_msr)(const u32 msr, const u32 low, const u32 high);No, that makes no sense (it would have absolutely no effect.)
For the API definition, yes, it has no effect.
While it makes the API definition more explicit, and its implementations for native and Xen would be:
void {native,xen}_write_msr(const u32 msr, const u32 low, const u32 high)
{
....
}not worth it at all?
H. Peter Anvin
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
Quoted 18 lines · Xin Li
Quoted 11 lines · H. Peter Anvin
Quoted 7 lines · Xin Li
A question NOT related to this patch set, the MSR write API prototype defined in struct
pv_cpu_opsas:
void (*write_msr)(unsigned int msr, unsigned low, unsigned high);Will it be better to add "const" to its arguments? I.e., void (*write_msr)(const u32 msr, const u32 low, const u32 high);
No, that makes no sense (it would have absolutely no effect.)
For the API definition, yes, it has no effect.
While it makes the API definition more explicit, and its implementations for native and Xen would be:
Quoted 7 lines
void {native,xen}_write_msr(const u32 msr, const u32 low, const u32 high) {
....
}not worth it at all?
No, and as you know, I'd like to get rid of the native_ and xen_ functions entirely anyway.
-hpa
Xin Li
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
Quoted 2 lines · H. Peter Anvin
No, and as you know, I'd like to get rid of the
native_andxen_functions entirely anyway.
Yes, the change is in the RFC patch set I sent out earlier :)
H. Peter Anvin
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
Quoted 5 lines · Xin Li
Quoted 2 lines · H. Peter Anvin
No, and as you know, I'd like to get rid of the
native_andxen_functions entirely anyway.Yes, the change is in the RFC patch set I sent out earlier :)
Another reason not to try to micro-optimize it right now.
-hpa
Re: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
In reply to Xin LiQuoted 18 lines · Xin Li
Quoted 11 lines · H. Peter Anvin
Quoted 7 lines · Xin Li
A question NOT related to this patch set, the MSR write API prototype defined in struct
pv_cpu_opsas:void (*write_msr)(unsigned int msr, unsigned low, unsigned high);Will it be better to add "const" to its arguments? I.e.,
void (*write_msr)(const u32 msr, const u32 low, const u32 high);No, that makes no sense (it would have absolutely no effect.)
For the API definition, yes, it has no effect.
While it makes the API definition more explicit, and its implementations for native and Xen would be:
Quoted 6 lines
void {native,xen}_write_msr(const u32 msr, const u32 low, const u32 high)
{ .... }not worth it at all?
No:
- Using 'const' for input parameter pointers makes sense because it's easy to have a bug like this in a utility function:
obj_ptr->val = foo;
this has a side effect on the calling context, spreading the local rot, so to speak, corrupting the object not owned by this function.
- Using 'const' for non-pointer input parameters makes little sense, because the worst a function can do is to corrupt it locally:
val_high = foo;
... but this bug won't be able to spread via corrupting objects through a pointer, any bug will be limited to that function.
So neither the kernel, nor any of the major libraries such as glibc will typically use const for non-pointer function parameters, outside of very specific exceptions that strengthen the rule.
Thanks,
Ingo
Xin Li
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
Quoted 16 lines · Ingo Molnar
Quoted 2 lines
not worth it at all?
No:
- Using 'const' for input parameter pointers makes sense because it's easy to have a bug like this in a utility function:
obj_ptr->val = foo;this has a side effect on the calling context, spreading the local rot, so to speak, corrupting the object not owned by this function.
- Using 'const' for non-pointer input parameters makes little sense, because the worst a function can do is to corrupt it locally:
Quoted 8 lines
val_high = foo;... but this bug won't be able to spread via corrupting objects through a pointer, any bug will be limited to that function.
So neither the kernel, nor any of the major libraries such as glibc will typically use const for non-pointer function parameters, outside of very specific exceptions that strengthen the rule.
Thanks for the explanation!
H. Peter Anvin
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
In reply to Ingo MolnarQuoted 46 lines · Ingo Molnar
Quoted 18 lines · Xin Li
Quoted 11 lines · H. Peter Anvin
Quoted 7 lines · Xin Li
A question NOT related to this patch set, the MSR write API prototype defined in struct
pv_cpu_opsas:void (*write_msr)(unsigned int msr, unsigned low, unsigned high);Will it be better to add "const" to its arguments? I.e.,
void (*write_msr)(const u32 msr, const u32 low, const u32 high);No, that makes no sense (it would have absolutely no effect.)
For the API definition, yes, it has no effect.
While it makes the API definition more explicit, and its implementations for native and Xen would be:
Quoted 6 lines
void {native,xen}_write_msr(const u32 msr, const u32 low, const u32 high)
{ .... }not worth it at all?
No:
- Using 'const' for input parameter pointers makes sense because it's easy to have a bug like this in a utility function:
obj_ptr->val = foo;this has a side effect on the calling context, spreading the local rot, so to speak, corrupting the object not owned by this function.
- Using 'const' for non-pointer input parameters makes little sense, because the worst a function can do is to corrupt it locally:
val_high = foo;... but this bug won't be able to spread via corrupting objects through a pointer, any bug will be limited to that function.
Quoted 7 lines
So neither the kernel, nor any of the major libraries such as glibc will typically use const for non-pointer function parameters, outside of very specific exceptions that strengthen the rule.
Thanks,
Ingo
And even so, there is no need to put the const in the prototype.
Quoted 7 lines · Ingo Molnar
Ingo Molnar (20):
x86/msr: Standardize on u64 in <asm/msr.h>
x86/msr: Standardize on u64 in <asm/msr-index.h> x86/msr: Use u64 inrdmsrl_amd_safe()andwrmsrl_amd_safe()x86/msr: Use u64 inrdmsrl_safe()andparavirt_read_pmc()x86/msr: Harmonize the prototype and definition ofdo_trace_rdpmc()x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
Yay, thanks!
Quoted 6 lines
x86/msr: Rename '
rdmsrl()' to 'rdmsrq()'
x86/msr: Rename 'wrmsrl()' to 'wrmsrq()'
x86/msr: Rename 'rdmsrl_safe()' to 'rdmsrq_safe()' x86/msr: Rename 'wrmsrl_safe()' to 'wrmsrq_safe()' x86/msr: Rename 'rdmsrl_safe_on_cpu()' to 'rdmsrq_safe_on_cpu()' x86/msr: Rename 'wrmsrl_safe_on_cpu()' to 'wrmsrq_safe_on_cpu()'
Quoted 8 lines
x86/msr: Rename '
rdmsrl_on_cpu()' to 'rdmsrq_on_cpu()' x86/msr: Rename 'wrmsrl_on_cpu()' to 'wrmsrq_on_cpu()' x86/msr: Rename 'mce_rdmsrl()' to 'mce_rdmsrq()' x86/msr: Rename 'mce_wrmsrl()' to 'mce_wrmsrq()' x86/msr: Rename 'rdmsrl_amd_safe()' to 'rdmsrq_amd_safe()' x86/msr: Rename 'wrmsrl_amd_safe()' to 'wrmsrq_amd_safe()' x86/msr: Rename 'native_wrmsrl()' to 'native_wrmsrq()' x86/msr: Rename 'wrmsrl_cstar()' to 'wrmsrq_cstar()'
I'm so going to be typo-ing this for a while, but yeah, I suppose these are better names.
Peter Zijlstra
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
In reply to H. Peter AnvinQuoted 2 lines · H. Peter Anvin
No, and as you know, I'd like to get rid of the
native_andxen_functions entirely anyway.
I have vague memories of locations where we *have* to use native_{rd,wr}msr() because the paravirt indirections cause problems.
I don't clearly recall the reasons, but it could be instrumentation related. The paravirt muck has tracepoints and other crap included.
H. Peter Anvin
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
Quoted 11 lines · Peter Zijlstra
Quoted 2 lines · H. Peter Anvin
No, and as you know, I'd like to get rid of the
native_andxen_functions entirely anyway.I have vague memories of locations where we *have* to use native_{rd,wr}msr() because the paravirt indirections cause problems.
I don't clearly recall the reasons, but it could be instrumentation related. The paravirt muck has tracepoints and other crap included.
Yes, that's part of what we want to get rid of.
Xin Li
maintainerRe: [PATCH 06/20] x86/msr: Standardize on 'u32' MSR indices in <asm/msr.h>
In reply to Peter ZijlstraQuoted 5 lines · Peter Zijlstra
I have vague memories of locations where we*have* to use native_{rd,wr}msr() because the paravirt indirections cause problems.
I don't clearly recall the reasons, but it could be instrumentation related. The paravirt muck has tracepoints and other crap included.
Hey, I was discussing this with hpa a few days ago ;)
Here is the existing code:
#define native_wrmsr(msr, low, high) \
__wrmsr(msr, low, high)...
static inline void notrace native_write_msr(unsigned int msr, u32 low, u32 high)
{
__wrmsr(msr, low, high);
if (tracepoint_enabled(write_msr))
do_trace_write_msr(msr, ((u64)high << 32 | low), 0);
}So native_write_msr() is just native_wrmsr() + do_trace().
native_wrmsr() is used only once in arch/x86/coco/sev/core.c, and Boris explained that in commit:
[ bp: Use the non-tracing rd/wrmsr variants because:
vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0x11f: \
call to do_trace_write_msr() leaves .noinstr.text section
as __sev_es_nmi_complete() is noinstr due to being called from the NMI handler exc_nmi(). ]
It's confusing from the function names when to use native_write_msr()
or native_wrmsr() after removing the paravirt MSR APIs. And I want to rename native_wrmsr() to native_wrmsr_no_trace(), and then native_write_msr() to native_wrmsr() to make their difference explicit.
The same to native_wrmsrl(), which is used in VMX noinstr functions.
There is only native_rdmsr(), but no native_rdmsrl(). And native_rdmsr() is used in microcode code only.
BTW, using the native_*() functions on Xen shouldn't be a problem, because they cause #GP and then Xen could:
1) emulate the MSR instruction, and advance guest IP.
2) inject #GP back into the guest, and the guest MSR instruction is skipped in guest #GP handler, with MSR access *_safe() APIs an error is returned to the MSR APIs.
Thanks!
Xin