Skip to content

Commit 6698453

Browse files
LeviYeoReumctmarinas
authored andcommitted
arm64/cpufeature: Add FEAT_MTE_TAGGED_FAR feature
Add FEAT_MTE_TAGGED_FAR cpucap which makes FAR_ELx report all non-address bits on a synchronous MTE tag check fault since Armv8.9 Signed-off-by: Yeoreum Yun <[email protected]> Acked-by: Yury Khrustalev <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 19272b3 commit 6698453

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ static const struct arm64_ftr_bits ftr_id_aa64pfr1[] = {
320320

321321
static const struct arm64_ftr_bits ftr_id_aa64pfr2[] = {
322322
ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR2_EL1_FPMR_SHIFT, 4, 0),
323+
ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR2_EL1_MTEFAR_SHIFT, 4, ID_AA64PFR2_EL1_MTEFAR_NI),
323324
ARM64_FTR_END,
324325
};
325326

@@ -2874,6 +2875,13 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
28742875
.matches = has_cpuid_feature,
28752876
ARM64_CPUID_FIELDS(ID_AA64PFR1_EL1, MTE, MTE3)
28762877
},
2878+
{
2879+
.desc = "FAR on MTE Tag Check Fault",
2880+
.capability = ARM64_MTE_FAR,
2881+
.type = ARM64_CPUCAP_SYSTEM_FEATURE,
2882+
.matches = has_cpuid_feature,
2883+
ARM64_CPUID_FIELDS(ID_AA64PFR2_EL1, MTEFAR, IMP)
2884+
},
28772885
#endif /* CONFIG_ARM64_MTE */
28782886
{
28792887
.desc = "RCpc load-acquire (LDAPR)",

arch/arm64/tools/cpucaps

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ MPAM
6868
MPAM_HCR
6969
MTE
7070
MTE_ASYMM
71+
MTE_FAR
7172
SME
7273
SME_FA64
7374
SME2

0 commit comments

Comments
 (0)