Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+7
+7
arch/arm/kvm/arm.c
··· 342 342 343 343 void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) 344 344 { 345 + /* 346 + * The arch-generic KVM code expects the cpu field of a vcpu to be -1 347 + * if the vcpu is no longer assigned to a cpu. This is used for the 348 + * optimized make_all_cpus_request path. 349 + */ 350 + vcpu->cpu = -1; 351 + 345 352 kvm_arm_set_running_vcpu(NULL); 346 353 } 347 354