aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2016-04-19 04:25:00 -0400
committerRalf Baechle <ralf@linux-mips.org>2016-05-13 08:02:24 -0400
commit14bc241443e126c62fcbf571b7d4c79740debc58 (patch)
tree13104303036707ae305ed320d008ef2c53225e3c /arch/mips
parent12822570a29bdc12c69fca2c021753cb5ce319c5 (diff)
MIPS: Fix HTW config on XPA kernel without LPA enabled
The hardware page table walker (HTW) configuration is broken on XPA kernels where XPA couldn't be enabled (either nohtw or the hardware doesn't support it). This is because the PWSize.PTEW field (PTE width) was only set to 8 bytes (an extra shift of 1) in config_htw_params() if PageGrain.ELPA (enable large physical addressing) is set. On an XPA kernel though the size of PTEs is fixed at 8 bytes regardless of whether XPA could actually be enabled. Fix the initialisation of this field based on sizeof(pte_t) instead. Fixes: c5b367835cfc ("MIPS: Add support for XPA.") Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Steven J. Hill <sjhill@realitydiluted.com> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/13113/ Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/mm/tlbex.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 7153e1fb0cd4..baad605db878 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -2424,9 +2424,7 @@ static void config_htw_params(void)
2424 if (CONFIG_PGTABLE_LEVELS >= 3) 2424 if (CONFIG_PGTABLE_LEVELS >= 3)
2425 pwsize |= ilog2(PTRS_PER_PMD) << MIPS_PWSIZE_MDW_SHIFT; 2425 pwsize |= ilog2(PTRS_PER_PMD) << MIPS_PWSIZE_MDW_SHIFT;
2426 2426
2427 /* If XPA has been enabled, PTEs are 64-bit in size. */ 2427 pwsize |= ilog2(sizeof(pte_t)/4) << MIPS_PWSIZE_PTEW_SHIFT;
2428 if (config_enabled(CONFIG_64BITS) || (read_c0_pagegrain() & PG_ELPA))
2429 pwsize |= 1;
2430 2428
2431 write_c0_pwsize(pwsize); 2429 write_c0_pwsize(pwsize);
2432 2430