Skip to content

Commit

Permalink
ARM: SWP emulation: always enable when SMP is enabled
Browse files Browse the repository at this point in the history
SWP is deprecated in ARMv6 and ARMv7 CPUs, but more importantly, when
running on a SMP system, SWP doesn't guarantee atomicity.  This means
it can't really be used (by userspace) for locking purposes in a SMP
environment.

Currently, many configurations leave the SWP emulation disabled, which
means we never know if userspace executes this instruction on ARMv7
hardware.  Rectify this by enabling SWP emulation for ARMv7 with SMP
(where we can trap the instruction.)

Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Jul 18, 2014
1 parent af040ff commit a11dd73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ config ARM_VIRT_EXT
details.

config SWP_EMULATE
bool "Emulate SWP/SWPB instructions"
bool "Emulate SWP/SWPB instructions" if !SMP
depends on CPU_V7
default y if SMP
select HAVE_PROC_CPU if PROC_FS
Expand Down

0 comments on commit a11dd73

Please sign in to comment.