arm-trusted-firmware/lib/psci
Boyan Karatotev 45c7328c0b fix(cpus): avoid SME related loss of context on powerdown
Travis' and Gelas' TRMs tell us to disable SME (set PSTATE.{ZA, SM} to
0) when we're attempting to power down. What they don't tell us is that
if this isn't done, the powerdown request will be rejected. On the
CPU_OFF path that's not a problem - we can force SVCR to 0 and be
certain the core will power off.

On the suspend to powerdown path, however, we cannot do this. The TRM
also tells us that the sequence could also be aborted on eg. GIC
interrupts. If this were to happen when we have overwritten SVCR to 0,
upon a return to the caller they would experience a loss of context. We
know that at least Linux may call into PSCI with SVCR != 0. One option
is to save the entire SME context which would be quite expensive just to
work around. Another option is to downgrade the request to a normal
suspend when SME was left on. This option is better as this is expected
to happen rarely enough to ignore the wasted power and we don't want to
burden the generic (correct) path with needless context management.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I698fa8490ebf51461f6aa8bba84f9827c5c46ad4
2025-02-03 14:29:47 +00:00
..
aarch32 chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
aarch64 feat(psci): allow cores to wake up from powerdown 2025-02-03 14:29:47 +00:00
psci_common.c fix(cpus): avoid SME related loss of context on powerdown 2025-02-03 14:29:47 +00:00
psci_lib.mk chore(cpus): optimise runtime errata applications 2024-10-16 13:59:57 +01:00
psci_main.c fix(cpus): avoid SME related loss of context on powerdown 2025-02-03 14:29:47 +00:00
psci_mem_protect.c chore: update to use Arm word across TF-A 2023-08-08 15:12:30 +01:00
psci_off.c fix(cpus): avoid SME related loss of context on powerdown 2025-02-03 14:29:47 +00:00
psci_on.c fix(smccc): ensure that mpidr passed through SMC is valid 2023-11-06 20:43:38 +00:00
psci_private.h feat(psci): allow cores to wake up from powerdown 2025-02-03 14:29:47 +00:00
psci_setup.c perf(psci): pass my_core_pos around instead of calling it repeatedly 2025-01-14 10:02:00 +00:00
psci_stat.c perf(psci): pass my_core_pos around instead of calling it repeatedly 2025-01-14 10:02:00 +00:00
psci_suspend.c feat(psci): allow cores to wake up from powerdown 2025-02-03 14:29:47 +00:00
psci_system_off.c feat(psci): allow cores to wake up from powerdown 2025-02-03 14:29:47 +00:00