]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: percpu: Make this_cpu accessors pre-empt safe
authorSteve Capper <steve.capper@linaro.org>
Sun, 22 Mar 2015 14:51:51 +0000 (14:51 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 24 Mar 2015 18:02:55 +0000 (18:02 +0000)
commit50a392e89a8e7c4af5cf7e5a290a5634cc5ae165
treee501fee107f0d97b77cde072d14b0eeb80cd85af
parente868e8c3ce5665d25b74d82f317124ba1b88709a
arm64: percpu: Make this_cpu accessors pre-empt safe

this_cpu operations were implemented for arm64 in:
 fbdb813 arm64: xchg: Implement cmpxchg_double
 1fe6096 arm64: percpu: Implement this_cpu operations

Unfortunately, it is possible for pre-emption to take place between
address generation and data access. This can lead to cases where data
is being manipulated by this_cpu for a different CPU than it was
called on. Which effectively breaks the spec.

This patch disables pre-emption for the this_cpu operations
guaranteeing that address generation and data manipulation take place
without a pre-emption in-between.

Fixes: fbdb8138f216 ("arm64: xchg: Implement cmpxchg_double")
Fixes: 1fe609637cfb ("arm64: percpu: Implement this_cpu operations")
Reported-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Steve Capper <steve.capper@linaro.org>
[catalin.marinas@arm.com: remove space after type cast]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/cmpxchg.h
arch/arm64/include/asm/percpu.h