Skip to content

Commit 81306fc

Browse files
joabreugregkh
authored andcommitted
ARC: Re-enable MMU upon Machine Check exception
commit 1ee55a8f7f6b7ca4c0c59e0b4b4e3584a085c2d3 upstream. 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. 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] Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d28e96b commit 81306fc

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

arch/arc/kernel/entry.S

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ ENTRY(EV_MachineCheck)
104104
lr r0, [efa]
105105
mov r1, sp
106106

107+
; hardware auto-disables MMU, re-enable it to allow kernel vaddr
108+
; access for say stack unwinding of modules for crash dumps
109+
lr r3, [ARC_REG_PID]
110+
or r3, r3, MMU_ENABLE
111+
sr r3, [ARC_REG_PID]
112+
107113
lsr r3, r2, 8
108114
bmsk r3, r3, 7
109115
brne r3, ECR_C_MCHK_DUP_TLB, 1f

arch/arc/mm/tlb.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,9 +885,6 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address,
885885

886886
local_irq_save(flags);
887887

888-
/* re-enable the MMU */
889-
write_aux_reg(ARC_REG_PID, MMU_ENABLE | read_aux_reg(ARC_REG_PID));
890-
891888
/* loop thru all sets of TLB */
892889
for (set = 0; set < mmu->sets; set++) {
893890

0 commit comments

Comments
 (0)