arm64: kpti: Use early_param for kpti= command-line option
PATCH v2 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.
---
v1->v2: Fix typo (remove '=' from option)
arch/arm64/kernel/cpufeature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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);#endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */ #ifdef CONFIG_ARM64_HW_AFDBM
Signature · 1 line
2.1.4
PATCH v2 1/1 arm64: kpti: Use early_param for kpti= command-line option
Quoted 6 lines · Will Deacon
We inspect
__kpti_forcedearly on as part of the cpufeature enable callback which remaps the swapper page table using non-global entries.Ensure that
__kpti_forcedhas been updated to reflect the kpti= command-line option before we start using it.
This also fixes the case where SPE driver complains about missing kpti=off even when it's present as __setup parse kpti only after boot CPU detects and marks ARM64_UNMAP_KERNEL_AT_EL0 capability.
Signature · 2 lines
Regards, Sudeep
PATCH v2 1/1 arm64: kpti: Use early_param for kpti= command-line option
In reply to Will DeaconHi Will,
Quoted 8 lines · Will Deacon
We inspect
__kpti_forcedearly on as part of the cpufeature enable callback which remaps the swapper page table using non-global entries.Ensure that
__kpti_forcedhas been updated to reflect the kpti= command-line option before we start using it.Reported-by Wei Xu <[email protected]>Signed-off-by Will Deacon <[email protected]>
Thanks!
Tested and works on a hisilicon platform.
Best Regards,
Wei
Quoted 20 lines
---
v1->v2: Fix typo (remove '=' from option)arch/arm64/kernel/cpufeature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)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);#endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */ #ifdef CONFIG_ARM64_HW_AFDBM
PATCH v2 1/1 arm64: kpti: Use early_param for kpti= command-line option
In reply to Will DeaconQuoted 8 lines · Will Deacon
We inspect
__kpti_forcedearly on as part of the cpufeature enable callback which remaps the swapper page table using non-global entries.Ensure that
__kpti_forcedhas been updated to reflect the kpti= command-line option before we start using it.Reported-by Wei Xu <[email protected]>Signed-off-by Will Deacon <[email protected]>
Applied. Thanks.
Signature · 1 line
Catalin