Commit ac31787
arm64: cpufeature: Unify SCOPE_LOCAL_CPU early & late behavior
SCOPE_LOCAL_CPU is mostly used for CPU errata. The early feature logic
prior to this patch will enable a feature if any secondary matches it,
but will not do anything once the feature is already enabled.
However, the late CPU verification logic is more flexible, with flags:
- ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU means "any cpu" logic applies
- ARM64_CPUCAP_PERMITTED_FOR_LATE_CPU means "all cpus" logic applies
This means the early secondary feature code right now behaves as if
OPTIONAL && !PERMITTED was specified (it ignores secondaries missing the
feature and forces the system state to active if any secondary has the
feature).
Change this so that the early feature detection code inspects the flags
too and applies the logic to make feature state consistent:
- If a feature is NOT OPTIONAL and missing on a secondary, remove it
from the system set (we can do this before finalization)
- If a feature is PERMITTED and missing on the boot CPU, don't enable it
but rather leave it off.
This allows SCOPE_LOCAL_CPU to be used for feature detection as well as
CPU errata.
Signed-off-by: Asahi Lina <[email protected]>1 parent 18789c9 commit ac31787
1 file changed
+31
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3357 | 3357 | | |
3358 | 3358 | | |
3359 | 3359 | | |
| 3360 | + | |
| 3361 | + | |
3360 | 3362 | | |
3361 | | - | |
3362 | | - | |
3363 | | - | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
3364 | 3392 | | |
3365 | 3393 | | |
3366 | 3394 | | |
| |||
0 commit comments