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] make hypercall_preempt_check() a little more sensiti

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [patch] make hypercall_preempt_check() a little more sensitive
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Thu, 30 Mar 2006 11:17:23 -0600
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 30 Mar 2006 17:21:16 +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>
Organization: IBM Linux Technology Center
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.8.3
Since PowerPC has a hypervisor mode in the processor, Linux is able to disable 
interrupts directly using the EE bit in the MSR (Machine State Register), 
just like on hardware. This bit acts like the evtchn_upcall_mask bit.

It would be an invasive patch to PowerPC Linux to modify the code that 
disables the EE bit and additionally have it modify 
vcpu_info->evtchn_upcall_mask, especially when that code is in assembly. 
Instead, we can have hypercall_preempt_check() also check MSR:EE directly. 
IA64 may be able to use this facility as well, so I've CC'ed that list.

This patch fixes a problem where an event occurs, Linux calls back into Xen 
for e.g. console output, Xen sees that an event is pending and creates a 
continuation and returns... loop forever.

Compile-tested on x86. Please apply.

-- 
Hollis Blanchard
IBM Linux Technology Center

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxx>
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>

--- a/xen/include/asm-ia64/domain.h     Wed Mar 29 16:42:19 2006 -0600
+++ b/xen/include/asm-ia64/domain.h     Thu Mar 30 11:02:47 2006 -0600
@@ -143,6 +143,8 @@ extern struct mm_struct init_mm;
 #include <asm/uaccess.h> /* for KERNEL_DS */
 #include <asm/pgtable.h>

+#define arch_event_deliverable(v) (1)
+
 #endif /* __ASM_DOMAIN_H__ */

 /*
diff -r d258c2f68943 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h      Wed Mar 29 16:42:19 2006 -0600
+++ b/xen/include/asm-x86/domain.h      Thu Mar 30 11:02:47 2006 -0600
@@ -173,6 +173,8 @@ struct arch_vcpu
 #define hvm_vmx         hvm_vcpu.u.vmx
 #define hvm_svm         hvm_vcpu.u.svm

+#define arch_event_deliverable(v) (1)
+
 #endif /* __ASM_DOMAIN_H__ */

 /*
diff -r d258c2f68943 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h   Wed Mar 29 16:42:19 2006 -0600
+++ b/xen/include/xen/sched.h   Thu Mar 30 11:02:47 2006 -0600
@@ -319,7 +319,8 @@ unsigned long hypercall_create_continuat

 #define hypercall_preempt_check() (unlikely(    \
         softirq_pending(smp_processor_id()) |   \
-        event_pending(current)                  \
+        (event_pending(current) &               \
+        arch_event_deliverable(current))        \
     ))

 /* This domain_hash and domain_list are protected by the domlist_lock. */

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

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