aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2012-08-23 13:02:03 -0400
committerRalf Baechle <ralf@linux-mips.org>2012-10-11 05:11:20 -0400
commit748e787eb6de610c4427594923ef8ca1f5431b74 (patch)
treee7577a2a0dd354110487887703f6aa719317f691 /arch/mips
parent981ef0de49869c9a60e9b1ff35a734525dd790e0 (diff)
MIPS: Optimize TLB refill for RI/XI configurations.
We don't have to do a separate shift to eliminate the software bits, just rotate them into the fill and they will be ignored. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/4294/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/mm/tlbex.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index e09d49256908..658a520364ce 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -599,8 +599,7 @@ static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
599 unsigned int reg) 599 unsigned int reg)
600{ 600{
601 if (cpu_has_rixi) { 601 if (cpu_has_rixi) {
602 UASM_i_SRL(p, reg, reg, ilog2(_PAGE_NO_EXEC)); 602 UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL));
603 UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
604 } else { 603 } else {
605#ifdef CONFIG_64BIT_PHYS_ADDR 604#ifdef CONFIG_64BIT_PHYS_ADDR
606 uasm_i_dsrl_safe(p, reg, reg, ilog2(_PAGE_GLOBAL)); 605 uasm_i_dsrl_safe(p, reg, reg, ilog2(_PAGE_GLOBAL));
@@ -1019,11 +1018,9 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
1019 uasm_i_ld(p, tmp, 0, ptep); /* get even pte */ 1018 uasm_i_ld(p, tmp, 0, ptep); /* get even pte */
1020 uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */ 1019 uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
1021 if (cpu_has_rixi) { 1020 if (cpu_has_rixi) {
1022 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC)); 1021 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL));
1023 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
1024 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
1025 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ 1022 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
1026 UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); 1023 UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL));
1027 } else { 1024 } else {
1028 uasm_i_dsrl_safe(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */ 1025 uasm_i_dsrl_safe(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */
1029 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ 1026 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
@@ -1046,13 +1043,11 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
1046 if (r45k_bvahwbug()) 1043 if (r45k_bvahwbug())
1047 build_tlb_probe_entry(p); 1044 build_tlb_probe_entry(p);
1048 if (cpu_has_rixi) { 1045 if (cpu_has_rixi) {
1049 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC)); 1046 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL));
1050 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
1051 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
1052 if (r4k_250MHZhwbug()) 1047 if (r4k_250MHZhwbug())
1053 UASM_i_MTC0(p, 0, C0_ENTRYLO0); 1048 UASM_i_MTC0(p, 0, C0_ENTRYLO0);
1054 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ 1049 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
1055 UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); 1050 UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL));
1056 } else { 1051 } else {
1057 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */ 1052 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */
1058 if (r4k_250MHZhwbug()) 1053 if (r4k_250MHZhwbug())
@@ -1212,13 +1207,9 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l,
1212 UASM_i_LW(p, odd, sizeof(pte_t), ptr); /* get odd pte */ 1207 UASM_i_LW(p, odd, sizeof(pte_t), ptr); /* get odd pte */
1213 } 1208 }
1214 if (cpu_has_rixi) { 1209 if (cpu_has_rixi) {
1215 uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_NO_EXEC)); 1210 uasm_i_drotr(p, even, even, ilog2(_PAGE_GLOBAL));
1216 uasm_i_dsrl_safe(p, odd, odd, ilog2(_PAGE_NO_EXEC));
1217 uasm_i_drotr(p, even, even,
1218 ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
1219 UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */ 1211 UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */
1220 uasm_i_drotr(p, odd, odd, 1212 uasm_i_drotr(p, odd, odd, ilog2(_PAGE_GLOBAL));
1221 ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
1222 } else { 1213 } else {
1223 uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_GLOBAL)); 1214 uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_GLOBAL));
1224 UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */ 1215 UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */