]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
minios: call do_hypervisor_callback directly from force_evtchn_callback
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 16 Apr 2008 09:06:19 +0000 (10:06 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 16 Apr 2008 09:06:19 +0000 (10:06 +0100)
instead of unnecessarily going through the hypervisor.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
hypervisor.c
include/hypervisor.h
include/ia64/os.h
include/x86/os.h

index e84d34ccaf005974fe30fd5d76c2ba03753a77cc..2840d789ef87aad4fb1c9838ba5921a76bda1b27 100644 (file)
@@ -66,6 +66,21 @@ void do_hypervisor_callback(struct pt_regs *regs)
     in_callback = 0;
 }
 
+void force_evtchn_callback(void)
+{
+    vcpu_info_t *vcpu;
+    vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];
+    int save = vcpu->evtchn_upcall_mask;
+
+    while (vcpu->evtchn_upcall_pending) {
+        vcpu->evtchn_upcall_mask = 1;
+        barrier();
+        do_hypervisor_callback(NULL);
+        barrier();
+        vcpu->evtchn_upcall_mask = save;
+        barrier();
+    };
+}
 
 inline void mask_evtchn(u32 port)
 {
index e06f54bdefb849164325042821eabb5ed4d19729..41ef161db1427b33abc548baa93a194ff6b6f37a 100644 (file)
@@ -24,6 +24,7 @@
 #else
 #error "Unsupported architecture"
 #endif
+#include <traps.h>
 
 /*
  * a placeholder for the start of day information passed up from the hypervisor
@@ -37,7 +38,8 @@ extern union start_info_union start_info_union;
 #define start_info (start_info_union.start_info)
 
 /* hypervisor.c */
-//void do_hypervisor_callback(struct pt_regs *regs);
+void force_evtchn_callback(void);
+void do_hypervisor_callback(struct pt_regs *regs);
 void mask_evtchn(u32 port);
 void unmask_evtchn(u32 port);
 void clear_evtchn(u32 port);
index e6b7884d7ab65169c8c717a04d9d1397f837bfd5..2ae53313931186ec96fc5110565b66586a46dd42 100644 (file)
@@ -189,17 +189,6 @@ __synch_cmpxchg(volatile void *ptr, uint64_t old, uint64_t new, int size)
        return ia64_cmpxchg_acq_64(ptr, old, new);
 }
 
-/*
- * Force a proper event-channel callback from Xen after clearing the
- * callback mask. We do this in a very simple manner, by making a call
- * down into Xen. The pending flag will be checked by Xen on return.
- */
-static inline void
-force_evtchn_callback(void)
-{
-       (void)HYPERVISOR_xen_version(0, NULL);
-}
-
 extern shared_info_t *HYPERVISOR_shared_info;
 
 static inline int
index 7217d0b3cadd74ff4bababb409e71c2b7b3af590..1cab0a73db3429ab2b0ce081b6a51b571823f848 100644 (file)
@@ -28,7 +28,6 @@ extern void do_exit(void) __attribute__((noreturn));
 #include <xen/xen.h>
 
 
-#define force_evtchn_callback() ((void)HYPERVISOR_xen_version(0, 0))
 
 #define __KERNEL_CS  FLAT_KERNEL_CS
 #define __KERNEL_DS  FLAT_KERNEL_DS