From ff86e0b4e6c34d28b8642dd8eb9cbdd517bad195 Mon Sep 17 00:00:00 2001 From: Juan Pablo Conde Date: Tue, 12 Jul 2022 16:40:29 -0400 Subject: feat(rng-trap): add EL3 support for FEAT_RNG_TRAP FEAT_RNG_TRAP introduces support for EL3 trapping of reads of the RNDR and RNDRRS registers, which is enabled by setting the SCR_EL3.TRNDR bit. This patch adds a new build flag ENABLE_FEAT_RNG_TRAP that enables the feature. This feature is supported only in AArch64 state from Armv8.5 onwards. Signed-off-by: Juan Pablo Conde Change-Id: Ia9f17aef3444d3822bf03809036a1f668c9f2d89 --- common/feat_detect.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common') diff --git a/common/feat_detect.c b/common/feat_detect.c index be3e20e6f..ee3458865 100644 --- a/common/feat_detect.c +++ b/common/feat_detect.c @@ -254,6 +254,16 @@ static void read_feat_trbe(void) #endif } +/****************************************************************** + * Feature : FEAT_RNG_TRAP (Trapping support for RNDR/RNDRRS) + *****************************************************************/ +static void read_feat_rng_trap(void) +{ +#if (ENABLE_FEAT_RNG_TRAP == FEAT_STATE_1) + feat_detect_panic(is_feat_rng_trap_present(), "RNG_TRAP"); +#endif +} + /*********************************************************************************** * TF-A supports many Arm architectural features starting from arch version * (8.0 till 8.7+). These features are mostly enabled through build flags. This @@ -304,6 +314,7 @@ void detect_arch_features(void) read_feat_mte(); read_feat_rng(); read_feat_bti(); + read_feat_rng_trap(); /* v8.6 features */ read_feat_amuv1p1(); -- cgit v1.2.1