xen/arm: Implement CPU_OFF PSCI call (physical interface)
authorMirela Simonovic <mirela.simonovic@aggios.com>
Fri, 1 Jun 2018 13:17:43 +0000 (15:17 +0200)
committerJulien Grall <julien.grall@arm.com>
Tue, 5 Jun 2018 18:07:24 +0000 (19:07 +0100)
commitcd80acdaddd791f9c8846d8a5c614db2a942c0c4
tree1f4be29da9fd61cb1710ddbb39d811e0f00ce7da
parent25f9e80201f3688e0c4d5c4e43e4b6143b441c52
xen/arm: Implement CPU_OFF PSCI call (physical interface)

During the system suspend to RAM non-boot CPUs will be hotplugged.
This will be triggered via disable_nonboot_cpus() call. When
hotplugged the CPU will end up in an infinite wfi loop in stop_cpu().
This patch adds PSCI CPU_OFF call to the EL3 with the aim to get powered
down the calling CPU during the suspend. The CPU_OFF call will be made
only if the PSCI version is higher than v0.1 (Note that the CPU_OFF
function is mandatory since PSCI v0.2).
If PSCI CPU_OFF call to the EL3 succeeds it will not return. Otherwise,
when the PSCI CPU_OFF call returns we'll raise panic, because the
calling CPU couldn't be enabled afterwards (stays in WFI loop forever).
Note that if the PSCI version is higher than v0.1 the CPU_OFF will be
called regardless of the system state. This is done because scenarios
other than suspend may benefit from powering off the CPU.

Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/psci.c
xen/arch/arm/smpboot.c
xen/include/asm-arm/psci.h