Add option to disable mte support
Subsystems (2)
v2 cover Add option to disable mte support
From: Yee Lee <[email protected]>
For some case of low-end devices with limited resources, an option to disable mte support is necessary.
This patch Adds an alias in id-reg override mechanism to suppress the mte feature via passing a param.
=== Test ===
QEMU5.2 + mte
passed "arm64.nomte" in cmdline
boot log:
..(skip)
[ 0.000000] CPU features: SYS_ID_AA64PFR1_EL1[11:8]: forced to 0
Changed since v2:
- Use id-reg override machanism to suppress feature.
Yee Lee (1):
arm64/cpufeature: Add arm64.nomte to override id-reg
arch/arm64/kernel/idreg-override.c | 2 ++ 1 file changed, 2 insertions(+)
Signature · 1 line
2.18.0
PATCH v2 1/1 arm64/cpufeature: Add arm64.nomte to override id-reg
From: Yee Lee <[email protected]>
Add an alias, "arm64.nomte", to override id-reg and suppress mte feature.
--- arch/arm64/kernel/idreg-override.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/kernel/idreg-override.c +2 -0
@@ -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" }, };
Signature · 1 line
2.18.0
Re: [PATCH v2 1/1] arm64/cpufeature: Add arm64.nomte to override id-reg
Quoted 4 lines · On Thu, 29 Jul 2021 03:07:12 +0100, <[email protected]> wrote:
From: Yee Lee <[email protected]>
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.
Quoted 1 line
suppress mte feature.
s/mte/MTE/
Maybe also worth indicating *why* this is needed. Possible justifications include errata workarounds, performance issues... Pick your own.
Quoted 21 lines
Suggested-by Marc Zyngier <[email protected]>Suggested-by Suzuki K Poulose <[email protected]>Signed-off-by Yee Lee <[email protected]>--- arch/arm64/kernel/idreg-override.c | 2 ++ 1 file changed, 2 insertions(+)arch/arm64/kernel/idreg-override.c +1
-0@@ -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}, {} }, };
arch/arm64/kernel/idreg-override.c static const struct { · line 107
Quoted 7 lines
arch/arm64/kernel/idreg-override.c +1
-0@@ -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.
Signature · 6 lines
Without deviation from the norm, progress is not possible. _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek