linux/arch/arm64/kvm/hyp
David Brazdil abf16336dd KVM: arm64: Intercept host's CPU_SUSPEND PSCI SMCs
Add a handler of CPU_SUSPEND host PSCI SMCs. The SMC can either enter
a sleep state indistinguishable from a WFI or a deeper sleep state that
behaves like a CPU_OFF+CPU_ON except that the core is still considered
online while asleep.

The handler saves r0,pc of the host and makes the same call to EL3 with
the hyp CPU entry point. It either returns back to the handler and then
back to the host, or wakes up into the entry point and initializes EL2
state before dropping back to EL1. No EL2 state needs to be
saved/restored for this purpose.

CPU_ON and CPU_SUSPEND are both implemented using struct psci_boot_args
to store the state upon powerup, with each CPU having separate structs
for CPU_ON and CPU_SUSPEND so that CPU_SUSPEND can operate locklessly
and so that a CPU_ON call targeting a CPU cannot interfere with
a concurrent CPU_SUSPEND call on that CPU.

Signed-off-by: David Brazdil <dbrazdil@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201202184122.26046-23-dbrazdil@google.com
2020-12-04 10:08:35 +00:00
..
include KVM: arm64: Bootstrap PSCI SMC handler in nVHE EL2 2020-12-04 10:08:34 +00:00
nvhe KVM: arm64: Intercept host's CPU_SUSPEND PSCI SMCs 2020-12-04 10:08:35 +00:00
vhe arm64: Add workaround for Arm Cortex-A77 erratum 1508412 2020-10-29 12:56:01 +00:00
aarch32.c Merge branch 'kvm-arm64/misc-5.9' into kvmarm-master/next-WIP 2020-07-28 16:26:16 +01:00
entry.S Merge branch 'kvm-arm64/hyp-pcpu' into kvmarm-master/next 2020-09-30 14:05:35 +01:00
fpsimd.S KVM: arm64: Remove __hyp_text macro, use build rules instead 2020-07-05 18:38:45 +01:00
hyp-entry.S Merge branch 'kvm-arm64/hyp-pcpu' into kvmarm-master/next 2020-09-30 14:05:35 +01:00
Makefile Merge branch 'kvm-arm64/hyp-pcpu' into kvmarm-master/next 2020-09-30 14:05:35 +01:00
pgtable.c KVM: arm64: Fix masks in stage2_pte_cacheable() 2020-10-29 19:49:03 +00:00
smccc_wa.S KVM: arm64: Move __smccc_workaround_1_smc to .rodata 2020-07-05 18:37:48 +01:00
vgic-v2-cpuif-proxy.c KVM: arm64: Remove __hyp_text macro, use build rules instead 2020-07-05 18:38:45 +01:00
vgic-v3-sr.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00