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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1409961977-11762-8-git-send-email-behanw@converseincode.com>
Date:	Fri,  5 Sep 2014 17:06:17 -0700
From:	behanw@...verseincode.com
To:	a.ryabinin@...sung.com, anurag19aggarwal@...il.com,
	charlebm@...il.com, cl@...ux-foundation.org, dave.long@...aro.org,
	k.khlebnikov@...sung.com, linux@....linux.org.uk,
	linyongting@...il.com, Nikolay.Borisov@....com, tglx@...utronix.de,
	tj@...nel.org, u.kleine-koenig@...gutronix.de
Cc:	behanw@...verseincode.com, Dave.Martin@....com,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	rabin@....in, rostedt@...dmis.org, rric@...nel.org,
	will.deacon@....com
Subject: [PATCH v2 7/7] arm: LLVMLinux: Use global stack register variable for percpu

From: Mark Charlebois <charlebm@...il.com>

Using global current_stack_pointer works on both clang and gcc.
current_stack_pointer is an unsigned long and needs to be cast
as a pointer to dereference.

Signed-off-by: Mark Charlebois <charlebm@...il.com>
---
 arch/arm/include/asm/percpu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/percpu.h b/arch/arm/include/asm/percpu.h
index 209e650..a89b407 100644
--- a/arch/arm/include/asm/percpu.h
+++ b/arch/arm/include/asm/percpu.h
@@ -30,14 +30,14 @@ static inline void set_my_cpu_offset(unsigned long off)
 static inline unsigned long __my_cpu_offset(void)
 {
 	unsigned long off;
-	register unsigned long *sp asm ("sp");
 
 	/*
 	 * Read TPIDRPRW.
 	 * We want to allow caching the value, so avoid using volatile and
 	 * instead use a fake stack read to hazard against barrier().
 	 */
-	asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off) : "Q" (*sp));
+	asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off)
+		: "Q" (*(const unsigned long *)current_stack_pointer));
 
 	return off;
 }
-- 
1.9.1

--
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