Messages in this thread | | | Subject | Re: [PATCH v3 1/3] KVM: Fix leak vCPU's VMCS value into other pCPU | From | Paolo Bonzini <> | Date | Sat, 3 Aug 2019 08:36:25 +0200 |
| |
On 01/08/19 05:30, Wanpeng Li wrote: > +bool kvm_arch_dy_runnable(struct kvm_vcpu *vcpu) > +{ > + if (READ_ONCE(vcpu->arch.pv.pv_unhalted)) > + return true; > + > + if (kvm_test_request(KVM_REQ_NMI, vcpu) || > + (READ_ONCE(vcpu->arch.nmi_pending) && > + kvm_x86_ops->nmi_allowed(vcpu)))
You cannot check kvm_x86_ops->nmi_allowed(vcpu), so just use kvm_test_request.
> + return true; > + > + if (kvm_test_request(KVM_REQ_SMI, vcpu) || > + (READ_ONCE(vcpu->arch.smi_pending) && !is_smm(vcpu))) > + return true;
Same here, if only for simplicity.
> + if (kvm_test_request(KVM_REQ_EVENT, vcpu)) > + return true; > + > + if (vcpu->arch.apicv_active && kvm_x86_ops->apicv_test_pi_on(vcpu)) > + return true;
Let's call it apicv_has_pending_interrupt instead.
Also, please add a comment in kvm_main.c saying that kvm_arch_dy_runnable is called outside vcpu_load/vcpu_put.
Paolo
> + > + return false; > +}
| |