WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] VMX: avoid taking locks with irqs disabled
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
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20081020093023.GM3780@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Ackym9FTECaiOJ6PEd2A7gAWy6hiGQ==
Thread-topic: [Xen-devel] [PATCH] VMX: avoid taking locks with irqs disabled
User-agent: Microsoft-Entourage/11.4.0.080122
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