Commit 76deb545 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

x86/msr: Improve the comments of the DECLARE_ARGS()/EAX_EDX_VAL()/EAX_EDX_RET() facility



Signed-off-by: default avatarIngo 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
parent 0c7b20b8
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -37,13 +37,15 @@ 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)