lkml.org 
[lkml]   [2019]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 1/3] KVM: Fix leak vCPU's VMCS value into other pCPU
From
Date
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;
> +}

\
 
 \ /
  Last update: 2019-08-03 08:37    [W:0.042 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site