]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] 8xx: Work around CPU15 erratum.
authorScott Wood <scottwood@freescale.com>
Mon, 25 Jun 2007 19:50:41 +0000 (14:50 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 4 Oct 2007 01:36:36 +0000 (20:36 -0500)
The CPU15 erratum on MPC8xx chips can cause incorrect code execution
under certain circumstances, where there is a conditional or indirect
branch in the last word of a page, with a target in the last cache line
of the next page.  This patch implements one of the suggested
workarounds, by forcing a TLB miss whenever execution crosses a page
boundary.  This is done by invalidating the pages before and after the
one being loaded into the TLB in the ITLB miss handler.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/kernel/head_8xx.S
arch/powerpc/platforms/8xx/Kconfig

index 9c30938aad52ce0da014224e23a616afef6ed0d8..f7458396cd7c022968abb231d1fdf62cb5ec2c67 100644 (file)
@@ -298,6 +298,12 @@ InstructionTLBMiss:
        stw     r10, 0(r0)
        stw     r11, 4(r0)
        mfspr   r10, SPRN_SRR0  /* Get effective address of fault */
+#ifdef CONFIG_8xx_CPU15
+       addi    r11, r10, 0x1000
+       tlbie   r11
+       addi    r11, r10, -0x1000
+       tlbie   r11
+#endif
        DO_8xx_CPU6(0x3780, r3)
        mtspr   SPRN_MD_EPN, r10        /* Have to use MD_EPN for walk, MI_EPN can't */
        mfspr   r10, SPRN_M_TWB /* Get level 1 table entry address */
index 8ecd01ad0de886e99f88d1bd5ea7182a88f823c3..322b155f24ec8fc71368ba6914f0a30f19eeb8d2 100644 (file)
@@ -100,6 +100,22 @@ config 8xx_CPU6
 
          If in doubt, say N here.
 
+config 8xx_CPU15
+       bool "CPU15 Silicon Errata"
+       default y
+       help
+         This enables a workaround for erratum CPU15 on MPC8xx chips.
+         This bug can cause incorrect code execution under certain
+         circumstances.  This workaround adds some overhead (a TLB miss
+         every time execution crosses a page boundary), and you may wish
+         to disable it if you have worked around the bug in the compiler
+         (by not placing conditional branches or branches to LR or CTR
+         in the last word of a page, with a target of the last cache
+         line in the next page), or if you have used some other
+         workaround.
+
+         If in doubt, say Y here.
+
 choice
        prompt "Microcode patch selection"
        default NO_UCODE_PATCH