* [PATCH v2] arm64: kpti: Use early_param for kpti= command-line option
@ 2018-06-22 9:25 Will Deacon
2018-06-22 10:25 ` Sudeep Holla
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Will Deacon @ 2018-06-22 9:25 UTC (permalink / raw)
To: linux-arm-kernel
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.
Reported-by: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
v1->v2: Fix typo (remove '=' from option)
arch/arm64/kernel/cpufeature.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index d2856b129097..f24892a40d2c 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -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
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] arm64: kpti: Use early_param for kpti= command-line option
2018-06-22 9:25 [PATCH v2] arm64: kpti: Use early_param for kpti= command-line option Will Deacon
@ 2018-06-22 10:25 ` Sudeep Holla
2018-06-22 10:47 ` Wei Xu
2018-06-22 16:17 ` Catalin Marinas
2 siblings, 0 replies; 4+ messages in thread
From: Sudeep Holla @ 2018-06-22 10:25 UTC (permalink / raw)
To: linux-arm-kernel
On 22/06/18 10:25, Will Deacon wrote:
> 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.
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] arm64: kpti: Use early_param for kpti= command-line option
2018-06-22 9:25 [PATCH v2] arm64: kpti: Use early_param for kpti= command-line option Will Deacon
2018-06-22 10:25 ` Sudeep Holla
@ 2018-06-22 10:47 ` Wei Xu
2018-06-22 16:17 ` Catalin Marinas
2 siblings, 0 replies; 4+ messages in thread
From: Wei Xu @ 2018-06-22 10:47 UTC (permalink / raw)
To: linux-arm-kernel
Hi Will,
On 2018/6/22 17:25, Will Deacon wrote:
> 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.
>
> Reported-by: Wei Xu <xuwei5@hisilicon.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Thanks!
Tested and works on a hisilicon platform.
Tested-by: Wei Xu <xuwei5@hisilicon.com>
Best Regards,
Wei
> ---
>
> v1->v2: Fix typo (remove '=' from option)
>
> arch/arm64/kernel/cpufeature.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index d2856b129097..f24892a40d2c 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] arm64: kpti: Use early_param for kpti= command-line option
2018-06-22 9:25 [PATCH v2] arm64: kpti: Use early_param for kpti= command-line option Will Deacon
2018-06-22 10:25 ` Sudeep Holla
2018-06-22 10:47 ` Wei Xu
@ 2018-06-22 16:17 ` Catalin Marinas
2 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2018-06-22 16:17 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jun 22, 2018 at 10:25:25AM +0100, Will Deacon wrote:
> 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.
>
> Reported-by: Wei Xu <xuwei5@hisilicon.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Applied. Thanks.
--
Catalin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-06-22 16:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-22 9:25 [PATCH v2] arm64: kpti: Use early_param for kpti= command-line option Will Deacon
2018-06-22 10:25 ` Sudeep Holla
2018-06-22 10:47 ` Wei Xu
2018-06-22 16:17 ` Catalin Marinas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.