feat(brbe): test that EL3 has properly enabled access to BRBE
Access to FEAT_BRBE control registers must be explicitly enabled in EL3,
this simple test just ensures that the registers are accessible or traps
to EL3, similar to the TRBE test.
Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I0a25c5ce6beb6aa96b9428264b75cb3569ac535a
diff --git a/include/lib/aarch64/arch_features.h b/include/lib/aarch64/arch_features.h
index 4da6407..77b9f9d 100644
--- a/include/lib/aarch64/arch_features.h
+++ b/include/lib/aarch64/arch_features.h
@@ -154,4 +154,11 @@
ID_AA64MMFR1_EL1_AFP_MASK) == ID_AA64MMFR1_EL1_AFP_SUPPORTED);
}
+static inline bool get_feat_brbe_support(void)
+{
+ return ((read_id_aa64dfr0_el1() >> ID_AA64DFR0_BRBE_SHIFT) &
+ ID_AA64DFR0_BRBE_MASK) ==
+ ID_AA64DFR0_BRBE_SUPPORTED;
+}
+
#endif /* ARCH_FEATURES_H */