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

[Xen-devel] [PATCH][discuss] evtchn race condition



Keir, 
below/attached patch is necessary to allow SVM partitions to boot
unmodified guests with xen-unstable.hg c/s 8961.  c/s 8822 and 8828
(some necessary evtchn modifications) cause SVM partitions to fail with
"lost interrupt" hda error during boot. 
We currently do not understand why these modifications are necessary and
in fact, a race occurs with one part of the patch (added
evtch_pending_sel if statement). Clearly this patch is not a final
solution, and we are continuing to debug this issue.
Any comments, insight are appreciated,
Tom

Signed-off-by: Tom Woller <thomas.woller@xxxxxxx>

diff -r 4f838d2ac31a xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c     Fri Feb 24 14:41:45 2006
+++ b/xen/arch/x86/hvm/io.c     Fri Feb 24 13:38:39 2006
@@ -720,10 +720,8 @@
      * Re-set the selector and master flags in case any other
notifications
      * are pending.
      */
-    if ( d->shared_info->evtchn_pending[port/BITS_PER_LONG] )
-        set_bit(port/BITS_PER_LONG, &v->vcpu_info->evtchn_pending_sel);
-    if ( v->vcpu_info->evtchn_pending_sel )
-        v->vcpu_info->evtchn_upcall_pending = 1;
+    set_bit(port/BITS_PER_LONG, &v->vcpu_info->evtchn_pending_sel);
+    v->vcpu_info->evtchn_upcall_pending = 1;
 }
 
 void hvm_safe_block(void)
@@ -735,12 +733,15 @@
     for ( ; ; )
     {
         /* Clear master flag & selector flag so we will wake from
block. */
-        v->vcpu_info->evtchn_upcall_pending = 0;
+        if (!v->vcpu_info->evtchn_pending_sel)
+            v->vcpu_info->evtchn_upcall_pending = 0;
         clear_bit(port/BITS_PER_LONG,
&v->vcpu_info->evtchn_pending_sel);
         smp_mb__after_clear_bit();
 
         /* Event pending already? */
         if ( test_bit(port, &d->shared_info->evtchn_pending[0]) )
+            break;
+        if( v->vcpu_info->evtchn_upcall_pending )
             break;
 
         do_sched_op(SCHEDOP_block, 0);


Attachment: hvm_evtchn_fix_8960.patch
Description: hvm_evtchn_fix_8960.patch

_______________________________________________
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®.