Skip to content

Commit df87be5

Browse files
committed
x86/msr: Rename DECLARE_ARGS() to EAX_EDX_DECLARE_ARGS
JIRA: https://issues.redhat.com/browse/RHEL-118444 Conflicts: some contextual as msr changes were not incorporated in this backport commit c9d8ea9 Author: Ingo Molnar <mingo@kernel.org> Date: Fri May 2 10:08:42 2025 +0200 x86/msr: Rename DECLARE_ARGS() to EAX_EDX_DECLARE_ARGS DECLARE_ARGS() is way too generic of a name that says very little about why these args are declared in that fashion - use the EAX_EDX_ prefix to create a common prefix between the three helper methods: EAX_EDX_DECLARE_ARGS() EAX_EDX_VAL() EAX_EDX_RET() Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: Juergen Gross <jgross@suse.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Uros Bizjak <ubizjak@gmail.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: David Arcari <darcari@redhat.com>
1 parent b339874 commit df87be5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

arch/x86/include/asm/msr.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ struct saved_msrs {
4444
* clearing the high half of 'low':
4545
*/
4646
#ifdef CONFIG_X86_64
47-
# define DECLARE_ARGS(val, low, high) unsigned long low, high
47+
# define EAX_EDX_DECLARE_ARGS(val, low, high) unsigned long low, high
4848
# define EAX_EDX_VAL(val, low, high) ((low) | (high) << 32)
4949
# define EAX_EDX_RET(val, low, high) "=a" (low), "=d" (high)
5050
#else
51-
# define DECLARE_ARGS(val, low, high) u64 val
51+
# define EAX_EDX_DECLARE_ARGS(val, low, high) u64 val
5252
# define EAX_EDX_VAL(val, low, high) (val)
5353
# define EAX_EDX_RET(val, low, high) "=A" (val)
5454
#endif
@@ -81,7 +81,7 @@ static inline void do_trace_rdpmc(unsigned int msr, u64 val, int failed) {}
8181
*/
8282
static __always_inline u64 __rdmsr(unsigned int msr)
8383
{
84-
DECLARE_ARGS(val, low, high);
84+
EAX_EDX_DECLARE_ARGS(val, low, high);
8585

8686
asm volatile("1: rdmsr\n"
8787
"2:\n"
@@ -141,7 +141,7 @@ static inline u64 native_read_msr(unsigned int msr)
141141
static inline u64 native_read_msr_safe(unsigned int msr,
142142
int *err)
143143
{
144-
DECLARE_ARGS(val, low, high);
144+
EAX_EDX_DECLARE_ARGS(val, low, high);
145145

146146
asm volatile("1: rdmsr ; xor %[err],%[err]\n"
147147
"2:\n\t"
@@ -194,7 +194,7 @@ extern int wrmsr_safe_regs(u32 regs[8]);
194194
*/
195195
static __always_inline u64 rdtsc(void)
196196
{
197-
DECLARE_ARGS(val, low, high);
197+
EAX_EDX_DECLARE_ARGS(val, low, high);
198198

199199
asm volatile("rdtsc" : EAX_EDX_RET(val, low, high));
200200

@@ -211,7 +211,7 @@ static __always_inline u64 rdtsc(void)
211211
*/
212212
static __always_inline u64 rdtsc_ordered(void)
213213
{
214-
DECLARE_ARGS(val, low, high);
214+
EAX_EDX_DECLARE_ARGS(val, low, high);
215215

216216
/*
217217
* The RDTSC instruction is not ordered relative to memory
@@ -239,7 +239,7 @@ static __always_inline u64 rdtsc_ordered(void)
239239

240240
static inline u64 native_read_pmc(int counter)
241241
{
242-
DECLARE_ARGS(val, low, high);
242+
EAX_EDX_DECLARE_ARGS(val, low, high);
243243

244244
asm volatile("rdpmc" : EAX_EDX_RET(val, low, high) : "c" (counter));
245245
if (tracepoint_enabled(rdpmc))

arch/x86/kernel/cpu/mce/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ void ex_handler_msr_mce(struct pt_regs *regs, bool wrmsr)
389389
/* MSR access wrappers used for error injection */
390390
noinstr u64 mce_rdmsrl(u32 msr)
391391
{
392-
DECLARE_ARGS(val, low, high);
392+
EAX_EDX_DECLARE_ARGS(val, low, high);
393393

394394
if (__this_cpu_read(injectm.finished)) {
395395
int offset;

0 commit comments

Comments
 (0)