lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <174617666933.22196.17231571188397764274.tip-bot2@tip-bot2>
Date: Fri, 02 May 2025 09:04:29 -0000
From: "tip-bot2 for Ingo Molnar" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Ingo Molnar <mingo@...nel.org>, Andy Lutomirski <luto@...nel.org>,
 Brian Gerst <brgerst@...il.com>, Juergen Gross <jgross@...e.com>,
 "H. Peter Anvin" <hpa@...or.com>,
 Linus Torvalds <torvalds@...ux-foundation.org>,
 Kees Cook <keescook@...omium.org>, Peter Zijlstra <peterz@...radead.org>,
 Borislav Petkov <bp@...en8.de>, Thomas Gleixner <tglx@...utronix.de>,
 Josh Poimboeuf <jpoimboe@...hat.com>, Uros Bizjak <ubizjak@...il.com>,
 linux-kernel@...r.kernel.org, x86@...nel.org
Subject: [tip: x86/merge] x86/msr: Move the EAX_EDX_*() methods from
 <asm/msr.h> to <asm/asm.h>

The following commit has been merged into the x86/merge branch of tip:

Commit-ID:     bdfda83a6b5988f1ac62cd0eaceb6c3b44dc2a31
Gitweb:        https://git.kernel.org/tip/bdfda83a6b5988f1ac62cd0eaceb6c3b44dc2a31
Author:        Ingo Molnar <mingo@...nel.org>
AuthorDate:    Fri, 02 May 2025 10:13:53 +02:00
Committer:     Ingo Molnar <mingo@...nel.org>
CommitterDate: Fri, 02 May 2025 10:18:19 +02:00

x86/msr: Move the EAX_EDX_*() methods from <asm/msr.h> to <asm/asm.h>

We are going to use them from multiple headers, and in any case,
such register access wrapper macros are better in <asm/asm.h>
anyway.

Signed-off-by: Ingo Molnar <mingo@...nel.org>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Juergen Gross <jgross@...e.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Kees Cook <keescook@...omium.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Uros Bizjak <ubizjak@...il.com>
Cc: linux-kernel@...r.kernel.org
---
 arch/x86/include/asm/asm.h | 19 +++++++++++++++++++
 arch/x86/include/asm/msr.h | 19 -------------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index cc28815..206e134 100644
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -243,5 +243,24 @@ register unsigned long current_stack_pointer asm(_ASM_SP);
 #define _ASM_EXTABLE_FAULT(from, to)				\
 	_ASM_EXTABLE_TYPE(from, to, EX_TYPE_FAULT)
 
+/*
+ * 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
+# define EAX_EDX_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 EAX_EDX_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
+
 #endif /* __KERNEL__ */
 #endif /* _ASM_X86_ASM_H */
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index d57a94c..856d660 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -37,25 +37,6 @@ struct saved_msrs {
 };
 
 /*
- * 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
-# define EAX_EDX_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 EAX_EDX_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
-
-/*
  * Be very careful with includes. This header is prone to include loops.
  */
 #include <asm/atomic.h>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ