diff options
author | Will Deacon <will.deacon@arm.com> | 2017-08-10 13:58:16 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2017-12-11 13:40:35 +0000 |
commit | 27a921e75711d924617269e0ba4adb8bae9fd0d1 (patch) | |
tree | bb4db9089fb6bb5606197222704a7522d2c9b2c6 /arch/arm64/kernel/entry.S | |
parent | 158d495899ce55db453f682a8ac8390d5a426578 (diff) | |
download | linux-stable-27a921e75711d924617269e0ba4adb8bae9fd0d1.tar.gz linux-stable-27a921e75711d924617269e0ba4adb8bae9fd0d1.tar.bz2 linux-stable-27a921e75711d924617269e0ba4adb8bae9fd0d1.zip |
arm64: mm: Fix and re-enable ARM64_SW_TTBR0_PAN
With the ASID now installed in TTBR1, we can re-enable ARM64_SW_TTBR0_PAN
by ensuring that we switch to a reserved ASID of zero when disabling
user access and restore the active user ASID on the uaccess enable path.
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>
Diffstat (limited to 'arch/arm64/kernel/entry.S')
-rw-r--r-- | arch/arm64/kernel/entry.S | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 804e43c9cb0b..d454d8ed45e4 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -184,7 +184,7 @@ alternative_if ARM64_HAS_PAN alternative_else_nop_endif .if \el != 0 - mrs x21, ttbr0_el1 + mrs x21, ttbr1_el1 tst x21, #0xffff << 48 // Check for the reserved ASID orr x23, x23, #PSR_PAN_BIT // Set the emulated PAN in the saved SPSR b.eq 1f // TTBR0 access already disabled @@ -248,7 +248,7 @@ alternative_else_nop_endif tbnz x22, #22, 1f // Skip re-enabling TTBR0 access if the PSR_PAN_BIT is set .endif - __uaccess_ttbr0_enable x0 + __uaccess_ttbr0_enable x0, x1 .if \el == 0 /* |