diff options
author | Vladimir Murzin <vladimir.murzin@arm.com> | 2017-04-24 11:40:48 +0200 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2017-04-26 11:57:53 +0200 |
commit | 6d80594936914e798b1b54b3bfe4bd68d8418966 (patch) | |
tree | 870eb3154904c3f0b590b72f139756c21c87c322 | |
parent | Merge branch 'kprobe-fixes' of https://git.linaro.org/people/tixy/kernel into... (diff) | |
download | linux-6d80594936914e798b1b54b3bfe4bd68d8418966.tar.xz linux-6d80594936914e798b1b54b3bfe4bd68d8418966.zip |
ARM: 8670/1: V7M: Do not corrupt vector table around v7m_invalidate_l1 call
We save/restore registers around v7m_invalidate_l1 to address pointed
by r12, which is vector table, so the first eight entries are
overwritten with a garbage. We already have stack setup at that stage,
so use it to save/restore register.
Fixes: 6a8146f420be ("ARM: 8609/1: V7M: Add support for the Cortex-M7 processor")
Cc: <stable@vger.kernel.org>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | arch/arm/mm/proc-v7m.S | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mm/proc-v7m.S b/arch/arm/mm/proc-v7m.S index 8dea61640cc1..50497778c2e5 100644 --- a/arch/arm/mm/proc-v7m.S +++ b/arch/arm/mm/proc-v7m.S @@ -147,10 +147,10 @@ __v7m_setup_cont: @ Configure caches (if implemented) teq r8, #0 - stmneia r12, {r0-r6, lr} @ v7m_invalidate_l1 touches r0-r6 + stmneia sp, {r0-r6, lr} @ v7m_invalidate_l1 touches r0-r6 blne v7m_invalidate_l1 teq r8, #0 @ re-evalutae condition - ldmneia r12, {r0-r6, lr} + ldmneia sp, {r0-r6, lr} @ Configure the System Control Register to ensure 8-byte stack alignment @ Note the STKALIGN bit is either RW or RAO. |