]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
arm64: sdei: Add trampoline code for remapping the kernel
authorJames Morse <james.morse@arm.com>
Wed, 2 May 2018 20:39:00 +0000 (22:39 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 May 2018 14:31:29 +0000 (16:31 +0200)
commit6cc2dc98591b8c11fb6457071a09133f0a2e863f
tree1fb7c8250341e07eab8d3446750c66f73722833e
parent0c2d8342317de7533032f8d095839c03e0cb90b6
arm64: sdei: Add trampoline code for remapping the kernel

BugLink: https://bugs.launchpad.net/bugs/1768630
When CONFIG_UNMAP_KERNEL_AT_EL0 is set the SDEI entry point and the rest
of the kernel may be unmapped when we take an event. If this may be the
case, use an entry trampoline that can switch to the kernel page tables.

We can't use the provided PSTATE to determine whether to switch page
tables as we may have interrupted the kernel's entry trampoline, (or a
normal-priority event that interrupted the kernel's entry trampoline).
Instead test for a user ASID in ttbr1_el1.

Save a value in regs->addr_limit to indicate whether we need to restore
the original ASID when returning from this event. This value is only used
by do_page_fault(), which we don't call with the SDEI regs.

Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 79e9aa59dc29a995921fb01e64cd36b73cf5abe0)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/arm64/include/asm/mmu.h
arch/arm64/include/asm/sdei.h
arch/arm64/kernel/entry.S
arch/arm64/kernel/sdei.c