UPSTREAM: arm64: mm: Map entry trampoline into trampoline and kernel page tables

The exception entry trampoline needs to be mapped at the same virtual
address in both the trampoline page table (which maps nothing else)
and also the kernel page table, so that we can swizzle TTBR1_EL1 on
exceptions from and return to EL0.

This patch maps the trampoline at a fixed virtual address in the fixmap
area of the kernel virtual address space, which allows the kernel proper
to be randomized with respect to the trampoline when KASLR is enabled.

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Tested-by: Shanker Donthineni <shankerd@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 51a0048beb449682d632d0af52a515adb9f9882e)

[toddpoynor@google.com: fixup context, remove rodata_enabled check]
Change-Id: I920ad6850e4e9b03edea4a84d8603302c28eef37
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Git-commit: 5e54c4b6a795285d314fe0bbab42f06414b9c523
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
4 files changed