Skip to contentSkip to conversation

how to prevent crashes in notify_via_xen_event_channel during shutdown/crash

DISCUSSION Olaf Hering 1 participant 2 messages Sep 7, 2010 – Sep 14, 2010

lore
Share & tools
lore
#0 lore raw

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()?

Olaf

#1 lore raw
Quoted 11 lines · Olaf Hering

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/common/event_channel.c +6 -0
@@ -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);