From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@qumranet.com>
Cc: Chris Wright <chrisw@redhat.com>, kvm@vger.kernel.org
Subject: Re: [patch 2/2] KVM: close timer injection race window in __vcpu_run
Date: Sun, 8 Jun 2008 12:08:34 -0300 [thread overview]
Message-ID: <20080608150834.GB1408@dmt.cnet> (raw)
In-Reply-To: <484B877B.1080108@qumranet.com>
On Sun, Jun 08, 2008 at 10:17:15AM +0300, Avi Kivity wrote:
>> Index: kvm/arch/x86/kvm/i8254.c
>> ===================================================================
>> --- kvm.orig/arch/x86/kvm/i8254.c
>> +++ kvm/arch/x86/kvm/i8254.c
>> @@ -200,9 +200,12 @@ static int __pit_timer_fn(struct kvm_kpi
>> atomic_inc(&pt->pending);
>> smp_mb__after_atomic_inc();
>> - if (vcpu0 && waitqueue_active(&vcpu0->wq)) {
>> - vcpu0->arch.mp_state = KVM_MP_STATE_RUNNABLE;
>> - wake_up_interruptible(&vcpu0->wq);
>> + if (vcpu0) {
>> + set_bit(KVM_REQ_PENDING_TIMER, &vcpu0->requests);
>> + if (waitqueue_active(&vcpu0->wq)) {
>> + vcpu0->arch.mp_state = KVM_MP_STATE_RUNNABLE;
>> + wake_up_interruptible(&vcpu0->wq);
>> + }
>> }
>>
>
> We probably ought to wakeup only if pt->pending was zero, no?
Yep, same for LAPIC.
next prev parent reply other threads:[~2008-06-08 15:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-06 19:37 [patch 0/2] timer injection races Marcelo Tosatti
2008-06-06 19:37 ` [patch 1/2] KVM: consolidate check for pending vcpu requests Marcelo Tosatti
2008-06-08 7:10 ` Avi Kivity
2008-06-06 19:37 ` [patch 2/2] KVM: close timer injection race window in __vcpu_run Marcelo Tosatti
2008-06-08 7:17 ` Avi Kivity
2008-06-08 15:08 ` Marcelo Tosatti [this message]
2008-06-09 3:29 ` Marcelo Tosatti
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=20080608150834.GB1408@dmt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@qumranet.com \
--cc=chrisw@redhat.com \
--cc=kvm@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