ia64/xen-unstable

changeset 10315:c191c649cdb3

Use explicitly-sized types in the dom0_ops and privcmd structures.
As discussed previously, the these operations are not performance-sensitive, so
the additional cache footprint shouldn't be an issue.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Jun 06 10:25:59 2006 +0100 (2006-06-06)
parents b3d901ba705d
children e5c17d2d85a4
files linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c linux-2.6-xen-sparse/include/xen/public/privcmd.h xen/include/public/dom0_ops.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Tue Jun 06 09:48:17 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Tue Jun 06 10:25:59 2006 +0100
     1.3 @@ -61,11 +61,11 @@ static int privcmd_ioctl(struct inode *i
     1.4  		__asm__ __volatile__ (
     1.5  			"pushl %%ebx; pushl %%ecx; pushl %%edx; "
     1.6  			"pushl %%esi; pushl %%edi; "
     1.7 -			"movl  4(%%eax),%%ebx ;"
     1.8 -			"movl  8(%%eax),%%ecx ;"
     1.9 -			"movl 12(%%eax),%%edx ;"
    1.10 -			"movl 16(%%eax),%%esi ;"
    1.11 -			"movl 20(%%eax),%%edi ;"
    1.12 +			"movl  8(%%eax),%%ebx ;"
    1.13 +			"movl 16(%%eax),%%ecx ;"
    1.14 +			"movl 24(%%eax),%%edx ;"
    1.15 +			"movl 32(%%eax),%%esi ;"
    1.16 +			"movl 40(%%eax),%%edi ;"
    1.17  			"movl   (%%eax),%%eax ;"
    1.18  			"shll $5,%%eax ;"
    1.19  			"addl $hypercall_page,%%eax ;"
    1.20 @@ -210,7 +210,7 @@ static int privcmd_ioctl(struct inode *i
    1.21  	batch_err:
    1.22  		printk("batch_err ret=%d vma=%p addr=%lx "
    1.23  		       "num=%d arr=%p %lx-%lx\n", 
    1.24 -		       ret, vma, m.addr, m.num, m.arr,
    1.25 +		       ret, vma, (unsigned long)m.addr, m.num, m.arr,
    1.26  		       vma ? vma->vm_start : 0, vma ? vma->vm_end : 0);
    1.27  		break;
    1.28  	}
     2.1 --- a/linux-2.6-xen-sparse/include/xen/public/privcmd.h	Tue Jun 06 09:48:17 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/include/xen/public/privcmd.h	Tue Jun 06 10:25:59 2006 +0100
     2.3 @@ -33,20 +33,22 @@
     2.4  #ifndef __LINUX_PUBLIC_PRIVCMD_H__
     2.5  #define __LINUX_PUBLIC_PRIVCMD_H__
     2.6  
     2.7 +#include <linux/types.h>
     2.8 +
     2.9  #ifndef __user
    2.10  #define __user
    2.11  #endif
    2.12  
    2.13  typedef struct privcmd_hypercall
    2.14  {
    2.15 -	unsigned long op;
    2.16 -	unsigned long arg[5];
    2.17 +	__u64 op;
    2.18 +	__u64 arg[5];
    2.19  } privcmd_hypercall_t;
    2.20  
    2.21  typedef struct privcmd_mmap_entry {
    2.22 -	unsigned long va;
    2.23 -	unsigned long mfn;
    2.24 -	unsigned long npages;
    2.25 +	__u64 va;
    2.26 +	__u64 mfn;
    2.27 +	__u64 npages;
    2.28  } privcmd_mmap_entry_t; 
    2.29  
    2.30  typedef struct privcmd_mmap {
    2.31 @@ -58,7 +60,7 @@ typedef struct privcmd_mmap {
    2.32  typedef struct privcmd_mmapbatch {
    2.33  	int num;     /* number of pages to populate */
    2.34  	domid_t dom; /* target domain */
    2.35 -	unsigned long addr;  /* virtual address */
    2.36 +	__u64 addr;  /* virtual address */
    2.37  	xen_pfn_t __user *arr; /* array of mfns - top nibble set on err */
    2.38  } privcmd_mmapbatch_t; 
    2.39  
     3.1 --- a/xen/include/public/dom0_ops.h	Tue Jun 06 09:48:17 2006 +0100
     3.2 +++ b/xen/include/public/dom0_ops.h	Tue Jun 06 10:25:59 2006 +0100
     3.3 @@ -19,7 +19,7 @@
     3.4   * This makes sure that old versions of dom0 tools will stop working in a
     3.5   * well-defined way (rather than crashing the machine, for instance).
     3.6   */
     3.7 -#define DOM0_INTERFACE_VERSION   0x03000000
     3.8 +#define DOM0_INTERFACE_VERSION   0x03000001
     3.9  
    3.10  /************************************************************************/
    3.11  
    3.12 @@ -27,10 +27,10 @@
    3.13  struct dom0_getmemlist {
    3.14      /* IN variables. */
    3.15      domid_t       domain;
    3.16 -    unsigned long max_pfns;
    3.17 +    uint64_t max_pfns;
    3.18      XEN_GUEST_HANDLE(xen_pfn_t) buffer;
    3.19      /* OUT variables. */
    3.20 -    unsigned long num_pfns;
    3.21 +    uint64_t num_pfns;
    3.22  };
    3.23  typedef struct dom0_getmemlist dom0_getmemlist_t;
    3.24  DEFINE_XEN_GUEST_HANDLE(dom0_getmemlist_t);
    3.25 @@ -96,8 +96,8 @@ struct dom0_getdomaininfo {
    3.26  #define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code.  */
    3.27  #define DOMFLAGS_SHUTDOWNSHIFT 16
    3.28      uint32_t flags;
    3.29 -    unsigned long tot_pages;
    3.30 -    unsigned long max_pages;
    3.31 +    uint64_t tot_pages;
    3.32 +    uint64_t max_pages;
    3.33      xen_pfn_t shared_info_frame;  /* MFN of shared_info struct */
    3.34      uint64_t cpu_time;
    3.35      uint32_t nr_online_vcpus;     /* Number of VCPUs currently online. */
    3.36 @@ -229,8 +229,8 @@ struct dom0_physinfo {
    3.37      uint32_t sockets_per_node;
    3.38      uint32_t nr_nodes;
    3.39      uint32_t cpu_khz;
    3.40 -    unsigned long total_pages;
    3.41 -    unsigned long free_pages;
    3.42 +    uint64_t total_pages;
    3.43 +    uint64_t free_pages;
    3.44      uint32_t hw_cap[8];
    3.45  };
    3.46  typedef struct dom0_physinfo dom0_physinfo_t;
    3.47 @@ -276,7 +276,7 @@ struct dom0_shadow_control {
    3.48      uint32_t       op;
    3.49      XEN_GUEST_HANDLE(ulong) dirty_bitmap;
    3.50      /* IN/OUT variables. */
    3.51 -    unsigned long  pages;        /* size of buffer, updated with actual size */
    3.52 +    uint64_t       pages;        /* size of buffer, updated with actual size */
    3.53      /* OUT variables. */
    3.54      struct dom0_shadow_control_stats stats;
    3.55  };
    3.56 @@ -286,8 +286,8 @@ DEFINE_XEN_GUEST_HANDLE(dom0_shadow_cont
    3.57  #define DOM0_SETDOMAINMAXMEM   28
    3.58  struct dom0_setdomainmaxmem {
    3.59      /* IN variables. */
    3.60 -    domid_t       domain;
    3.61 -    unsigned long max_memkb;
    3.62 +    domid_t  domain;
    3.63 +    uint64_t max_memkb;
    3.64  };
    3.65  typedef struct dom0_setdomainmaxmem dom0_setdomainmaxmem_t;
    3.66  DEFINE_XEN_GUEST_HANDLE(dom0_setdomainmaxmem_t);
    3.67 @@ -295,8 +295,8 @@ DEFINE_XEN_GUEST_HANDLE(dom0_setdomainma
    3.68  #define DOM0_GETPAGEFRAMEINFO2 29   /* batched interface */
    3.69  struct dom0_getpageframeinfo2 {
    3.70      /* IN variables. */
    3.71 -    domid_t        domain;
    3.72 -    unsigned long  num;
    3.73 +    domid_t  domain;
    3.74 +    uint64_t num;
    3.75      /* IN/OUT variables. */
    3.76      XEN_GUEST_HANDLE(ulong) array;
    3.77  };
    3.78 @@ -314,11 +314,11 @@ DEFINE_XEN_GUEST_HANDLE(dom0_getpagefram
    3.79  struct dom0_add_memtype {
    3.80      /* IN variables. */
    3.81      xen_pfn_t mfn;
    3.82 -    unsigned long nr_mfns;
    3.83 -    uint32_t      type;
    3.84 +    uint64_t nr_mfns;
    3.85 +    uint32_t type;
    3.86      /* OUT variables. */
    3.87 -    uint32_t      handle;
    3.88 -    uint32_t      reg;
    3.89 +    uint32_t handle;
    3.90 +    uint32_t reg;
    3.91  };
    3.92  typedef struct dom0_add_memtype dom0_add_memtype_t;
    3.93  DEFINE_XEN_GUEST_HANDLE(dom0_add_memtype_t);
    3.94 @@ -346,7 +346,7 @@ struct dom0_read_memtype {
    3.95      uint32_t reg;
    3.96      /* OUT variables. */
    3.97      xen_pfn_t mfn;
    3.98 -    unsigned long nr_mfns;
    3.99 +    uint64_t nr_mfns;
   3.100      uint32_t type;
   3.101  };
   3.102  typedef struct dom0_read_memtype dom0_read_memtype_t;
   3.103 @@ -500,7 +500,7 @@ DEFINE_XEN_GUEST_HANDLE(dom0_irq_permiss
   3.104  struct dom0_iomem_permission {
   3.105      domid_t  domain;          /* domain to be affected */
   3.106      xen_pfn_t first_mfn;      /* first page (physical page number) in range */
   3.107 -    unsigned long nr_mfns;    /* number of pages in range (>0) */
   3.108 +    uint64_t nr_mfns;         /* number of pages in range (>0) */
   3.109      uint8_t allow_access;     /* allow (!0) or deny (0) access to range? */
   3.110  };
   3.111  typedef struct dom0_iomem_permission dom0_iomem_permission_t;