summaryrefslogtreecommitdiffstats
path: root/arch/arm64/Kconfig
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2018-12-10 09:15:15 -0500
committerWill Deacon <will.deacon@arm.com>2018-12-10 13:42:18 -0500
commit68d23da4373aba76f5300017c4746440f276698e (patch)
tree138b93b628cf77727970417690693f18eddf7c40 /arch/arm64/Kconfig
parentb9567720a1b8e739380e0241413606c056c57859 (diff)
arm64: Kconfig: Re-jig CONFIG options for 52-bit VA
Enabling 52-bit VAs for userspace is pretty confusing, since it requires you to select "48-bit" virtual addressing in the Kconfig. Rework the logic so that 52-bit user virtual addressing is advertised in the "Virtual address space size" choice, along with some help text to describe its interaction with Pointer Authentication. The EXPERT-only option to force all user mappings to the 52-bit range is then made available immediately below the VA size selection. Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/Kconfig')
-rw-r--r--arch/arm64/Kconfig47
1 files changed, 29 insertions, 18 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index ca1f93233b22..905ce1653e82 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -682,15 +682,43 @@ config ARM64_VA_BITS_47
682config ARM64_VA_BITS_48 682config ARM64_VA_BITS_48
683 bool "48-bit" 683 bool "48-bit"
684 684
685config ARM64_USER_VA_BITS_52
686 bool "52-bit (user)"
687 depends on ARM64_64K_PAGES && (ARM64_PAN || !ARM64_SW_TTBR0_PAN)
688 help
689 Enable 52-bit virtual addressing for userspace when explicitly
690 requested via a hint to mmap(). The kernel will continue to
691 use 48-bit virtual addresses for its own mappings.
692
693 NOTE: Enabling 52-bit virtual addressing in conjunction with
694 ARMv8.3 Pointer Authentication will result in the PAC being
695 reduced from 7 bits to 3 bits, which may have a significant
696 impact on its susceptibility to brute-force attacks.
697
698 If unsure, select 48-bit virtual addressing instead.
699
685endchoice 700endchoice
686 701
702config ARM64_FORCE_52BIT
703 bool "Force 52-bit virtual addresses for userspace"
704 depends on ARM64_USER_VA_BITS_52 && EXPERT
705 help
706 For systems with 52-bit userspace VAs enabled, the kernel will attempt
707 to maintain compatibility with older software by providing 48-bit VAs
708 unless a hint is supplied to mmap.
709
710 This configuration option disables the 48-bit compatibility logic, and
711 forces all userspace addresses to be 52-bit on HW that supports it. One
712 should only enable this configuration option for stress testing userspace
713 memory management code. If unsure say N here.
714
687config ARM64_VA_BITS 715config ARM64_VA_BITS
688 int 716 int
689 default 36 if ARM64_VA_BITS_36 717 default 36 if ARM64_VA_BITS_36
690 default 39 if ARM64_VA_BITS_39 718 default 39 if ARM64_VA_BITS_39
691 default 42 if ARM64_VA_BITS_42 719 default 42 if ARM64_VA_BITS_42
692 default 47 if ARM64_VA_BITS_47 720 default 47 if ARM64_VA_BITS_47
693 default 48 if ARM64_VA_BITS_48 721 default 48 if ARM64_VA_BITS_48 || ARM64_USER_VA_BITS_52
694 722
695choice 723choice
696 prompt "Physical address space size" 724 prompt "Physical address space size"
@@ -716,10 +744,6 @@ config ARM64_PA_BITS_52
716 744
717endchoice 745endchoice
718 746
719config ARM64_52BIT_VA
720 def_bool y
721 depends on ARM64_VA_BITS_48 && ARM64_64K_PAGES && (ARM64_PAN || !ARM64_SW_TTBR0_PAN)
722
723config ARM64_PA_BITS 747config ARM64_PA_BITS
724 int 748 int
725 default 48 if ARM64_PA_BITS_48 749 default 48 if ARM64_PA_BITS_48
@@ -1186,19 +1210,6 @@ config ARM64_CNP
1186 at runtime, and does not affect PEs that do not implement 1210 at runtime, and does not affect PEs that do not implement
1187 this feature. 1211 this feature.
1188 1212
1189config ARM64_FORCE_52BIT
1190 bool "Force 52-bit virtual addresses for userspace"
1191 depends on ARM64_52BIT_VA && EXPERT
1192 help
1193 For systems with 52-bit userspace VAs enabled, the kernel will attempt
1194 to maintain compatibility with older software by providing 48-bit VAs
1195 unless a hint is supplied to mmap.
1196
1197 This configuration option disables the 48-bit compatibility logic, and
1198 forces all userspace addresses to be 52-bit on HW that supports it. One
1199 should only enable this configuration option for stress testing userspace
1200 memory management code. If unsure say N here.
1201
1202endmenu 1213endmenu
1203 1214
1204config ARM64_SVE 1215config ARM64_SVE