diff options
author | Amit Daniel Kachhap <amit.kachhap@arm.com> | 2020-03-13 14:35:01 +0530 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2020-03-18 09:50:21 +0000 |
commit | e51f5f56dd69e009e22af8a4354dce0817a7addb (patch) | |
tree | 182804e98137612faba8658ff92a128e37ac5c2b /arch/arm64/include/asm/asm_pointer_auth.h | |
parent | cdcb61ae4c56f9edcd1eca4c2df444f3f5e96e1d (diff) | |
download | linux-e51f5f56dd69e009e22af8a4354dce0817a7addb.tar.gz linux-e51f5f56dd69e009e22af8a4354dce0817a7addb.tar.bz2 linux-e51f5f56dd69e009e22af8a4354dce0817a7addb.zip |
arm64: suspend: restore the kernel ptrauth keys
This patch restores the kernel keys from current task during cpu resume
after the mmu is turned on and ptrauth is enabled.
A flag is added in macro ptrauth_keys_install_kernel to check if isb
instruction needs to be executed.
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Reviewed-by: Vincenzo Frascino <Vincenzo.Frascino@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/asm_pointer_auth.h')
-rw-r--r-- | arch/arm64/include/asm/asm_pointer_auth.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/asm_pointer_auth.h b/arch/arm64/include/asm/asm_pointer_auth.h index d3f4aee42851..ce2a8486992b 100644 --- a/arch/arm64/include/asm/asm_pointer_auth.h +++ b/arch/arm64/include/asm/asm_pointer_auth.h @@ -39,14 +39,16 @@ alternative_if ARM64_HAS_GENERIC_AUTH alternative_else_nop_endif .endm - .macro ptrauth_keys_install_kernel tsk, tmp1, tmp2, tmp3 + .macro ptrauth_keys_install_kernel tsk, sync, tmp1, tmp2, tmp3 alternative_if ARM64_HAS_ADDRESS_AUTH mov \tmp1, #THREAD_KEYS_KERNEL add \tmp1, \tsk, \tmp1 ldp \tmp2, \tmp3, [\tmp1, #PTRAUTH_KERNEL_KEY_APIA] msr_s SYS_APIAKEYLO_EL1, \tmp2 msr_s SYS_APIAKEYHI_EL1, \tmp3 + .if \sync == 1 isb + .endif alternative_else_nop_endif .endm @@ -55,7 +57,7 @@ alternative_else_nop_endif .macro ptrauth_keys_install_user tsk, tmp1, tmp2, tmp3 .endm - .macro ptrauth_keys_install_kernel tsk, tmp1, tmp2, tmp3 + .macro ptrauth_keys_install_kernel tsk, sync, tmp1, tmp2, tmp3 .endm #endif /* CONFIG_ARM64_PTR_AUTH */ |