aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorDiana Craciun <Diana.Craciun@freescale.com>2013-03-14 10:55:11 -0400
committerScott Wood <scottwood@freescale.com>2014-01-10 18:34:04 -0500
commited2ddc56e758d516c5699260ada4d68434dfe1dc (patch)
tree2dd135e9887680a3c34c88344da9319b5784676e /arch/powerpc/kernel
parent1149e8a73ffea953d8d6615ee37bce820a3eaeb8 (diff)
powerpc: Replaced tlbilx with tlbwe in the initialization code
On Freescale e6500 cores EPCR[DGTMI] controls whether guest supervisor state can execute TLB management instructions. If EPCR[DGTMI]=0 tlbwe and tlbilx are allowed to execute normally in the guest state. A hypervisor may choose to virtualize TLB1 and for this purpose it may use IPROT to protect the entries for being invalidated by the guest. However, because tlbwe and tlbilx execution in the guest state are sharing the same bit, it is not possible to have a scenario where tlbwe is allowed to be executed in guest state and tlbilx traps. When guest TLB management instructions are allowed to be executed in guest state the guest cannot use tlbilx to invalidate TLB1 guest entries. Linux is using tlbilx in the boot code to invalidate the temporary entries it creates when initializing the MMU. The patch is replacing the usage of tlbilx in initialization code with tlbwe with VALID bit cleared. Linux is also using tlbilx in other contexts (like huge pages or indirect entries) but removing the tlbilx from the initialization code offers the possibility to have scenarios under hypervisor which are not using huge pages or indirect entries. Signed-off-by: Diana Craciun <Diana.Craciun@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/exceptions-64e.S10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 4d5a0b1034e8..063b65dd4f27 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -1068,12 +1068,9 @@ skpinv: addi r6,r6,1 /* Increment */
1068 mtspr SPRN_MAS0,r3 1068 mtspr SPRN_MAS0,r3
1069 tlbre 1069 tlbre
1070 mfspr r6,SPRN_MAS1 1070 mfspr r6,SPRN_MAS1
1071 rlwinm r6,r6,0,2,0 /* clear IPROT */ 1071 rlwinm r6,r6,0,2,31 /* clear IPROT and VALID */
1072 mtspr SPRN_MAS1,r6 1072 mtspr SPRN_MAS1,r6
1073 tlbwe 1073 tlbwe
1074
1075 /* Invalidate TLB1 */
1076 PPC_TLBILX_ALL(0,R0)
1077 sync 1074 sync
1078 isync 1075 isync
1079 1076
@@ -1127,12 +1124,9 @@ skpinv: addi r6,r6,1 /* Increment */
1127 mtspr SPRN_MAS0,r4 1124 mtspr SPRN_MAS0,r4
1128 tlbre 1125 tlbre
1129 mfspr r5,SPRN_MAS1 1126 mfspr r5,SPRN_MAS1
1130 rlwinm r5,r5,0,2,0 /* clear IPROT */ 1127 rlwinm r5,r5,0,2,31 /* clear IPROT and VALID */
1131 mtspr SPRN_MAS1,r5 1128 mtspr SPRN_MAS1,r5
1132 tlbwe 1129 tlbwe
1133
1134 /* Invalidate TLB1 */
1135 PPC_TLBILX_ALL(0,R0)
1136 sync 1130 sync
1137 isync 1131 isync
1138 1132