]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/msr: Improve the comments of the DECLARE_ARGS()/EAX_EDX_VAL()/EAX_EDX_RET() facility
authorIngo Molnar <mingo@kernel.org>
Fri, 2 May 2025 08:07:59 +0000 (10:07 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 2 May 2025 08:10:31 +0000 (10:10 +0200)
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
arch/x86/include/asm/msr.h

index 2ccc78ebc3d73808515724e4f9c6c0c2ef125b2b..27bc0b54d0cb78e3fc5eacfb2678b2286c35f164 100644 (file)
@@ -37,20 +37,22 @@ struct saved_msrs {
 };
 
 /*
- * both i386 and x86_64 returns 64-bit value in edx:eax, but gcc's "A"
- * constraint has different meanings. For i386, "A" means exactly
- * edx:eax, while for x86_64 it doesn't mean rdx:rax or edx:eax. Instead,
- * it means rax *or* rdx.
+ * Both i386 and x86_64 returns 64-bit values in edx:eax for certain
+ * instructions, but GCC's "A" constraint has different meanings.
+ * For i386, "A" means exactly edx:eax, while for x86_64 it
+ * means rax *or* rdx.
+ *
+ * These helpers wrapping these semantic differences save one instruction
+ * clearing the high half of 'low':
  */
 #ifdef CONFIG_X86_64
-/* Using 64-bit values saves one instruction clearing the high half of low */
-#define DECLARE_ARGS(val, low, high)   unsigned long low, high
-#define EAX_EDX_VAL(val, low, high)    ((low) | (high) << 32)
-#define EAX_EDX_RET(val, low, high)    "=a" (low), "=d" (high)
+# define DECLARE_ARGS(val, low, high)  unsigned long low, high
+# 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)   u64 val
-#define EAX_EDX_VAL(val, low, high)    (val)
-#define EAX_EDX_RET(val, low, high)    "=A" (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
 
 /*