]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
arm64: Make sure SPsel is always set
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 26 Sep 2017 14:57:16 +0000 (15:57 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 12 Oct 2017 21:20:39 +0000 (16:20 -0500)
BugLink: http://bugs.launchpad.net/bugs/1721777
commit 5371513fb338fb9989c569dc071326d369d6ade8 upstream.

When the kernel is entered at EL2 on an ARMv8.0 system, we construct
the EL1 pstate and make sure this uses the the EL1 stack pointer
(we perform an exception return to EL1h).

But if the kernel is either entered at EL1 or stays at EL2 (because
we're on a VHE-capable system), we fail to set SPsel, and use whatever
stack selection the higher exception level has choosen for us.

Let's not take any chance, and make sure that SPsel is set to one
before we decide the mode we're going to run in.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-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>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/arm64/kernel/head.S

index adb0910b88f5f26c1562a7fef6f00f29ee9ec391..8c908829d3c4c661657c9cc2e433d0611a55ab9b 100644 (file)
@@ -381,6 +381,7 @@ ENTRY(kimage_vaddr)
  * booted in EL1 or EL2 respectively.
  */
 ENTRY(el2_setup)
+       msr     SPsel, #1                       // We want to use SP_EL{1,2}
        mrs     x0, CurrentEL
        cmp     x0, #CurrentEL_EL2
        b.eq    1f