Skip to content

Commit 92b6919

Browse files
ardbiesheuvelwilldeacon
authored andcommitted
arm64: Kconfig: force ARM64_PAN=y when enabling TTBR0 sw PAN
There are a couple of instances of Kconfig constraints where PAN must be enabled too if TTBR0 sw PAN is enabled, primarily to avoid dealing with the modified TTBR0_EL1 sysreg format that is used when 52-bit physical addressing and/or CnP are enabled (support for either implies support for hardware PAN as well, which will supersede PAN emulation if both are available) Let's simplify this, and always enable ARM64_PAN when enabling TTBR0 sw PAN. This decouples the PAN configuration from the VA size selection, permitting us to simplify the latter in subsequent patches. (Note that PAN and TTBR0 sw PAN can still be disabled after this patch, but not independently) To avoid a convoluted circular Kconfig dependency involving KCSAN, make ARM64_MTE select ARM64_PAN too, instead of depending on it. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20241212081841.2168124-13-ardb+git@google.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 9d86c3c commit 92b6919

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/arm64/Kconfig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,6 @@ config ARM64_VA_BITS_48
13791379

13801380
config ARM64_VA_BITS_52
13811381
bool "52-bit"
1382-
depends on ARM64_PAN || !ARM64_SW_TTBR0_PAN
13831382
help
13841383
Enable 52-bit virtual addressing for userspace when explicitly
13851384
requested via a hint to mmap(). The kernel will also use 52-bit
@@ -1431,7 +1430,6 @@ config ARM64_PA_BITS_48
14311430
config ARM64_PA_BITS_52
14321431
bool "52-bit"
14331432
depends on ARM64_64K_PAGES || ARM64_VA_BITS_52
1434-
depends on ARM64_PAN || !ARM64_SW_TTBR0_PAN
14351433
help
14361434
Enable support for a 52-bit physical address space, introduced as
14371435
part of the ARMv8.2-LPA extension.
@@ -1681,6 +1679,7 @@ config RODATA_FULL_DEFAULT_ENABLED
16811679
config ARM64_SW_TTBR0_PAN
16821680
bool "Emulate Privileged Access Never using TTBR0_EL1 switching"
16831681
depends on !KCSAN
1682+
select ARM64_PAN
16841683
help
16851684
Enabling this option prevents the kernel from accessing
16861685
user-space memory directly by pointing TTBR0_EL1 to a reserved
@@ -1937,7 +1936,6 @@ config ARM64_RAS_EXTN
19371936
config ARM64_CNP
19381937
bool "Enable support for Common Not Private (CNP) translations"
19391938
default y
1940-
depends on ARM64_PAN || !ARM64_SW_TTBR0_PAN
19411939
help
19421940
Common Not Private (CNP) allows translation table entries to
19431941
be shared between different PEs in the same inner shareable
@@ -2132,7 +2130,7 @@ config ARM64_MTE
21322130
depends on AS_HAS_ARMV8_5
21332131
depends on AS_HAS_LSE_ATOMICS
21342132
# Required for tag checking in the uaccess routines
2135-
depends on ARM64_PAN
2133+
select ARM64_PAN
21362134
select ARCH_HAS_SUBPAGE_FAULTS
21372135
select ARCH_USES_HIGH_VMA_FLAGS
21382136
select ARCH_USES_PG_ARCH_2

0 commit comments

Comments
 (0)