Re: [PATCH v3 1/3] KVM: Fix leak vCPU's VMCS value into other pCPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
> +}



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux