aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2016-09-01 12:30:07 -0400
committerRalf Baechle <ralf@linux-mips.org>2016-10-04 10:13:57 -0400
commit18022894eca1315851bfd0614f011fbc01e44d16 (patch)
treef61b703336511bb9b9f4a469ce85553fedae290c /arch/mips/kernel
parent72bc8c75eaf72aa0e45652d09f1b80dd5346797e (diff)
MIPS: traps: 64bit kernels should read CP0_EBase 64bit
When reading the CP0_EBase register containing the WG (write gate) bit, the ebase variable should be set to the full value of the register, i.e. on a 64-bit kernel the full 64-bit width of the register via read_cp0_ebase_64(), and on a 32-bit kernel the full 32-bit width including bits 31:30 which may be writeable. Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/14148/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/traps.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 6061d47c57c9..4b60fb53b604 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -2215,8 +2215,17 @@ void __init trap_init(void)
2215 } else { 2215 } else {
2216 ebase = CAC_BASE; 2216 ebase = CAC_BASE;
2217 2217
2218 if (cpu_has_mips_r2_r6) 2218 if (cpu_has_mips_r2_r6) {
2219 ebase += (read_c0_ebase() & 0x3ffff000); 2219 if (cpu_has_ebase_wg) {
2220#ifdef CONFIG_64BIT
2221 ebase = (read_c0_ebase_64() & ~0xfff);
2222#else
2223 ebase = (read_c0_ebase() & ~0xfff);
2224#endif
2225 } else {
2226 ebase += (read_c0_ebase() & 0x3ffff000);
2227 }
2228 }
2220 } 2229 }
2221 2230
2222 if (cpu_has_mmips) { 2231 if (cpu_has_mmips) {