aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/icswx.h
diff options
context:
space:
mode:
authorJimi Xenidis <jimix@pobox.com>2012-02-28 13:27:07 +0000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-03-07 17:06:09 +1100
commitde801de139ba2a2f2c74393ea00a321477ecc0dc (patch)
treef1850331426e3c1d4b0e7a20e633095f2546bf8f /arch/powerpc/mm/icswx.h
parentpowerpc/atomic: Implement atomic*_inc_not_zero (diff)
downloadlinux-dev-de801de139ba2a2f2c74393ea00a321477ecc0dc.tar.xz
linux-dev-de801de139ba2a2f2c74393ea00a321477ecc0dc.zip
powerpc/icswx: Fix race condition with IPI setting ACOP
There is a race where a thread causes a coprocessor type to be valid in its own ACOP _and_ in the current context, but it does not propagate to the ACOP register of other threads in time for them to use it. The original code tries to solve this by sending an IPI to all threads on the system, which is heavy handed, but unfortunately still provides a window where the icswx is issued by other threads and the ACOP is not up to date. This patch detects that the ACOP DSI fault was a "false positive" and syncs the ACOP and causes the icswx to be replayed. Signed-off-by: Jimi Xenidis <jimix@pobox.com> Cc: Anton Blanchard <anton@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm/icswx.h')
-rw-r--r--arch/powerpc/mm/icswx.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/mm/icswx.h b/arch/powerpc/mm/icswx.h
index 42176bd0884c..6dedc08e62c8 100644
--- a/arch/powerpc/mm/icswx.h
+++ b/arch/powerpc/mm/icswx.h
@@ -59,4 +59,10 @@ extern void free_cop_pid(int free_pid);
extern int acop_handle_fault(struct pt_regs *regs, unsigned long address,
unsigned long error_code);
+
+static inline u64 acop_copro_type_bit(unsigned int type)
+{
+ return 1ULL << (63 - type);
+}
+
#endif /* !_ARCH_POWERPC_MM_ICSWX_H_ */