Commit 892f723
arm64: Delay initialisation of cpuinfo_arm64::reg_{zcr,smcr}
Even if we are now able to tell the kernel to avoid exposing SVE/SME
from the command line, we still have a couple of places where we
unconditionally access the ZCR_EL1 (resp. SMCR_EL1) registers.
On systems with broken firmwares, this results in a crash even if
arm64.nosve (resp. arm64.nosme) was passed on the command-line.
To avoid this, only update cpuinfo_arm64::reg_{zcr,smcr} once
we have computed the sanitised version for the corresponding
feature registers (ID_AA64PFR0 for SVE, and ID_AA64PFR1 for
SME). This results in some minor refactoring.
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Peter Collingbourne <pcc@google.com>
Tested-by: Peter Collingbourne <pcc@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220720105219.1755096-1-maz@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>1 parent f96d67a commit 892f723
2 files changed
Lines changed: 29 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
1004 | | - | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
1005 | 1007 | | |
1006 | 1008 | | |
1007 | 1009 | | |
1008 | 1010 | | |
1009 | | - | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
1010 | 1020 | | |
1011 | | - | |
1012 | | - | |
| 1021 | + | |
1013 | 1022 | | |
1014 | 1023 | | |
1015 | 1024 | | |
| |||
1241 | 1250 | | |
1242 | 1251 | | |
1243 | 1252 | | |
1244 | | - | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1245 | 1256 | | |
1246 | 1257 | | |
1247 | 1258 | | |
1248 | | - | |
1249 | | - | |
1250 | | - | |
| 1259 | + | |
| 1260 | + | |
1251 | 1261 | | |
1252 | 1262 | | |
1253 | 1263 | | |
1254 | | - | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
1255 | 1273 | | |
1256 | 1274 | | |
1257 | 1275 | | |
1258 | | - | |
1259 | | - | |
1260 | | - | |
| 1276 | + | |
| 1277 | + | |
1261 | 1278 | | |
1262 | 1279 | | |
1263 | 1280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | 442 | | |
459 | 443 | | |
460 | 444 | | |
| |||
0 commit comments