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>] [thread-next>] [day] [month] [year] [list]
Date:	Tue,  7 Jun 2011 18:09:59 -0700
From:	Andi Kleen <andi@...stfloor.org>
To:	linux-kernel@...r.kernel.org
Cc:	Andi Kleen <ak@...ux.intel.com>, x86@...nel.org
Subject: [PATCH 1/3] x86: Readd asmregparm

From: Andi Kleen <ak@...ux.intel.com>

For a followon patchkit of mine I need to mark all functions
that can be called from assembler. But on 32bit kernels some
assembler functions are called with register arguments and others
with stack arguments. asmlinkage forces stack arguments.

This patch readds the recently removed asmregparm to be able
to mark assembler functions called with register arguments on 32bit.

Unlike the old code it's x86 only now to prevent it from
leaking.

Cc: x86@...nel.org
Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
 arch/x86/include/asm/linkage.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h
index 4814297..fe10d95 100644
--- a/arch/x86/include/asm/linkage.h
+++ b/arch/x86/include/asm/linkage.h
@@ -8,6 +8,7 @@
 
 #ifdef CONFIG_X86_32
 #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
+#define asmregparm CPP_ASMLINKAGE __attribute__((regparm(3)))
 
 /*
  * Make sure the compiler doesn't do anything stupid with the
@@ -42,7 +43,9 @@
 	__asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
 			      "g" (arg4), "g" (arg5), "g" (arg6))
 
-#endif /* CONFIG_X86_32 */
+#else
+#define asmregparm asmlinkage
+#endif /* !CONFIG_X86_32 */
 
 #ifdef __ASSEMBLY__
 
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ