Skip to content

Commit f9a894c

Browse files
committed
x86/msr: Standardize on u64 in <asm/msr.h>
JIRA: https://issues.redhat.com/browse/RHEL-118444 commit dfe2574 Author: Ingo Molnar <mingo@kernel.org> Date: Wed Apr 9 22:28:48 2025 +0200 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. Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Juergen Gross <jgross@suse.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Xin Li <xin@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 9e6251a commit f9a894c

File tree

1 file changed

+9
-9
lines changed
  • arch/x86/include/asm

1 file changed

+9
-9
lines changed

arch/x86/include/asm/msr.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct saved_msrs {
4646
#define EAX_EDX_VAL(val, low, high) ((low) | (high) << 32)
4747
#define EAX_EDX_RET(val, low, high) "=a" (low), "=d" (high)
4848
#else
49-
#define DECLARE_ARGS(val, low, high) unsigned long long val
49+
#define DECLARE_ARGS(val, low, high) u64 val
5050
#define EAX_EDX_VAL(val, low, high) (val)
5151
#define EAX_EDX_RET(val, low, high) "=A" (val)
5252
#endif
@@ -77,7 +77,7 @@ static inline void do_trace_rdpmc(unsigned int msr, u64 val, int failed) {}
7777
* think of extending them - you will be slapped with a stinking trout or a frozen
7878
* shark will reach you, wherever you are! You've been warned.
7979
*/
80-
static __always_inline unsigned long long __rdmsr(unsigned int msr)
80+
static __always_inline u64 __rdmsr(unsigned int msr)
8181
{
8282
DECLARE_ARGS(val, low, high);
8383

@@ -124,9 +124,9 @@ do { \
124124
__wrmsr((msr), (u32)((u64)(val)), \
125125
(u32)((u64)(val) >> 32))
126126

127-
static inline unsigned long long native_read_msr(unsigned int msr)
127+
static inline u64 native_read_msr(unsigned int msr)
128128
{
129-
unsigned long long val;
129+
u64 val;
130130

131131
val = __rdmsr(msr);
132132

@@ -136,7 +136,7 @@ static inline unsigned long long native_read_msr(unsigned int msr)
136136
return val;
137137
}
138138

139-
static inline unsigned long long native_read_msr_safe(unsigned int msr,
139+
static inline u64 native_read_msr_safe(unsigned int msr,
140140
int *err)
141141
{
142142
DECLARE_ARGS(val, low, high);
@@ -190,7 +190,7 @@ extern int wrmsr_safe_regs(u32 regs[8]);
190190
* CPU can and will speculatively execute that RDTSC, though, so the
191191
* results can be non-monotonic if compared on different CPUs.
192192
*/
193-
static __always_inline unsigned long long rdtsc(void)
193+
static __always_inline u64 rdtsc(void)
194194
{
195195
DECLARE_ARGS(val, low, high);
196196

@@ -207,7 +207,7 @@ static __always_inline unsigned long long rdtsc(void)
207207
* be impossible to observe non-monotonic rdtsc_unordered() behavior
208208
* across multiple CPUs as long as the TSC is synced.
209209
*/
210-
static __always_inline unsigned long long rdtsc_ordered(void)
210+
static __always_inline u64 rdtsc_ordered(void)
211211
{
212212
DECLARE_ARGS(val, low, high);
213213

@@ -235,7 +235,7 @@ static __always_inline unsigned long long rdtsc_ordered(void)
235235
return EAX_EDX_VAL(val, low, high);
236236
}
237237

238-
static inline unsigned long long native_read_pmc(int counter)
238+
static inline u64 native_read_pmc(int counter)
239239
{
240240
DECLARE_ARGS(val, low, high);
241241

@@ -291,7 +291,7 @@ static inline int wrmsr_safe(unsigned int msr, u32 low, u32 high)
291291
__err; \
292292
})
293293

294-
static inline int rdmsrl_safe(unsigned int msr, unsigned long long *p)
294+
static inline int rdmsrl_safe(unsigned int msr, u64 *p)
295295
{
296296
int err;
297297

0 commit comments

Comments
 (0)