diff options
author | Andre Przywara <andre.przywara@arm.com> | 2022-11-17 16:42:09 +0000 |
---|---|---|
committer | Andre Przywara <andre.przywara@arm.com> | 2023-03-22 13:33:22 +0000 |
commit | 240770989f618da1b015f9a580fe0c83e10688a2 (patch) | |
tree | 4a0518de3915a93f87acb2a373a1f399a8b7f5c1 /common | |
parent | 387b8801f956204b2970a5b65de0f9ad6821a4b7 (diff) | |
download | arm-trusted-firmware-240770989f618da1b015f9a580fe0c83e10688a2.tar.gz |
refactor(cpufeat): align FEAT_SB to new feature handling
FEAT_SB introduces a new speculation barrier instruction, that is more
lightweight than a "dsb; isb" combination. We use that in a hot path,
so cannot afford and don't want a runtime detection mechanism.
Nevertheless align the implementation of the feature detection part
with the other features, but renaming the detection function, and
updating the FEAT_DETECTION code. Also update the documentation.
Change-Id: I2b86dfd1ad259c3bb99ab5186e2911ace454b54c
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/feat_detect.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/common/feat_detect.c b/common/feat_detect.c index 7a6c9193e..4b5dcd462 100644 --- a/common/feat_detect.c +++ b/common/feat_detect.c @@ -60,16 +60,6 @@ check_feature(int state, unsigned long field, const char *feat_name, } } -/****************************************** - * Feature : FEAT_SB (Speculation Barrier) - *****************************************/ -static void read_feat_sb(void) -{ -#if (ENABLE_FEAT_SB == FEAT_STATE_ALWAYS) - feat_detect_panic(is_armv8_0_feat_sb_present(), "SB"); -#endif -} - /****************************************************** * Feature : FEAT_CSV2_2 (Cache Speculation Variant 2) *****************************************************/ @@ -256,7 +246,7 @@ void detect_arch_features(void) tainted = false; /* v8.0 features */ - read_feat_sb(); + check_feature(ENABLE_FEAT_SB, read_feat_sb_id_field(), "SB", 1, 1); read_feat_csv2_2(); /* v8.1 features */ |