diff options
author | Jose Abreu <Jose.Abreu@synopsys.com> | 2017-09-01 12:00:23 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2017-09-01 14:29:05 -0400 |
commit | 1ee55a8f7f6b7ca4c0c59e0b4b4e3584a085c2d3 (patch) | |
tree | b04b36aa2678527e951a7e3d7262926149ac2228 | |
parent | aa7e3a5e8b63628c7fc131effc163ade08ced41b (diff) |
ARC: Re-enable MMU upon Machine Check exception
I recently came upon a scenario where I would get a double fault
machine check exception tiriggered by a kernel module.
However the ensuing crash stacktrace (ksym lookup) was not working
correctly.
Turns out that machine check auto-disables MMU while modules are allocated
in kernel vaddr spapce.
This patch re-enables the MMU before start printing the stacktrace
making stacktracing of modules work upon a fatal exception.
Cc: stable@kernel.org
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Reviewed-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[vgupta: moved code into low level handler to avoid in 2 places]
-rw-r--r-- | arch/arc/kernel/entry.S | 6 | ||||
-rw-r--r-- | arch/arc/mm/tlb.c | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S index 1eea99beecc3..85d9ea4a0acc 100644 --- a/arch/arc/kernel/entry.S +++ b/arch/arc/kernel/entry.S | |||
@@ -92,6 +92,12 @@ ENTRY(EV_MachineCheck) | |||
92 | lr r0, [efa] | 92 | lr r0, [efa] |
93 | mov r1, sp | 93 | mov r1, sp |
94 | 94 | ||
95 | ; hardware auto-disables MMU, re-enable it to allow kernel vaddr | ||
96 | ; access for say stack unwinding of modules for crash dumps | ||
97 | lr r3, [ARC_REG_PID] | ||
98 | or r3, r3, MMU_ENABLE | ||
99 | sr r3, [ARC_REG_PID] | ||
100 | |||
95 | lsr r3, r2, 8 | 101 | lsr r3, r2, 8 |
96 | bmsk r3, r3, 7 | 102 | bmsk r3, r3, 7 |
97 | brne r3, ECR_C_MCHK_DUP_TLB, 1f | 103 | brne r3, ECR_C_MCHK_DUP_TLB, 1f |
diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index edc59a0a9c9b..8ceefbf72fb0 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c | |||
@@ -908,9 +908,6 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address, | |||
908 | 908 | ||
909 | local_irq_save(flags); | 909 | local_irq_save(flags); |
910 | 910 | ||
911 | /* re-enable the MMU */ | ||
912 | write_aux_reg(ARC_REG_PID, MMU_ENABLE | read_aux_reg(ARC_REG_PID)); | ||
913 | |||
914 | /* loop thru all sets of TLB */ | 911 | /* loop thru all sets of TLB */ |
915 | for (set = 0; set < mmu->sets; set++) { | 912 | for (set = 0; set < mmu->sets; set++) { |
916 | 913 | ||