Skip to contentSkip to conversation

arm64: kpti: Use early_param for kpti= command-line option

PATCH New Will Deacon 3 participants 4 messages Jun 20, 2018 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: kpti: Use early_param for kpti= command-line option

We inspect __kpti_forced early on as part of the cpufeature enable callback which remaps the swapper page table using non-global entries.

Ensure that __kpti_forced has been updated to reflect the kpti= command-line option before we start using it.

---
 arch/arm64/kernel/cpufeature.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/cpufeature.c +1 -1
index d2856b129097..112b071e793f 100644
@@ -937,7 +937,7 @@ static int __init parse_kpti(char *str)
 	__kpti_forced = enabled ? 1 : -1;
 	return 0;
 }
-__setup("kpti=", parse_kpti);
+early_param("kpti=", parse_kpti);
 #endif	/* CONFIG_UNMAP_KERNEL_AT_EL0 */
 
 #ifdef CONFIG_ARM64_HW_AFDBM
Signature · 1 line
2.1.4
maintainer
#1 lore raw

PATCH 1/1 arm64: kpti: Use early_param for kpti= command-line option

Quoted 8 lines · Will Deacon

We inspect __kpti_forced early on as part of the cpufeature enable callback which remaps the swapper page table using non-global entries.

Ensure that __kpti_forced has been updated to reflect the kpti= command-line option before we start using it.

Does it need a fixes tag?

Fixes ea1e3de85e94 ("arm64: entry: Add fake CPU feature for unmapping the kernel at EL0")
Signature · 1 line
Catalin
#2 lore raw

PATCH 1/1 arm64: kpti: Use early_param for kpti= command-line option

Quoted 7 lines · Catalin Marinas
Quoted 6 lines · Will Deacon

We inspect __kpti_forced early on as part of the cpufeature enable callback which remaps the swapper page table using non-global entries.

Ensure that __kpti_forced has been updated to reflect the kpti= command-line option before we start using it.

Quoted 6 lines
Quoted 2 lines

Does it need a fixes tag?

Fixes ea1e3de85e94 ("arm64: entry: Add fake CPU feature for unmapping the kernel at EL0")

Perhaps, but really this is just a performance optimisation for the kpti=off case where we don't actually need to put the nG mappings down.

Will

#3 lore raw

PATCH 1/1 arm64: kpti: Use early_param for kpti= command-line option

In reply to Will Deacon

Hi Will,

Quoted 17 lines · Will Deacon

We inspect __kpti_forced early on as part of the cpufeature enable callback which remaps the swapper page table using non-global entries.

Ensure that __kpti_forced has been updated to reflect the kpti= command-line option before we start using it.

---
 arch/arm64/kernel/cpufeature.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/cpufeature.c +0 -0
index d2856b129097..112b071e793f 100644

arch/arm64/kernel/cpufeature.c static int __init parse_kpti(char *str) · line 940

Quoted 5 lines
arch/arm64/kernel/cpufeature.c +1 -1
@@ -937,7 +937,7 @@ static int __init parse_kpti(char *str)
 	__kpti_forced = enabled ? 1 : -1;
 	return 0;
 }
-__setup("kpti=", parse_kpti);
+early_param("kpti=", parse_kpti);

%s/kpti=/kpti

Thanks!

Best Regards,
Wei

Quoted 4 lines
arch/arm64/kernel/cpufeature.c +0 -0
 #endif	/* CONFIG_UNMAP_KERNEL_AT_EL0 */
 
 #ifdef CONFIG_ARM64_HW_AFDBM