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] [PATCH][discuss] evtchn race condition

To: "Woller, Thomas" <thomas.woller@xxxxxxx>, "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][discuss] evtchn race condition
From: "Woller, Thomas" <thomas.woller@xxxxxxx>
Date: Fri, 24 Feb 2006 14:14:38 -0600
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 24 Feb 2006 20:15:21 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcYhxsYQjOEmkwuTTaCDw9dO4eHSVgAAHPugBe1Zr3A=
Thread-topic: [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
<Prev in Thread] Current Thread [Next in Thread>