[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 7/7] mini-os: Moved force_evtchn_callback to header



On Wed, 2014-06-04 at 17:06 +0100, Thomas Leonard wrote:
> From: Karim Raslan <karim.allah.ahmed@xxxxxxxxx>

Why is this being done?

> 
> Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@xxxxxxxxx>
> [talex5@xxxxxxxxx: separated from big ARM commit]
> Signed-off-by: Thomas Leonard <talex5@xxxxxxxxx>
> ---
>  extras/mini-os/hypervisor.c         | 20 +-------------------
>  extras/mini-os/include/hypervisor.h |  1 -
>  extras/mini-os/include/x86/os.h     | 17 +++++++++++++++++
>  3 files changed, 18 insertions(+), 20 deletions(-)
> 
> diff --git a/extras/mini-os/hypervisor.c b/extras/mini-os/hypervisor.c
> index b4688a0..9c79d5d 100644
> --- a/extras/mini-os/hypervisor.c
> +++ b/extras/mini-os/hypervisor.c
> @@ -71,23 +71,6 @@ void do_hypervisor_callback(struct pt_regs *regs)
>      in_callback = 0;
>  }
>  
> -void force_evtchn_callback(void)
> -{
> -    int save;
> -    vcpu_info_t *vcpu;
> -    vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];
> -    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(uint32_t port)
>  {
>      shared_info_t *s = HYPERVISOR_shared_info;
> @@ -110,8 +93,7 @@ inline void unmask_evtchn(uint32_t port)
>                &vcpu_info->evtchn_pending_sel) )
>      {
>          vcpu_info->evtchn_upcall_pending = 1;
> -        if ( !vcpu_info->evtchn_upcall_mask )
> -            force_evtchn_callback();
> +        force_evtchn_callback();

If this is something to do with the code motion then I'm not sure what,
it certainly needs to be explained somewhere.

>      }
>  }
>  
> diff --git a/extras/mini-os/include/hypervisor.h 
> b/extras/mini-os/include/hypervisor.h
> index a62cb78..9e9cac8 100644
> --- a/extras/mini-os/include/hypervisor.h
> +++ b/extras/mini-os/include/hypervisor.h
> @@ -35,7 +35,6 @@ extern union start_info_union start_info_union;
>  #define start_info (start_info_union.start_info)
>  
>  /* hypervisor.c */
> -void force_evtchn_callback(void);
>  void do_hypervisor_callback(struct pt_regs *regs);
>  void mask_evtchn(uint32_t port);
>  void unmask_evtchn(uint32_t port);
> diff --git a/extras/mini-os/include/x86/os.h b/extras/mini-os/include/x86/os.h
> index 73b8297..8eea1be 100644
> --- a/extras/mini-os/include/x86/os.h
> +++ b/extras/mini-os/include/x86/os.h
> @@ -160,6 +160,23 @@ do {                                                     
>                 \
>   */
>  typedef struct { volatile int counter; } atomic_t;
>  
> +static inline void force_evtchn_callback(void)
> +{
> +    int save;
> +    vcpu_info_t *vcpu;
> +    vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()];
> +    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();
> +    };
> +}
> +
>  
>  /************************** i386 *******************************/
>  #ifdef __INSIDE_MINIOS__



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.