aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/mm/tlbex.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index c363890368cd..4004b659ce50 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -2431,15 +2431,25 @@ static void config_htw_params(void)
2431 if (CONFIG_PGTABLE_LEVELS >= 3) 2431 if (CONFIG_PGTABLE_LEVELS >= 3)
2432 pwsize |= ilog2(PTRS_PER_PMD) << MIPS_PWSIZE_MDW_SHIFT; 2432 pwsize |= ilog2(PTRS_PER_PMD) << MIPS_PWSIZE_MDW_SHIFT;
2433 2433
2434 pwsize |= ilog2(sizeof(pte_t)/4) << MIPS_PWSIZE_PTEW_SHIFT; 2434 /* Set pointer size to size of directory pointers */
2435 if (config_enabled(CONFIG_64BIT))
2436 pwsize |= MIPS_PWSIZE_PS_MASK;
2437 /* PTEs may be multiple pointers long (e.g. with XPA) */
2438 pwsize |= ((PTE_T_LOG2 - PGD_T_LOG2) << MIPS_PWSIZE_PTEW_SHIFT)
2439 & MIPS_PWSIZE_PTEW_MASK;
2435 2440
2436 write_c0_pwsize(pwsize); 2441 write_c0_pwsize(pwsize);
2437 2442
2438 /* Make sure everything is set before we enable the HTW */ 2443 /* Make sure everything is set before we enable the HTW */
2439 back_to_back_c0_hazard(); 2444 back_to_back_c0_hazard();
2440 2445
2441 /* Enable HTW and disable the rest of the pwctl fields */ 2446 /*
2447 * Enable HTW (and only for XUSeg on 64-bit), and disable the rest of
2448 * the pwctl fields.
2449 */
2442 config = 1 << MIPS_PWCTL_PWEN_SHIFT; 2450 config = 1 << MIPS_PWCTL_PWEN_SHIFT;
2451 if (config_enabled(CONFIG_64BIT))
2452 config |= MIPS_PWCTL_XU_MASK;
2443 write_c0_pwctl(config); 2453 write_c0_pwctl(config);
2444 pr_info("Hardware Page Table Walker enabled\n"); 2454 pr_info("Hardware Page Table Walker enabled\n");
2445 2455