diff options
author | Andrew Turner <andrew@FreeBSD.org> | 2024-10-18 09:17:22 +0000 |
---|---|---|
committer | Andrew Turner <andrew@FreeBSD.org> | 2024-10-21 12:23:16 +0000 |
commit | ea6865bb78c5ac007a50f3d06a8e745052f745a0 (patch) | |
tree | 8b017f0adb4bf6e96ee0bf03114477773f13b004 /sys/arm64 | |
parent | 5727c249ad2a94cf726c8db60841cf2112245cb3 (diff) | |
download | src-ea6865bb78c5ac007a50f3d06a8e745052f745a0.tar.gz src-ea6865bb78c5ac007a50f3d06a8e745052f745a0.zip |
arm64: Update how we handle SpecSEI
The ID_AA64MMFR1_EL0.SpecSEI field needs to use MRS_HIGHER to get the
largest value from all CPUs. This is because it indicates when an
exception might happen when it's non-zero and can't happen when zero.
As indicating something that might happen even when it can't is safer
use MRS_HIGHER to handle this field.
Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D47126
Diffstat (limited to 'sys/arm64')
-rw-r--r-- | sys/arm64/arm64/identcpu.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 834b0c5493b4..f4d297e7d9bc 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -1283,7 +1283,14 @@ static const struct mrs_field id_aa64mmfr1_fields[] = { MRS_FIELD(ID_AA64MMFR1, ETS, false, MRS_LOWER, 0, id_aa64mmfr1_ets), MRS_FIELD(ID_AA64MMFR1, TWED, false, MRS_LOWER, 0, id_aa64mmfr1_twed), MRS_FIELD(ID_AA64MMFR1, XNX, false, MRS_LOWER, 0, id_aa64mmfr1_xnx), - MRS_FIELD(ID_AA64MMFR1, SpecSEI, false, MRS_LOWER, 0, + /* + * SpecSEI != 0 indicates the CPU might generate an external abort + * under speculation, while 0 indicates it can't happen. It's safer + * to incorrectly indicate it might happen when it can't rather than + * say it can't happen when it could. As such use the largest value + * found in the system. + */ + MRS_FIELD(ID_AA64MMFR1, SpecSEI, false, MRS_HIGHER, 0, id_aa64mmfr1_specsei), MRS_FIELD(ID_AA64MMFR1, PAN, false, MRS_LOWER, 0, id_aa64mmfr1_pan), MRS_FIELD(ID_AA64MMFR1, LO, false, MRS_LOWER, 0, id_aa64mmfr1_lo), |