]> git.baikalelectronics.ru Git - arm-tf.git/commit
fix(aarch64): make AArch64 FGT feature detection more robust
authorAndre Przywara <andre.przywara@arm.com>
Fri, 7 Oct 2022 11:19:05 +0000 (12:19 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Thu, 20 Oct 2022 15:11:26 +0000 (16:11 +0100)
commitc6877763cd3a286983df160c8207368174c1b820
treefa0cd8aaf6c222459ebf867c3a2eba3e36bf4356
parent402d2316c8a959dc011b5775970a6677edb20b17
fix(aarch64): make AArch64 FGT feature detection more robust

The ARMv8 ARM says about the values in the ID register scheme:

==== D17.1.3 Principles of the ID scheme for fields in ID registers ===
The ID fields, which are either signed or unsigned, use increasing
numerical values to indicate increases in functionality. Therefore,
if a value of 0x1 indicates the presence of some instructions, then
the value 0x2 will indicate the presence of those instructions plus
some additional instructions or functionality. This means software
can be written in the form:
     if (value >= number) {
         // do something that relies on the value of the feature
     }
=======================================================================

So to check for the presence of a certain architecture feature, we
should not check against a certain specific value, as it's done right
now in several cases.

Relax the test for Fine Grained Trapping (FGT) to just check against
the field being 0 or not.

This fixes TF-A crashing due to an unhandled exception, when running a
Linux kernel on an FVP enabling ARMv8.9 features. The value of
ID_AA64MMFR0_EL1.FGT went from 0b0001 to 0b0010 there.

Change-Id: Ic3f1625a7650306ed388a0660429ca8823c673c2
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
include/arch/aarch64/arch_features.h