From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
"Marc Zyngier" <Marc.Zyngier@arm.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v3 1/3] KVM: Fix leak vCPU's VMCS value into other pCPU
Date: Sat, 3 Aug 2019 08:36:25 +0200 [thread overview]
Message-ID: <a2900ee5-61cf-a35b-7ae5-b326052e0a6d@redhat.com> (raw)
In-Reply-To: <1564630214-28442-1-git-send-email-wanpengli@tencent.com>
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;
> +}
prev parent reply other threads:[~2019-08-03 6:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 3:30 Wanpeng Li
2019-08-01 3:30 ` [PATCH v3 2/3] KVM: LAPIC: Don't need to wakeup vCPU twice afer timer fire Wanpeng Li
2019-08-01 3:30 ` [PATCH v3 3/3] KVM: Check preempted_in_kernel for involuntary preemption Wanpeng Li
[not found] ` <20190801133133.955E4216C8@mail.kernel.org>
2019-08-02 0:46 ` [PATCH v3 1/3] KVM: Fix leak vCPU's VMCS value into other pCPU Wanpeng Li
2019-08-03 6:41 ` Paolo Bonzini
2019-08-05 2:04 ` Wanpeng Li
2019-08-03 6:36 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a2900ee5-61cf-a35b-7ae5-b326052e0a6d@redhat.com \
--to=pbonzini@redhat.com \
--cc=Marc.Zyngier@arm.com \
--cc=borntraeger@de.ibm.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkrcmar@redhat.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®