Skip to contentSkip to conversation

arm64: implement x86-compatible KPTI cmdline options

PATCH New Stanislav Kholmanskikh 2 participants 3 messages Aug 24, 2018 – Oct 1, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: implement x86-compatible KPTI cmdline options

Both x86 and arm64 have KPTI. On both the archs the KPTI state can be controlled via kernel cmdline, but using different options. For x86 there are 'pti' and 'nopti', for arm64 - the undocumented 'kpti' option.

Having two distinct options for one feature seems to be unnecessary, and may complicate things a bit in mixed environments, so unification here seems to be a good idea.

I think x86 is a better candidate to serve as the common basis, since
a) its options are already documented, b) it has KPTI merged earlier,
c) it's more popular platform.

This patch implements 'pti' and 'nopti' for arm64, keeping 'kpti' for backwards compatibility.

---
 Documentation/admin-guide/kernel-parameters.txt |    4 +-
 arch/arm64/kernel/cpufeature.c                  |   41 +++++++++++++++++++++++
 2 files changed, 43 insertions(+), 2 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +2 -2
index bffb0ca..f7edd83 100644
@@ -3492,7 +3492,7 @@
 	pt.		[PARIDE]
 			See Documentation/blockdev/paride.txt.
 
-	pti=		[X86_64] Control Page Table Isolation of user and
+	pti=		[X86_64,ARM64] Control Page Table Isolation of user and
 			kernel address spaces.  Disabling this feature
 			removes hardening, but improves performance of
 			system calls and interrupts.
@@ -3504,7 +3504,7 @@
 
 			Not specifying this option is equivalent to pti=auto.
 
-	nopti		[X86_64]
+	nopti		[X86_64,ARM64]
 			Equivalent to pti=off
 
 	pty.legacy_count=
arch/arm64/kernel/cpufeature.c +41 -0

53 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 arm64: implement x86-compatible KPTI cmdline options

Quoted 13 lines · Stanislav Kholmanskikh

Both x86 and arm64 have KPTI. On both the archs the KPTI state can be controlled via kernel cmdline, but using different options. For x86 there are 'pti' and 'nopti', for arm64 - the undocumented 'kpti' option.

Having two distinct options for one feature seems to be unnecessary, and may complicate things a bit in mixed environments, so unification here seems to be a good idea.

I think x86 is a better candidate to serve as the common basis, since
a) its options are already documented, b) it has KPTI merged earlier,
c) it's more popular platform.

Quoted 8 lines

This patch implements 'pti' and 'nopti' for arm64, keeping 'kpti' for backwards compatibility.

---
 Documentation/admin-guide/kernel-parameters.txt |    4 +-
 arch/arm64/kernel/cpufeature.c                  |   41 +++++++++++++++++++++++
 2 files changed, 43 insertions(+), 2 deletions(-)

Is there a real need for this? Most architectures don't have parity on command-line options, and the ship has already sailed for this option. We didn't deliberately diverge, but by the time we realised that x86 had chosen 'pti', we'd already grown backports (e.g. Android) using 'kpti'. For a while we had 'kaiser', but that got changed early enough.

The important thing is that it defaults safe, so I'm not really inclined to merge this patch.

Will

#2 lore raw

PATCH 1/1 arm64: implement x86-compatible KPTI cmdline options

Quoted 23 lines · Will Deacon
Quoted 13 lines · Stanislav Kholmanskikh

Both x86 and arm64 have KPTI. On both the archs the KPTI state can be controlled via kernel cmdline, but using different options. For x86 there are 'pti' and 'nopti', for arm64 - the undocumented 'kpti' option.

Having two distinct options for one feature seems to be unnecessary, and may complicate things a bit in mixed environments, so unification here seems to be a good idea.

I think x86 is a better candidate to serve as the common basis, since
a) its options are already documented, b) it has KPTI merged earlier,
c) it's more popular platform.

Quoted 8 lines

This patch implements 'pti' and 'nopti' for arm64, keeping 'kpti' for backwards compatibility.

---
 Documentation/admin-guide/kernel-parameters.txt |    4 +-
 arch/arm64/kernel/cpufeature.c                  |   41 +++++++++++++++++++++++
 2 files changed, 43 insertions(+), 2 deletions(-)
Quoted 5 lines

Is there a real need for this? Most architectures don't have parity on command-line options, and the ship has already sailed for this option. We didn't deliberately diverge, but by the time we realised that x86 had chosen 'pti', we'd already grown backports (e.g. Android) using 'kpti'. For a while we had 'kaiser', but that got changed early enough.

No, to my knowledge, there is no practical use case for this. It was only driven by my intention to 'improve' the current state of the things here.

Thank you.

Quoted 6 lines

The important thing is that it defaults safe, so I'm not really inclined to merge this patch.

Will