[PATCH v6 1/3] arm64: mte: make the per-task SCTLR_EL1 field usable elsewhere

Will Deacon will at kernel.org
Tue Jan 26 07:49:59 EST 2021


On Tue, Dec 29, 2020 at 10:59:13PM -0800, Peter Collingbourne wrote:
> In an upcoming change we are going to introduce per-task SCTLR_EL1
> bits for PAC. Move the existing per-task SCTLR_EL1 field out of the
> MTE-specific code so that we will be able to use it from both the
> PAC and MTE code paths and make the task switching code more efficient.
> 
> Signed-off-by: Peter Collingbourne <pcc at google.com>
> Link: https://linux-review.googlesource.com/id/Ic65fac78a7926168fa68f9e8da591c9e04ff7278
> ---
>  arch/arm64/Kconfig                 |  4 +++
>  arch/arm64/include/asm/mte.h       |  4 ---
>  arch/arm64/include/asm/processor.h | 10 ++++++-
>  arch/arm64/kernel/mte.c            | 47 ++++++------------------------
>  arch/arm64/kernel/process.c        | 34 +++++++++++++++++----
>  5 files changed, 50 insertions(+), 49 deletions(-)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 05e17351e4f3..82e38d1ca012 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -348,6 +348,9 @@ config KASAN_SHADOW_OFFSET
>  	default 0xeffffff800000000 if ARM64_VA_BITS_36 && KASAN_SW_TAGS
>  	default 0xffffffffffffffff
>  
> +config ARM64_NEED_SCTLR_USER
> +	bool
> +
>  source "arch/arm64/Kconfig.platforms"
>  
>  menu "Kernel Features"
> @@ -1653,6 +1656,7 @@ config ARM64_MTE
>  	# Required for tag checking in the uaccess routines
>  	depends on ARM64_PAN
>  	select ARCH_USES_HIGH_VMA_FLAGS
> +	select ARM64_NEED_SCTLR_USER

I'm not sure I'd bother with this; is it the end of the world if we do this
unconditionally?

Will



More information about the linux-arm-kernel mailing list