Skip to contentSkip to conversation

Patch "ARC: Re-enable MMU upon Machine Check exception" has been added to the 4.13-stable tree

PATCH [email protected] 1 participant 1 message Sep 22, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ARC: Re-enable MMU upon Machine Check exception

to the 4.13-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
arc-re-enable-mmu-upon-machine-check-exception.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 1ee55a8f7f6b7ca4c0c59e0b4b4e3584a085c2d3 Mon Sep 17 00:00:00 2001

From: Jose Abreu <[email protected]>
Date: Fri, 1 Sep 2017 17:00:23 +0100
Subject: ARC: Re-enable MMU upon Machine Check exception

From: Jose Abreu <[email protected]>

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.

[vgupta: moved code into low level handler to avoid in 2 places]
---
 arch/arc/kernel/entry.S |    6 ++++++
 arch/arc/mm/tlb.c       |    3 ---
 2 files changed, 6 insertions(+), 3 deletions(-)
arch/arc/kernel/entry.S +6 -0
@@ -92,6 +92,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
arch/arc/mm/tlb.c +0 -3
@@ -908,9 +908,6 @@ void do_tlb_overlap_fault(unsigned long
 
 	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++) {
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.13/arc-re-enable-mmu-upon-machine-check-exception.patch