Skip to content

Commit

Permalink
ARC: Re-enable MMU upon Machine Check exception
Browse files Browse the repository at this point in the history
commit 1ee55a8 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>
  • Loading branch information
Jose Abreu authored and Greg Kroah-Hartman committed Sep 27, 2017
1 parent 88645cf commit 13bbb82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions arch/arc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ ENTRY(EV_MachineCheck)
lr r0, [efa]
mov r1, sp

; hardware auto-disables MMU, re-enable it to allow kernel vaddr
; access for say stack unwinding of modules for crash dumps
lr r3, [ARC_REG_PID]
or r3, r3, MMU_ENABLE
sr r3, [ARC_REG_PID]

lsr r3, r2, 8
bmsk r3, r3, 7
brne r3, ECR_C_MCHK_DUP_TLB, 1f
Expand Down
3 changes: 0 additions & 3 deletions arch/arc/mm/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,6 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address,

local_irq_save(flags);

/* re-enable the MMU */
write_aux_reg(ARC_REG_PID, MMU_ENABLE | read_aux_reg(ARC_REG_PID));

/* loop thru all sets of TLB */
for (set = 0; set < mmu->sets; set++) {

Expand Down

0 comments on commit 13bbb82

Please sign in to comment.