Message ID | 39f8f0f26c5b453ba61e8c8256955eae@baidu.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | 答复: [PATCH] KVM: X86: set vcpu preempted only if it is preempted | expand |
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index fe0aead..c1ebd69 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -619,7 +619,7 @@ static void kvm_smp_send_call_func_ipi(const struct cpumask *mask) /* Make sure other vCPUs get a chance to run if they need to. */ for_each_cpu(cpu, mask) { - if (vcpu_is_preempted(cpu)) { + if (!idle_cpu(cpu) && vcpu_is_preempted(cpu)) { kvm_hypercall1(KVM_HC_SCHED_YIELD, per_cpu(x86_cpu_to_apicid, cpu)); break; }