arm64: Add a capability for FEAT_ECV

Add a new capability to detect the Enhanced Counter Virtualization
feature (FEAT_ECV).

Reviewed-by: Oliver Upton <oupton@google.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211017124225.3018098-15-maz@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: hongrongxuan <hongrongxuan@huawei.com>

 Conflicts:
	arch/arm64/tools/cpucaps
This commit is contained in:
Marc Zyngier 2021-10-17 13:42:22 +01:00 committed by Jianping Liu
parent c2d26c3ea5
commit 594dfdf6a8
2 changed files with 11 additions and 0 deletions

View File

@ -60,6 +60,7 @@
#define ARM64_HAS_ARMv8_4_TTL 50
#define ARM64_HAS_TLB_RANGE 51
#define ARM64_WORKAROUND_AMPERE_AC03_XXXXXX 52
#define ARM64_HAS_ECV 53
#define ARM64_NCAPS 80

View File

@ -1305,6 +1305,16 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
.sign = FTR_UNSIGNED,
.min_field_value = 1,
},
{
.desc = "Enhanced Counter Virtualization",
.capability = ARM64_HAS_ECV,
.type = ARM64_CPUCAP_SYSTEM_FEATURE,
.matches = has_cpuid_feature,
.sys_reg = SYS_ID_AA64MMFR0_EL1,
.field_pos = ID_AA64MMFR0_ECV_SHIFT,
.sign = FTR_UNSIGNED,
.min_field_value = 1,
},
#ifdef CONFIG_ARM64_PAN
{
.desc = "Privileged Access Never",