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

[Xen-devel] Re: how to prevent crashes in notify_via_xen_event_channel d

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: how to prevent crashes in notify_via_xen_event_channel during shutdown/crash
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Tue, 14 Sep 2010 23:40:39 +0200
Delivery-date: Tue, 14 Sep 2010 14:41:37 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1284500441; l=951; s=domk; d=aepfle.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=6JOB/9mSCp154VQNlJus9pKg+yY=; b=bpjGkOKnH7vtybITtQ2/VALX9cF2CX+BB5zC2s2BNzeiY5QBreDycLt8EBRv0ElOG4j d/zmO1Q8czi0fnlrYkUA1jiQt99Re74smyqE5st5OxmhtkXIR3bLrbZDim2t1fmjXzqef I28JI5DflzNbkRT7Kt7rGV63QOtKftwTwTI=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100907195207.GA1428@xxxxxxxxx>
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>
References: <20100907195207.GA1428@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Tue, Sep 07, Olaf Hering wrote:

> 
> Hello,
> 
> I'm seeing crashes with 4.0.1 in notify_via_xen_event_channel() after
> evtchn_destroy() was already executed, the ASSERT triggers.
> There are a few calls to notify_via_xen_event_channel(), only
> hvm_send_assist_req() seems to check the domain->is_shutting_down flag.
> xen-unstable is not much different in that area.
> 
> How should a check for an already destroyed eventchannel look like?
> Maybe like its done in free_xen_event_channel()?

This patch fixes the crashes for me.


--- xen-4.0.1-testing.orig/xen/common/event_channel.c
+++ xen-4.0.1-testing/xen/common/event_channel.c
@@ -994,6 +994,12 @@ void notify_via_xen_event_channel(struct
 
     spin_lock(&ld->event_lock);
 
+    if ( unlikely(ld->is_dying) )
+    {
+        spin_unlock(&ld->event_lock);
+        return;
+    }
+
     ASSERT(port_is_valid(ld, lport));
     lchn = evtchn_from_port(ld, lport);
     ASSERT(lchn->consumer_is_xen);

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

<Prev in Thread] Current Thread [Next in Thread>