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

Re: [Xen-devel] [PATCH] VMX: avoid taking locks with irqs disabled


  • To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • Date: Mon, 20 Oct 2008 11:08:37 +0100
  • Cc:
  • Delivery-date: Mon, 20 Oct 2008 03:09:11 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Ackym9FTECaiOJ6PEd2A7gAWy6hiGQ==
  • Thread-topic: [Xen-devel] [PATCH] VMX: avoid taking locks with irqs disabled

Oh yes. That's a class of race that I hadn't realised would be introduced by
the new rendezvous code. Spinlocks which are ever taken with IRQs disabled
must *always* be taken with IRQs disabled. Spinlocks which are ever taken
with IRQs enabled must *always* be taken with IRQs enabled.

It's quite an extra constraint on spinlock usage actually. :-(

Actually this new partitioning of locks into two equivalence classes is
begging for some run-time checking in debug builds. I'll sort out a patch
for that.

 -- Keir

On 20/10/08 10:30, "Tim Deegan" <Tim.Deegan@xxxxxxxxxx> wrote:

> Shuffle the bits of the vmexit handler that run with EFLAGS.IF == 0 up
> to the top.  Otherwise we end up calling spin_lock() with interrupts
> disabled, which can deadlock against the time-synchronization rendezvous
> code.
> 
> Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
> _______________________________________________
> 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®.