Skip to contentSkip to conversation

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

PATCH New Will Deacon 4 participants 4 messages Jun 22, 2018 arm64

lore
Share & tools
lore
#0 lore raw

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
index d2856b129097..f24892a40d2c 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
#1 lore raw

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

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.

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
#2 lore raw

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

In reply to Will Deacon

Hi Will,

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.

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
index d2856b129097..f24892a40d2c 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
maintainer Applied
#3 lore raw

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

In reply to Will Deacon
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.

Applied. Thanks.

Signature · 1 line
Catalin