]> xenbits.xensource.com Git - xen.git/commit
xen: arm: Don't use stop_cpu() in halt_this_cpu()
authorDmytro Semenets <dmytro_semenets@epam.com>
Thu, 23 Jun 2022 07:44:28 +0000 (10:44 +0300)
committerJulien Grall <jgrall@amazon.com>
Thu, 30 Jun 2022 18:41:34 +0000 (19:41 +0100)
commitee11f092b515bf3c926eaad053d12d3f2b6e593e
treeb9d9b0f61a4765b327e3fa74b5d27ac3b23f9793
parent8d578128393b9ee144b2c2deb4e0369556443686
xen: arm: Don't use stop_cpu() in halt_this_cpu()

When shutting down (or rebooting) the platform, Xen will call stop_cpu()
on all the CPUs but one. The last CPU will then request the system to
shutdown/restart.

On platform using PSCI, stop_cpu() will call PSCI CPU off. Per the spec
(section 5.5.2 DEN0022D.b), the call could return DENIED if the Trusted
OS is resident on the CPU that is about to be turned off.

As Xen doesn't migrate off the trusted OS (which BTW may not be
migratable), it would be possible to hit the panic().

In the ideal situation, Xen should migrate the trusted OS or make sure
the CPU off is not called. However, when shutting down (or rebooting)
the platform, it is pointless to try to turn off all the CPUs (per
section 5.10.2, it is only required to put the core in a known state).

So solve the problem by open-coding stop_cpu() in halt_this_cpu() and
not call PSCI CPU off.

Signed-off-by: Dmytro Semenets <dmytro_semenets@epam.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/shutdown.c