path: root/arch/powerpc/kernel/entry_32.S
diff options
authorBecky Bruce <becky.bruce@freescale.com>2007-11-10 09:17:49 +1100
committerPaul Mackerras <paulus@samba.org>2007-11-13 16:22:43 +1100
commitb64f87c16f3c00fe593f632e1ee5798ba3f4f3f4 (patch)
tree1e0c63707b73c4b2f316a01b2e3c6ebd82c6356a /arch/powerpc/kernel/entry_32.S
parentMerge branch 'for-2.6.24' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc into merge (diff)
[POWERPC] Avoid unpaired stwcx. on some processors
The context switch code in the kernel issues a dummy stwcx. to clear the reservation, as recommended by the architecture. However, some processors can have issues if this stwcx to address A occurs while the reservation is already held to a different address B. To avoid this problem, the dummy stwcx. needs to be paired with a dummy lwarx to the same address. This adds the dummy lwarx, and creates a cpu feature bit to indicate which cpus are affected. Tested on mpc8641_hpcn_defconfig in arch/powerpc; build tested in arch/ppc. Signed-off-by: Becky Bruce <becky.bruce@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/entry_32.S')
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index a7572cf464bd..69a91bd46115 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -251,6 +251,9 @@ syscall_exit_cont:
bne- 2f
#endif /* CONFIG_44x */
+ lwarx r7,0,r1
stwcx. r0,0,r1 /* to clear the reservation */
lwz r4,_LINK(r1)
lwz r5,_CCR(r1)
@@ -717,6 +720,9 @@ restore:
mtctr r11
+ lwarx r11,0,r1
stwcx. r0,0,r1 /* to clear the reservation */
#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))