instead of unnecessarily going through the hypervisor.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
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)
{
#else
#error "Unsupported architecture"
#endif
+#include <traps.h>
/*
* a placeholder for the start of day information passed up from the hypervisor
#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);
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
#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