summaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/arm.c
diff options
context:
space:
mode:
authorChristoffer Dall2013-12-12 05:29:11 +0100
committerChristoffer Dall2013-12-21 19:01:34 +0100
commite9b152cb957cb194437f37e79f0f3c9d34fe53d6 (patch)
treef3ded53b9287df77f6550f8792a09bc923c531ab /arch/arm/kvm/arm.c
parentKVM: arm-vgic: Make vgic mmio functions more generic (diff)
downloadkernel-qcow2-linux-e9b152cb957cb194437f37e79f0f3c9d34fe53d6.tar.gz
kernel-qcow2-linux-e9b152cb957cb194437f37e79f0f3c9d34fe53d6.tar.xz
kernel-qcow2-linux-e9b152cb957cb194437f37e79f0f3c9d34fe53d6.zip
arm/arm64: kvm: Set vcpu->cpu to -1 on vcpu_put
The arch-generic KVM code expects the cpu field of a vcpu to be -1 if the vcpu is no longer assigned to a cpu. This is used for the optimized make_all_cpus_request path and will be used by the vgic code to check that no vcpus are running. Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm/kvm/arm.c')
-rw-r--r--arch/arm/kvm/arm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index f290b2250ed5..b92ff6d3e34b 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -342,6 +342,13 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
{
+ /*
+ * The arch-generic KVM code expects the cpu field of a vcpu to be -1
+ * if the vcpu is no longer assigned to a cpu. This is used for the
+ * optimized make_all_cpus_request path.
+ */
+ vcpu->cpu = -1;
+
kvm_arm_set_running_vcpu(NULL);
}