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]
Message-Id: <1313777004-4716-1-git-send-email-nbowler@elliptictech.com>
Date:	Fri, 19 Aug 2011 14:03:24 -0400
From:	Nick Bowler <nbowler@...iptictech.com>
To:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:	Russell King <linux@....linux.org.uk>
Subject: [PATCH RFC] ARM: vexpress: Use assembler mnemonic for WFI in platform_do_lowpower.

Current Versatile Express CPU hotplug code includes a hardcoded WFI
instruction, in ARM encoding.  When the kernel is compiled in Thumb-2
mode, this is invalid and causes the machine to hang hard when a CPU
is offlined.

Using the assembler mnemonic instead of hardcoding it causes the correct
instruction to be emitted in either case.

Signed-off-by: Nick Bowler <nbowler@...iptictech.com>
---
 arch/arm/mach-vexpress/hotplug.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

OK.  I assume that the reason for the hardcoded instruction is that
older versions of binutils did not support the mnemonic.  Looking at the
binutils CVS history, support seems to have been added in 2005, and was
included in the 2.16 release.  If we care about those old assembler
versions, I can resubmit this patch using ARM/THUMB macros instead,
which should work just as well.

I imagine that other platforms which use this same construct, such as
realview, will have similar problems in thumb mode.  I can't test
changes on those platforms, unfortunately.

diff --git a/arch/arm/mach-vexpress/hotplug.c b/arch/arm/mach-vexpress/hotplug.c
index ea4cbfb..d6be197 100644
--- a/arch/arm/mach-vexpress/hotplug.c
+++ b/arch/arm/mach-vexpress/hotplug.c
@@ -62,10 +62,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 	 * code will have already disabled interrupts
 	 */
 	for (;;) {
-		/*
-		 * here's the WFI
-		 */
-		asm(".word	0xe320f003\n"
+		asm("wfi\n"
 		    :
 		    :
 		    : "memory", "cc");
-- 
1.7.3.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