[PATCH v2 1/1] arm64/cpufeature: Add arm64.nomte to override id-reg

Marc Zyngier maz at kernel.org
Thu Jul 29 01:47:40 PDT 2021


On Thu, 29 Jul 2021 03:07:12 +0100,
<yee.lee at mediatek.com> wrote:
> 
> From: Yee Lee <yee.lee at mediatek.com>
> 
> Add an alias, "arm64.nomte", to override id-reg and

This isn't just an alias. This patch does two things:

- it allows the ID_AA64PFR1_EL1.MTE shadow capability to be set from
  the command line,
- it provides the arm64.nomte alias that sets the above to 0 to
  disable the MTE feature.

> suppress mte feature.

s/mte/MTE/

Maybe also worth indicating *why* this is needed. Possible
justifications include errata workarounds, performance issues... Pick
your own.

> 
> Suggested-by: Marc Zyngier <maz at kernel.org>
> Suggested-by: Suzuki K Poulose <suzuki.poulose at arm.com>
> Signed-off-by: Yee Lee <yee.lee at mediatek.com>
> ---
>  arch/arm64/kernel/idreg-override.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c
> index 53a381a7f65d..d8e606fe3c21 100644
> --- a/arch/arm64/kernel/idreg-override.c
> +++ b/arch/arm64/kernel/idreg-override.c
> @@ -54,6 +54,7 @@ static const struct ftr_set_desc pfr1 __initconst = {
>  	.override	= &id_aa64pfr1_override,
>  	.fields		= {
>  	        { "bt", ID_AA64PFR1_BT_SHIFT },
> +		{ "mte", ID_AA64PFR1_MTE_SHIFT},
>  		{}
>  	},
>  };
> @@ -100,6 +101,7 @@ static const struct {
>  	{ "arm64.nopauth",
>  	  "id_aa64isar1.gpi=0 id_aa64isar1.gpa=0 "
>  	  "id_aa64isar1.api=0 id_aa64isar1.apa=0"	   },
> +	{ "arm64.nomte",		"id_aa64pfr1.mte=0" },
>  	{ "nokaslr",			"kaslr.disabled=1" },
>  };
>  

This needs to be documented in kernel-parameters.txt. See the nobti
and nopauth options for guidance.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list