ia64/xen-unstable

changeset 17472:e35a379e7fe9

minios: call do_hypervisor_callback directly from force_evtchn_callback
instead of unnecessarily going through the hypervisor.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Apr 16 10:06:19 2008 +0100 (2008-04-16)
parents 681cfd0eda78
children 6cd0d4d1baa3
files extras/mini-os/hypervisor.c extras/mini-os/include/hypervisor.h extras/mini-os/include/ia64/os.h extras/mini-os/include/x86/os.h
line diff
     1.1 --- a/extras/mini-os/hypervisor.c	Wed Apr 16 10:05:57 2008 +0100
     1.2 +++ b/extras/mini-os/hypervisor.c	Wed Apr 16 10:06:19 2008 +0100
     1.3 @@ -66,6 +66,21 @@ void do_hypervisor_callback(struct pt_re
     1.4      in_callback = 0;
     1.5  }
     1.6  
     1.7 +void force_evtchn_callback(void)
     1.8 +{
     1.9 +    vcpu_info_t *vcpu;
    1.10 +    vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];
    1.11 +    int save = vcpu->evtchn_upcall_mask;
    1.12 +
    1.13 +    while (vcpu->evtchn_upcall_pending) {
    1.14 +        vcpu->evtchn_upcall_mask = 1;
    1.15 +        barrier();
    1.16 +        do_hypervisor_callback(NULL);
    1.17 +        barrier();
    1.18 +        vcpu->evtchn_upcall_mask = save;
    1.19 +        barrier();
    1.20 +    };
    1.21 +}
    1.22  
    1.23  inline void mask_evtchn(u32 port)
    1.24  {
     2.1 --- a/extras/mini-os/include/hypervisor.h	Wed Apr 16 10:05:57 2008 +0100
     2.2 +++ b/extras/mini-os/include/hypervisor.h	Wed Apr 16 10:06:19 2008 +0100
     2.3 @@ -24,6 +24,7 @@
     2.4  #else
     2.5  #error "Unsupported architecture"
     2.6  #endif
     2.7 +#include <traps.h>
     2.8  
     2.9  /*
    2.10   * a placeholder for the start of day information passed up from the hypervisor
    2.11 @@ -37,7 +38,8 @@ extern union start_info_union start_info
    2.12  #define start_info (start_info_union.start_info)
    2.13  
    2.14  /* hypervisor.c */
    2.15 -//void do_hypervisor_callback(struct pt_regs *regs);
    2.16 +void force_evtchn_callback(void);
    2.17 +void do_hypervisor_callback(struct pt_regs *regs);
    2.18  void mask_evtchn(u32 port);
    2.19  void unmask_evtchn(u32 port);
    2.20  void clear_evtchn(u32 port);
     3.1 --- a/extras/mini-os/include/ia64/os.h	Wed Apr 16 10:05:57 2008 +0100
     3.2 +++ b/extras/mini-os/include/ia64/os.h	Wed Apr 16 10:06:19 2008 +0100
     3.3 @@ -189,17 +189,6 @@ static inline unsigned long
     3.4  	return ia64_cmpxchg_acq_64(ptr, old, new);
     3.5  }
     3.6  
     3.7 -/*
     3.8 - * Force a proper event-channel callback from Xen after clearing the
     3.9 - * callback mask. We do this in a very simple manner, by making a call
    3.10 - * down into Xen. The pending flag will be checked by Xen on return.
    3.11 - */
    3.12 -static inline void
    3.13 -force_evtchn_callback(void)
    3.14 -{
    3.15 -	(void)HYPERVISOR_xen_version(0, NULL);
    3.16 -}
    3.17 -
    3.18  extern shared_info_t *HYPERVISOR_shared_info;
    3.19  
    3.20  static inline int
     4.1 --- a/extras/mini-os/include/x86/os.h	Wed Apr 16 10:05:57 2008 +0100
     4.2 +++ b/extras/mini-os/include/x86/os.h	Wed Apr 16 10:06:19 2008 +0100
     4.3 @@ -28,7 +28,6 @@ extern void do_exit(void) __attribute__(
     4.4  #include <xen/xen.h>
     4.5  
     4.6  
     4.7 -#define force_evtchn_callback() ((void)HYPERVISOR_xen_version(0, 0))
     4.8  
     4.9  #define __KERNEL_CS  FLAT_KERNEL_CS
    4.10  #define __KERNEL_DS  FLAT_KERNEL_DS