Commit 1d939330 authored by Zengruan Ye's avatar Zengruan Ye Committed by Zheng Zengkai
Browse files

arm64: cpufeature: TWED support detection

virt inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I40FGG


CVE: NA

-----------------------------

TWE Delay is an optional feature in ARMv8.6 Extensions. This patch
detect this feature.

Signed-off-by: default avatarZengruan Ye <yezengruan@huawei.com>
Signed-off-by: default avatarJingyi Wang <wangjingyi11@huawei.com>
Reviewed-by: default avatarKeqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent d7b8dcbe
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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
+2 −1
Original line number Diff line number Diff line
@@ -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 */
+12 −0
Original line number Diff line number Diff line
@@ -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
	{},
};