aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/tlbex.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mm/tlbex.c')
-rw-r--r--arch/mips/mm/tlbex.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index bb1719a55d22..badcf5e8d695 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -73,9 +73,6 @@ static int __cpuinit m4kc_tlbp_war(void)
73enum label_id { 73enum label_id {
74 label_second_part = 1, 74 label_second_part = 1,
75 label_leave, 75 label_leave,
76#ifdef MODULE_START
77 label_module_alloc,
78#endif
79 label_vmalloc, 76 label_vmalloc,
80 label_vmalloc_done, 77 label_vmalloc_done,
81 label_tlbw_hazard, 78 label_tlbw_hazard,
@@ -92,9 +89,6 @@ enum label_id {
92 89
93UASM_L_LA(_second_part) 90UASM_L_LA(_second_part)
94UASM_L_LA(_leave) 91UASM_L_LA(_leave)
95#ifdef MODULE_START
96UASM_L_LA(_module_alloc)
97#endif
98UASM_L_LA(_vmalloc) 92UASM_L_LA(_vmalloc)
99UASM_L_LA(_vmalloc_done) 93UASM_L_LA(_vmalloc_done)
100UASM_L_LA(_tlbw_hazard) 94UASM_L_LA(_tlbw_hazard)
@@ -160,6 +154,12 @@ static u32 tlb_handler[128] __cpuinitdata;
160static struct uasm_label labels[128] __cpuinitdata; 154static struct uasm_label labels[128] __cpuinitdata;
161static struct uasm_reloc relocs[128] __cpuinitdata; 155static struct uasm_reloc relocs[128] __cpuinitdata;
162 156
157#ifndef CONFIG_MIPS_PGD_C0_CONTEXT
158/*
159 * CONFIG_MIPS_PGD_C0_CONTEXT implies 64 bit and lack of pgd_current,
160 * we cannot do r3000 under these circumstances.
161 */
162
163/* 163/*
164 * The R3000 TLB handler is simple. 164 * The R3000 TLB handler is simple.
165 */ 165 */
@@ -199,6 +199,7 @@ static void __cpuinit build_r3000_tlb_refill_handler(void)
199 199
200 dump_handler((u32 *)ebase, 32); 200 dump_handler((u32 *)ebase, 32);
201} 201}
202#endif /* CONFIG_MIPS_PGD_C0_CONTEXT */
202 203
203/* 204/*
204 * The R4000 TLB handler is much more complicated. We have two 205 * The R4000 TLB handler is much more complicated. We have two
@@ -497,8 +498,9 @@ static void __cpuinit
497build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r, 498build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
498 unsigned int tmp, unsigned int ptr) 499 unsigned int tmp, unsigned int ptr)
499{ 500{
501#ifndef CONFIG_MIPS_PGD_C0_CONTEXT
500 long pgdc = (long)pgd_current; 502 long pgdc = (long)pgd_current;
501 503#endif
502 /* 504 /*
503 * The vmalloc handling is not in the hotpath. 505 * The vmalloc handling is not in the hotpath.
504 */ 506 */
@@ -506,7 +508,15 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
506 uasm_il_bltz(p, r, tmp, label_vmalloc); 508 uasm_il_bltz(p, r, tmp, label_vmalloc);
507 /* No uasm_i_nop needed here, since the next insn doesn't touch TMP. */ 509 /* No uasm_i_nop needed here, since the next insn doesn't touch TMP. */
508 510
509#ifdef CONFIG_SMP 511#ifdef CONFIG_MIPS_PGD_C0_CONTEXT
512 /*
513 * &pgd << 11 stored in CONTEXT [23..63].
514 */
515 UASM_i_MFC0(p, ptr, C0_CONTEXT);
516 uasm_i_dins(p, ptr, 0, 0, 23); /* Clear lower 23 bits of context. */
517 uasm_i_ori(p, ptr, ptr, 0x540); /* 1 0 1 0 1 << 6 xkphys cached */
518 uasm_i_drotr(p, ptr, ptr, 11);
519#elif defined(CONFIG_SMP)
510# ifdef CONFIG_MIPS_MT_SMTC 520# ifdef CONFIG_MIPS_MT_SMTC
511 /* 521 /*
512 * SMTC uses TCBind value as "CPU" index 522 * SMTC uses TCBind value as "CPU" index
@@ -520,7 +530,7 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
520 */ 530 */
521 uasm_i_dmfc0(p, ptr, C0_CONTEXT); 531 uasm_i_dmfc0(p, ptr, C0_CONTEXT);
522 uasm_i_dsrl(p, ptr, ptr, 23); 532 uasm_i_dsrl(p, ptr, ptr, 23);
523#endif 533# endif
524 UASM_i_LA_mostly(p, tmp, pgdc); 534 UASM_i_LA_mostly(p, tmp, pgdc);
525 uasm_i_daddu(p, ptr, ptr, tmp); 535 uasm_i_daddu(p, ptr, ptr, tmp);
526 uasm_i_dmfc0(p, tmp, C0_BADVADDR); 536 uasm_i_dmfc0(p, tmp, C0_BADVADDR);
@@ -802,8 +812,6 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
802 } else { 812 } else {
803#if defined(CONFIG_HUGETLB_PAGE) 813#if defined(CONFIG_HUGETLB_PAGE)
804 const enum label_id ls = label_tlb_huge_update; 814 const enum label_id ls = label_tlb_huge_update;
805#elif defined(MODULE_START)
806 const enum label_id ls = label_module_alloc;
807#else 815#else
808 const enum label_id ls = label_vmalloc; 816 const enum label_id ls = label_vmalloc;
809#endif 817#endif
@@ -1033,6 +1041,7 @@ build_pte_modifiable(u32 **p, struct uasm_reloc **r,
1033 iPTE_LW(p, pte, ptr); 1041 iPTE_LW(p, pte, ptr);
1034} 1042}
1035 1043
1044#ifndef CONFIG_MIPS_PGD_C0_CONTEXT
1036/* 1045/*
1037 * R3000 style TLB load/store/modify handlers. 1046 * R3000 style TLB load/store/modify handlers.
1038 */ 1047 */
@@ -1184,6 +1193,7 @@ static void __cpuinit build_r3000_tlb_modify_handler(void)
1184 1193
1185 dump_handler(handle_tlbm, ARRAY_SIZE(handle_tlbm)); 1194 dump_handler(handle_tlbm, ARRAY_SIZE(handle_tlbm));
1186} 1195}
1196#endif /* CONFIG_MIPS_PGD_C0_CONTEXT */
1187 1197
1188/* 1198/*
1189 * R4000 style TLB load/store/modify handlers. 1199 * R4000 style TLB load/store/modify handlers.
@@ -1400,6 +1410,7 @@ void __cpuinit build_tlb_refill_handler(void)
1400 case CPU_TX3912: 1410 case CPU_TX3912:
1401 case CPU_TX3922: 1411 case CPU_TX3922:
1402 case CPU_TX3927: 1412 case CPU_TX3927:
1413#ifndef CONFIG_MIPS_PGD_C0_CONTEXT
1403 build_r3000_tlb_refill_handler(); 1414 build_r3000_tlb_refill_handler();
1404 if (!run_once) { 1415 if (!run_once) {
1405 build_r3000_tlb_load_handler(); 1416 build_r3000_tlb_load_handler();
@@ -1407,6 +1418,9 @@ void __cpuinit build_tlb_refill_handler(void)
1407 build_r3000_tlb_modify_handler(); 1418 build_r3000_tlb_modify_handler();
1408 run_once++; 1419 run_once++;
1409 } 1420 }
1421#else
1422 panic("No R3000 TLB refill handler");
1423#endif
1410 break; 1424 break;
1411 1425
1412 case CPU_R6000: 1426 case CPU_R6000: