Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ee55a8f authored by Jose Abreu's avatar Jose Abreu Committed by Vineet Gupta
Browse files

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: default avatarJose Abreu <joabreu@synopsys.com>
Reviewed-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
[vgupta: moved code into low level handler to avoid in 2 places]
parent aa7e3a5e
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -92,6 +92,12 @@ ENTRY(EV_MachineCheck)
	lr  r0, [efa]
	lr  r0, [efa]
	mov r1, sp
	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
	lsr  	r3, r2, 8
	bmsk 	r3, r3, 7
	bmsk 	r3, r3, 7
	brne    r3, ECR_C_MCHK_DUP_TLB, 1f
	brne    r3, ECR_C_MCHK_DUP_TLB, 1f
+0 −3
Original line number Original line Diff line number Diff line
@@ -908,9 +908,6 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address,


	local_irq_save(flags);
	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 */
	/* loop thru all sets of TLB */
	for (set = 0; set < mmu->sets; set++) {
	for (set = 0; set < mmu->sets; set++) {