]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded
authorChristoffer Dall <christoffer.dall@arm.com>
Thu, 20 Dec 2018 11:44:05 +0000 (12:44 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 7 Feb 2019 11:43:59 +0000 (11:43 +0000)
commit7f5349f1e089511a7013ea9223cf8bf464336ecb
treea77628056f5717fc8461665a7524f1bf94619726
parent0a0f374fffa43a5a06e04f7c2e31a8500e6e42fc
KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded

We have two ways to reset a vcpu:
- either through VCPU_INIT
- or through a PSCI_ON call

The first one is easy to reason about. The second one is implemented
in a more bizarre way, as it is the vcpu that handles PSCI_ON that
resets the vcpu that is being powered-on. As we need to turn the logic
around and have the target vcpu to reset itself, we must take some
preliminary steps.

Resetting the VCPU state modifies the system register state in memory,
but this may interact with vcpu_load/vcpu_put if running with preemption
disabled, which in turn may lead to corrupted system register state.

Address this by disabling preemption and doing put/load if required
around the reset logic.

Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/kvm/reset.c