diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 03b378c348f094339783d7f6e87f65fa9895cf27..109d8a18f268e0826c8858cefb3ce30c21596b63 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1794,6 +1794,16 @@ config ARM64_MTE endmenu +menu "ARMv8.6 architectural features" + +config ARM64_TWED + bool "Enable support for delayed trapping of WFE" + default y + help + Delayed Trapping of WFE (part of the ARMv8.6 Extensions) + +endmenu + config ARM64_SVE bool "ARM Scalable Vector Extension support" default y diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h index 47f8fae7ecdb00f4a2d4ebb5075f3593e72ca35d..aba1209a684c3c0d80b4ef69acd8b4f22ffc34bf 100644 --- a/arch/arm64/include/asm/cpucaps.h +++ b/arch/arm64/include/asm/cpucaps.h @@ -69,7 +69,8 @@ #define ARM64_HAS_MPAM 59 #define ARM64_WORKAROUND_HISI_HIP08_RU_PREFETCH 60 #define ARM64_CLEARPAGE_STNP 61 +#define ARM64_HAS_TWED 62 -#define ARM64_NCAPS 62 +#define ARM64_NCAPS 63 #endif /* __ASM_CPUCAPS_H */ diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 15b49edfe2c82d5db3d58d8351e7c95615bf4b6c..1e20a579d30a216eac86492d396bf2ff6b89adaf 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2192,6 +2192,18 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .type = ARM64_CPUCAP_SYSTEM_FEATURE, .matches = can_clearpage_use_stnp, }, +#ifdef CONFIG_ARM64_TWED + { + .desc = "Delayed Trapping of WFE", + .capability = ARM64_HAS_TWED, + .type = ARM64_CPUCAP_SYSTEM_FEATURE, + .matches = has_cpuid_feature, + .sys_reg = SYS_ID_AA64MMFR1_EL1, + .field_pos = ID_AA64MMFR1_TWED_SHIFT, + .sign = FTR_UNSIGNED, + .min_field_value = 1, + }, +#endif {}, };