feat(fgt): add support for FEAT_FGT2 testing
This patch adds testcase that validates FEAT_FGT2 support
by reading Fine-grained trap registers that are part of FEAT_FGT2.
These registers are only present when FEAT_FGT2 is implemented
Change-Id: Ifc1106d12dbe03b956310d364600368d3f035491
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
diff --git a/include/lib/aarch64/arch_features.h b/include/lib/aarch64/arch_features.h
index b6d0ce7..86cbec9 100644
--- a/include/lib/aarch64/arch_features.h
+++ b/include/lib/aarch64/arch_features.h
@@ -126,8 +126,14 @@
static inline bool is_armv8_6_fgt_present(void)
{
+ return (((read_id_aa64mmfr0_el1() >> ID_AA64MMFR0_EL1_FGT_SHIFT) &
+ ID_AA64MMFR0_EL1_FGT_MASK) != 0U);
+}
+
+static inline bool is_armv8_9_fgt2_present(void)
+{
return ((read_id_aa64mmfr0_el1() >> ID_AA64MMFR0_EL1_FGT_SHIFT) &
- ID_AA64MMFR0_EL1_FGT_MASK) == ID_AA64MMFR0_EL1_FGT_SUPPORTED;
+ ID_AA64MMFR0_EL1_FGT_MASK) == ID_AA64MMFR0_EL1_FGT2_SUPPORTED;
}
static inline unsigned long int get_armv8_6_ecv_support(void)