* Patch "arm64: kernel: Fix unmasked debug exceptions when restoring mdscr_el1" has been added to the 4.7-stable tree
@ 2016-09-05 13:55 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-09-05 13:55 UTC (permalink / raw)
To: james.morse, catalin.marinas, gregkh, lorenzo.pieralisi,
will.deacon
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
arm64: kernel: Fix unmasked debug exceptions when restoring mdscr_el1
to the 4.7-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:
arm64-kernel-fix-unmasked-debug-exceptions-when-restoring-mdscr_el1.patch
and it can be found in the queue-4.7 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 744c6c37cc18705d19e179622f927f5b781fe9cc Mon Sep 17 00:00:00 2001
From: James Morse <james.morse@arm.com>
Date: Fri, 26 Aug 2016 16:03:42 +0100
Subject: arm64: kernel: Fix unmasked debug exceptions when restoring mdscr_el1
From: James Morse <james.morse@arm.com>
commit 744c6c37cc18705d19e179622f927f5b781fe9cc upstream.
Changes to make the resume from cpu_suspend() code behave more like
secondary boot caused debug exceptions to be unmasked early by
__cpu_setup(). We then go on to restore mdscr_el1 in cpu_do_resume(),
potentially taking break or watch points based on uninitialised registers.
Mask debug exceptions in cpu_do_resume(), which is specific to resume
from cpu_suspend(). Debug exceptions will be restored to their original
state by local_dbg_restore() in cpu_suspend(), which runs after
hw_breakpoint_restore() has re-initialised the other registers.
Reported-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Fixes: cabe1c81ea5b ("arm64: Change cpu_resume() to enable mmu early then access sleep_sp by va")
Signed-off-by: James Morse <james.morse@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/mm/proc.S | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -100,7 +100,16 @@ ENTRY(cpu_do_resume)
msr tcr_el1, x8
msr vbar_el1, x9
+
+ /*
+ * __cpu_setup() cleared MDSCR_EL1.MDE and friends, before unmasking
+ * debug exceptions. By restoring MDSCR_EL1 here, we may take a debug
+ * exception. Mask them until local_dbg_restore() in cpu_suspend()
+ * resets them.
+ */
+ disable_dbg
msr mdscr_el1, x10
+
msr sctlr_el1, x12
/*
* Restore oslsr_el1 by writing oslar_el1
Patches currently in stable-queue which might be from james.morse@arm.com are
queue-4.7/arm64-kernel-fix-unmasked-debug-exceptions-when-restoring-mdscr_el1.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-05 13:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-05 13:55 Patch "arm64: kernel: Fix unmasked debug exceptions when restoring mdscr_el1" has been added to the 4.7-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).