arm/arm64: KVM: Allow a VCPU to fully reset itself
authorMarc Zyngier <marc.zyngier@arm.com>
Thu, 20 Dec 2018 11:36:07 +0000 (11:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:09:43 +0000 (20:09 +0100)
commitb78379c33723a6239f463c66e440e58011546867
tree64df7beecb6a0a0000f96e7d328b9571585e98f5
parentdfe9b4d992cab1e336af90b359412a269cd5d328
arm/arm64: KVM: Allow a VCPU to fully reset itself

[ Upstream commit 358b28f09f0ab074d781df72b8a671edb1547789 ]

The current kvm_psci_vcpu_on implementation will directly try to
manipulate the state of the VCPU to reset it.  However, since this is
not done on the thread that runs the VCPU, we can end up in a strangely
corrupted state when the source and target VCPUs are running at the same
time.

Fix this by factoring out all reset logic from the PSCI implementation
and forwarding the required information along with a request to the
target VCPU.

Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/include/asm/kvm_host.h
arch/arm/kvm/reset.c
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/reset.c
virt/kvm/arm/arm.c
virt/kvm/arm/psci.c