summaryrefslogtreecommitdiff
path: root/lib/string_helpers.c
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2016-09-02 14:54:03 +0100
committerAmit Pundir <amit.pundir@linaro.org>2016-10-12 17:34:22 +0530
commit914f9389202186e1fa876fe5f82c2c6984388d00 (patch)
tree132ac9b40e2ab1097dddcc60251528aa75db1841 /lib/string_helpers.c
parentfb82efd29dd555a19ee378a16ad6fabbb4fcc951 (diff)
FROMLIST: arm64: Disable TTBR0_EL1 during normal kernel execution
When the TTBR0 PAN feature is enabled, the kernel entry points need to disable access to TTBR0_EL1. The PAN status of the interrupted context is stored as part of the saved pstate, reusing the PSR_PAN_BIT (22). Restoring access to TTBR0_PAN is done on exception return if returning to user or returning to a context where PAN was disabled. Context switching via switch_mm() must defer the update of TTBR0_EL1 until a return to user or an explicit uaccess_enable() call. Special care needs to be taken for two cases where TTBR0_EL1 is set outside the normal kernel context switch operation: EFI run-time services (via efi_set_pgd) and CPU suspend (via cpu_(un)install_idmap). Code has been added to avoid deferred TTBR0_EL1 switching as in switch_mm() and restore the reserved TTBR0_EL1 when uninstalling the special TTBR0_EL1. This patch also removes a stale comment on the switch_mm() function. Cc: Will Deacon <will.deacon@arm.com> Cc: James Morse <james.morse@arm.com> Cc: Kees Cook <keescook@chromium.org> Cc: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Change-Id: Id1198cf1cde022fad10a94f95d698fae91d742aa (cherry picked from commit d26cfd64c973b31f73091c882e07350e14fdd6c9) Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions