summaryrefslogtreecommitdiff
path: root/arch/arm64/Kconfig
diff options
context:
space:
mode:
authorAlex Van Brunt <avanbrunt@nvidia.com>2014-01-30 15:10:39 -0800
committerAlexander Van Brunt <avanbrunt@nvidia.com>2014-02-15 07:45:08 -0800
commit78faf3dda07b85a821c9f118c595574d8e71d356 (patch)
tree7205775afd10a16e884e7e19e1d1369ecd3a862a /arch/arm64/Kconfig
parent679b362a6fc9c5eb944042ddc700a0d093a12342 (diff)
arm64: emulate the swp/swpb instruction
The swp and spwb instructions were deprecated in ARMv6. ARMv8 obsoleted the instruction. Despite this, many applications rely on these instruuctions. This patch starts with the version present in the arm architecture. However, it uses the ldx*()/stx*() functions to implement the handler in C code. It also removes a lot of code that is not needed. Bug 1438816 Change-Id: I6882fbe5f71bfa8f9e9a75d067b2111188c6f2fa Signed-off-by: Alex Van Brunt <avanbrunt@nvidia.com> Reviewed-on: http://git-master/r/366097 Reviewed-by: Richard Wiley <rwiley@nvidia.com> Tested-by: Oskari Jaaskelainen <oskarij@nvidia.com>
Diffstat (limited to 'arch/arm64/Kconfig')
-rw-r--r--arch/arm64/Kconfig26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index aeecfdac027b..d680ed628c2f 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -205,6 +205,31 @@ config HOTPLUG_CPU
If you don't know what to do here, say N.
+config SWP_EMULATE
+ bool "Emulate SWP/SWPB instructions"
+ help
+ ARMv6 architecture deprecates use of the SWP/SWPB instructions. ARMv8
+ oblosetes the use of SWP/SWPB instructions. ARMv7 multiprocessing
+ extensions introduce the ability to disable these instructions,
+ triggering an undefined instruction exception when executed. Say Y
+ here to enable software emulation of these instructions for userspace
+ (not kernel) using LDREX/STREX. Also creates /proc/cpu/swp_emulation
+ for statistics.
+
+ In some older versions of glibc [<=2.8] SWP is used during futex
+ trylock() operations with the assumption that the code will not
+ be preempted. This invalid assumption may be more likely to fail
+ with SWP emulation enabled, leading to deadlock of the user
+ application.
+
+ NOTE: when accessing uncached shared regions, LDREX/STREX rely
+ on an external transaction monitoring block called a global
+ monitor to maintain update atomicity. If your system does not
+ implement a global monitor, this option can cause programs that
+ perform SWP operations to uncached memory to deadlock.
+
+ If unsure, say Y.
+
source kernel/Kconfig.preempt
config ARCH_NR_GPIO
@@ -247,6 +272,7 @@ config HW_PERF_EVENTS
config ARMV7_COMPAT
bool "Kernel support for ARMv7 applications"
depends on COMPAT
+ select SWP_EMULATE
help
This option enables features that allow that ran on an ARMv7 or older
processor to continue functioning.