@@ -86,6 +86,7 @@ struct kvm_vcpu {
unsigned long requests;
unsigned long guest_debug;
int srcu_idx;
+ bool online;
int fpu_active;
int guest_fpu_loaded, guest_xcr0_loaded;
@@ -148,8 +148,9 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
raw_spin_lock(&kvm->requests_lock);
me = smp_processor_id();
kvm_for_each_vcpu(i, vcpu, kvm) {
- if (kvm_make_check_request(req, vcpu))
+ if (kvm_make_check_request(req, vcpu) || !vcpu->online)
continue;
+
cpu = vcpu->cpu;
if (cpus != NULL && cpu != -1 && cpu != me)
cpumask_set_cpu(cpu, cpus);
@@ -2245,6 +2246,7 @@ static void kvm_sched_in(struct preempt_notifier *pn, int cpu)
{
struct kvm_vcpu *vcpu = preempt_notifier_to_vcpu(pn);
+ vcpu->online = true;
kvm_arch_vcpu_load(vcpu, cpu);
}
@@ -2253,6 +2255,7 @@ static void kvm_sched_out(struct preempt_notifier *pn,
{
struct kvm_vcpu *vcpu = preempt_notifier_to_vcpu(pn);
+ vcpu->online = false;
kvm_arch_vcpu_put(vcpu);
}