powerpc/fsl-booke: Fixup 64-bit PTE reading for SMP support

Previous thread: powerpc: Fix build warnings introduced by PMC support on 32-bit by Linux Kernel Mailing List on Wednesday, October 15, 2008 - 12:03 pm. (1 message)

Next thread: cpm_uart: Pass actual dev ptr to dma_* in ucc and cpm_uart serial by Linux Kernel Mailing List on Wednesday, October 15, 2008 - 12:03 pm. (1 message)
From: Linux Kernel Mailing List
Date: Wednesday, October 15, 2008 - 12:03 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b38fd4...
Commit:     b38fd42ff46a4a31dced8533e8a6e549693500b6
Parent:     33a7f122740bd820a029faf450a9a0caa9458426
Author:     Kumar Gala <galak@kernel.crashing.org>
AuthorDate: Wed Jul 16 16:17:08 2008 -0500
Committer:  Kumar Gala <galak@kernel.crashing.org>
CommitDate: Fri Sep 19 13:31:04 2008 -0500

    powerpc/fsl-booke: Fixup 64-bit PTE reading for SMP support
    
    We need to create a false data dependency to ensure the loads of
    the pte are done in the right order.
    
    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/kernel/head_fsl_booke.S |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 3cb52fa..377e0c1 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -579,13 +579,19 @@ interrupt_base:
 
 	FIND_PTE
 	andc.	r13,r13,r11		/* Check permission */
-	bne	2f			/* Bail if permission mismach */
 
 #ifdef CONFIG_PTE_64BIT
-	lwz	r13, 0(r12)
+#ifdef CONFIG_SMP
+	subf	r10,r11,r12		/* create false data dep */
+	lwzx	r13,r11,r10		/* Get upper pte bits */
+#else
+	lwz	r13,0(r12)		/* Get upper pte bits */
+#endif
 #endif
 
-	 /* Jump to common tlb load */
+	bne	2f			/* Bail if permission/valid mismach */
+
+	/* Jump to common tlb load */
 	b	finish_tlb_load
 2:
 	/* The bailout.  Restore registers to pre-exception conditions
@@ -640,10 +646,20 @@ interrupt_base:
 
 	FIND_PTE
 	andc.	r13,r13,r11		/* Check permission */
+
+#ifdef CONFIG_PTE_64BIT
+#ifdef CONFIG_SMP
+	subf	r10,r11,r12		/* create false data dep */
+	lwzx	r13,r11,r10		/* Get upper pte bits */
+#else
+	lwz	r13,0(r12)		/* Get upper pte bits */
+#endif
+#endif
+
 	bne	2f			/* Bail if permission mismach */
 
 #ifdef CONFIG_PTE_64BIT
-	lwz	r13, ...
Previous thread: powerpc: Fix build warnings introduced by PMC support on 32-bit by Linux Kernel Mailing List on Wednesday, October 15, 2008 - 12:03 pm. (1 message)

Next thread: cpm_uart: Pass actual dev ptr to dma_* in ucc and cpm_uart serial by Linux Kernel Mailing List on Wednesday, October 15, 2008 - 12:03 pm. (1 message)