]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ppc64: Add a sync in context switch on SMP
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 30 Mar 2004 02:51:56 +0000 (18:51 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 30 Mar 2004 02:51:56 +0000 (18:51 -0800)
For the same reason as ppc32, we need to ensure that all stores
done on a CPU has reached the coherency domain and are visible
to loads done by another CPU when context switching as the same
thread may be rescheduled almost right away there.

arch/ppc64/kernel/entry.S

index 6ba2f90140af5d33732ca45d56e9802cc1bf6313..c106ce03e154c6d0629d6b1752928e35988fc75e 100644 (file)
@@ -289,6 +289,14 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
        std     r23,_CCR(r1)
        std     r1,KSP(r3)      /* Set old stack pointer */
 
+#ifdef CONFIG_SMP
+       /* We need a sync somewhere here to make sure that if the
+        * previous task gets rescheduled on another CPU, it sees all
+        * stores it has performed on this one.
+        */
+       sync
+#endif /* CONFIG_SMP */
+
        addi    r6,r4,-THREAD   /* Convert THREAD to 'current' */
        std     r6,PACACURRENT(r13)     /* Set new 'current' */