ia64/xen-unstable

changeset 14742:602d061ff51f

linux: simplify and perform checking of multicall status
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Thu Apr 05 10:43:50 2007 +0100 (2007-04-05)
parents 556402cdf011
children 4de012324477 e518f2fbdd72
files linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h linux-2.6-xen-sparse/include/xen/hvm.h linux-2.6-xen-sparse/include/xen/hypercall.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c	Wed Apr 04 18:50:11 2007 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c	Thu Apr 05 10:43:50 2007 +0100
     1.3 @@ -303,7 +303,7 @@ int xen_create_contiguous_region(
     1.4  		set_phys_to_machine((__pa(vstart)>>PAGE_SHIFT)+i,
     1.5  			INVALID_P2M_ENTRY);
     1.6  	}
     1.7 -	if (HYPERVISOR_multicall(cr_mcl, i))
     1.8 +	if (HYPERVISOR_multicall_check(cr_mcl, i, NULL))
     1.9  		BUG();
    1.10  
    1.11  	/* 2. Get a new contiguous memory extent. */
    1.12 @@ -342,7 +342,7 @@ int xen_create_contiguous_region(
    1.13  	cr_mcl[i - 1].args[MULTI_UVMFLAGS_INDEX] = order
    1.14  						   ? UVMF_TLB_FLUSH|UVMF_ALL
    1.15  						   : UVMF_INVLPG|UVMF_ALL;
    1.16 -	if (HYPERVISOR_multicall(cr_mcl, i))
    1.17 +	if (HYPERVISOR_multicall_check(cr_mcl, i, NULL))
    1.18  		BUG();
    1.19  
    1.20  	if (success)
    1.21 @@ -400,7 +400,7 @@ void xen_destroy_contiguous_region(unsig
    1.22  			INVALID_P2M_ENTRY);
    1.23  		out_frames[i] = (__pa(vstart) >> PAGE_SHIFT) + i;
    1.24  	}
    1.25 -	if (HYPERVISOR_multicall(cr_mcl, i))
    1.26 +	if (HYPERVISOR_multicall_check(cr_mcl, i, NULL))
    1.27  		BUG();
    1.28  
    1.29  	/* 3. Do the exchange for non-contiguous MFNs. */
    1.30 @@ -432,7 +432,7 @@ void xen_destroy_contiguous_region(unsig
    1.31  	cr_mcl[i - 1].args[MULTI_UVMFLAGS_INDEX] = order
    1.32  						   ? UVMF_TLB_FLUSH|UVMF_ALL
    1.33  						   : UVMF_INVLPG|UVMF_ALL;
    1.34 -	if (HYPERVISOR_multicall(cr_mcl, i))
    1.35 +	if (HYPERVISOR_multicall_check(cr_mcl, i, NULL))
    1.36  		BUG();
    1.37  
    1.38  	balloon_unlock(flags);
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c	Wed Apr 04 18:50:11 2007 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c	Thu Apr 05 10:43:50 2007 +0100
     2.3 @@ -7,7 +7,6 @@
     2.4  #include <xen/interface/kexec.h>
     2.5  #include <linux/mm.h>
     2.6  #include <linux/bootmem.h>
     2.7 -#include <asm/hypercall.h>
     2.8  
     2.9  extern void machine_kexec_setup_load_arg(xen_kexec_image_t *xki, 
    2.10  					 struct kimage *image);
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed Apr 04 18:50:11 2007 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Apr 05 10:43:50 2007 +0100
     3.3 @@ -1511,7 +1511,7 @@ static void netif_release_rx_bufs(struct
     3.4  	struct sk_buff *skb;
     3.5  	unsigned long mfn;
     3.6  	int xfer = 0, noxfer = 0, unused = 0;
     3.7 -	int id, ref;
     3.8 +	int id, ref, rc;
     3.9  
    3.10  	if (np->copying_receiver) {
    3.11  		WPRINTK("%s: fix me for copying receiver.\n", __FUNCTION__);
    3.12 @@ -1579,7 +1579,9 @@ static void netif_release_rx_bufs(struct
    3.13  			mcl->args[2] = 0;
    3.14  			mcl->args[3] = DOMID_SELF;
    3.15  			mcl++;
    3.16 -			HYPERVISOR_multicall(np->rx_mcl, mcl - np->rx_mcl);
    3.17 +			rc = HYPERVISOR_multicall_check(
    3.18 +				np->rx_mcl, mcl - np->rx_mcl, NULL);
    3.19 +			BUG_ON(rc);
    3.20  		}
    3.21  	}
    3.22  
     4.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h	Wed Apr 04 18:50:11 2007 +0100
     4.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h	Thu Apr 05 10:43:50 2007 +0100
     4.3 @@ -238,7 +238,7 @@ HYPERVISOR_memory_op(
     4.4  
     4.5  static inline int
     4.6  HYPERVISOR_multicall(
     4.7 -	void *call_list, int nr_calls)
     4.8 +	multicall_entry_t *call_list, int nr_calls)
     4.9  {
    4.10  	return _hypercall2(int, multicall, call_list, nr_calls);
    4.11  }
     5.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h	Wed Apr 04 18:50:11 2007 +0100
     5.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h	Thu Apr 05 10:43:50 2007 +0100
     5.3 @@ -128,7 +128,7 @@ u64 jiffies_to_st(unsigned long jiffies)
     5.4  #define scrub_pages(_p,_n) ((void)0)
     5.5  #endif
     5.6  
     5.7 -#include <asm/hypercall.h>
     5.8 +#include <xen/hypercall.h>
     5.9  
    5.10  #if defined(CONFIG_X86_64)
    5.11  #define MULTI_UVMFLAGS_INDEX 2
     6.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h	Wed Apr 04 18:50:11 2007 +0100
     6.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h	Thu Apr 05 10:43:50 2007 +0100
     6.3 @@ -55,7 +55,7 @@ extern int running_on_xen;
     6.4  #include <xen/interface/event_channel.h>
     6.5  #include <xen/interface/physdev.h>
     6.6  #include <xen/interface/sched.h>
     6.7 -#include <asm/hypercall.h>
     6.8 +#include <xen/hypercall.h>
     6.9  #include <asm/ptrace.h>
    6.10  #include <asm/page.h>
    6.11  
     7.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h	Wed Apr 04 18:50:11 2007 +0100
     7.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h	Thu Apr 05 10:43:50 2007 +0100
     7.3 @@ -241,7 +241,7 @@ HYPERVISOR_memory_op(
     7.4  
     7.5  static inline int
     7.6  HYPERVISOR_multicall(
     7.7 -	void *call_list, int nr_calls)
     7.8 +	multicall_entry_t *call_list, int nr_calls)
     7.9  {
    7.10  	return _hypercall2(int, multicall, call_list, nr_calls);
    7.11  }
     8.1 --- a/linux-2.6-xen-sparse/include/xen/hvm.h	Wed Apr 04 18:50:11 2007 +0100
     8.2 +++ b/linux-2.6-xen-sparse/include/xen/hvm.h	Thu Apr 05 10:43:50 2007 +0100
     8.3 @@ -3,7 +3,6 @@
     8.4  #define XEN_HVM_H__
     8.5  
     8.6  #include <xen/interface/hvm/params.h>
     8.7 -#include <asm/hypercall.h>
     8.8  
     8.9  static inline unsigned long hvm_get_parameter(int idx)
    8.10  {
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/linux-2.6-xen-sparse/include/xen/hypercall.h	Thu Apr 05 10:43:50 2007 +0100
     9.3 @@ -0,0 +1,24 @@
     9.4 +#ifndef __XEN_HYPERCALL_H__
     9.5 +#define __XEN_HYPERCALL_H__
     9.6 +
     9.7 +#include <asm/hypercall.h>
     9.8 +
     9.9 +static inline int
    9.10 +HYPERVISOR_multicall_check(
    9.11 +	multicall_entry_t *call_list, int nr_calls,
    9.12 +	const unsigned long *rc_list)
    9.13 +{
    9.14 +	int rc = HYPERVISOR_multicall(call_list, nr_calls);
    9.15 +
    9.16 +	if (unlikely(rc < 0))
    9.17 +		return rc;
    9.18 +	BUG_ON(rc);
    9.19 +
    9.20 +	for ( ; nr_calls > 0; --nr_calls, ++call_list)
    9.21 +		if (unlikely(call_list->result != (rc_list ? *rc_list++ : 0)))
    9.22 +			return nr_calls;
    9.23 +
    9.24 +	return 0;
    9.25 +}
    9.26 +
    9.27 +#endif /* __XEN_HYPERCALL_H__ */