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

Re: [Xen-devel] [PATCH] hvm/vpt: Check that an irq is not blocked before waking the vcpu


  • To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
  • Date: Mon, 9 Mar 2009 12:22:19 +0000
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx>
  • Delivery-date: Mon, 09 Mar 2009 05:22:46 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=m1iNXI7K7gejNfDgZtwXFUfNAkAVh83go3yJkTxAJO/FDg7qdJcLXUmu2mTZYuD1lT m7xIpg7Gi1ewr+onfSL+ZIKb1Zq1qdEeGGFfvOFgwEoSBT4MgNj1JRAy0jYlakr+IJcl FsA3Bcd4ywUuXE7p8iRAuxOBfnejw/e/gRfok=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

I can't think of a way this race could be a problem.  Even if the vcpu
in question were to unmask right after the check, it would still call
pt_update_irq() on the way out to the vmexit (just for good measure),
which would catch the IRQ just as it should.

Conversely, if the vcpu were to mask right after the check, there
should be enough delay between the mask and executing a HLT that the
kick() wouldn't have any significant effect.  Even if it did, this
patch would reduce the false wake-ups from "every time the timer fires
when masked" to "only when a very specific race happens".

But the timer code is complicated enough that I'd like some
corroboration with someone who knows it better...

 -George

On Mon, Mar 9, 2009 at 12:01 PM, Keir Fraser <keir.fraser@xxxxxxxxxxxxx> wrote:
> On 09/03/2009 11:45, "George Dunlap" <George.Dunlap@xxxxxxxxxxxxx> wrote:
>
>> Currently, when a timer fires for a vpt interrupt, the interrupt
>> handler calls vcpu_kick() without checking to see if the IRQ is
>> blocked.  This causes the vcpu to wake up out of a halt when it
>> shouldn't.
>>
>> Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
>
> Only one question: could this race an unmask operation? Before this patch,
> pt_irq_masked() is only executed for the local vcpu, so such races may not
> have been considered.
>
>  -- Keir
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.