ia64/xen-unstable

changeset 19762:d96cf4c974d5

tmem: cleanups

- don't mis-use guest handle for passing an MFN value
- eliminate unnecessary (and misplaced) use of XEN_GUEST_HANDLE_64
- use copy_from_guest() instead of __copy_from_guest() for loading the
argument structure

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 16 11:47:09 2009 +0100 (2009-06-16)
parents b52a91a45c65
children 45ca3f3c3f98
files xen/common/tmem_xen.c xen/include/public/tmem.h xen/include/xen/tmem_xen.h
line diff
     1.1 --- a/xen/common/tmem_xen.c	Tue Jun 16 11:41:31 2009 +0100
     1.2 +++ b/xen/common/tmem_xen.c	Tue Jun 16 11:47:09 2009 +0100
     1.3 @@ -87,10 +87,7 @@ static inline void *cli_mfn_to_va(tmem_c
     1.4      unsigned long cli_mfn;
     1.5      p2m_type_t t;
     1.6  
     1.7 -
     1.8 -    if (is_pv_32on64_vcpu(current))
     1.9 -        cmfn.p = (void *)((unsigned long)cmfn.p & 0xffffffffUL);
    1.10 -    cli_mfn = mfn_x(gfn_to_mfn(current->domain,(unsigned long)cmfn.p,&t));
    1.11 +    cli_mfn = mfn_x(gfn_to_mfn(current->domain, cmfn, &t));
    1.12      if (t != p2m_ram_rw)
    1.13          return NULL;
    1.14      if (pcli_mfn != NULL)
     2.1 --- a/xen/include/public/tmem.h	Tue Jun 16 11:41:31 2009 +0100
     2.2 +++ b/xen/include/public/tmem.h	Tue Jun 16 11:47:09 2009 +0100
     2.3 @@ -66,7 +66,7 @@
     2.4  
     2.5  
     2.6  #ifndef __ASSEMBLY__
     2.7 -typedef XEN_GUEST_HANDLE(void) tmem_cli_mfn_t;
     2.8 +typedef xen_pfn_t tmem_cli_mfn_t;
     2.9  typedef XEN_GUEST_HANDLE(char) tmem_cli_va_t;
    2.10  struct tmem_op {
    2.11      uint32_t cmd;
    2.12 @@ -95,7 +95,6 @@ struct tmem_op {
    2.13  };
    2.14  typedef struct tmem_op tmem_op_t;
    2.15  DEFINE_XEN_GUEST_HANDLE(tmem_op_t);
    2.16 -typedef XEN_GUEST_HANDLE_64(tmem_op_t) tmem_cli_op_t;
    2.17  
    2.18  #endif
    2.19  
     3.1 --- a/xen/include/xen/tmem_xen.h	Tue Jun 16 11:41:31 2009 +0100
     3.2 +++ b/xen/include/xen/tmem_xen.h	Tue Jun 16 11:47:09 2009 +0100
     3.3 @@ -281,12 +281,12 @@ static inline bool_t tmh_current_is_priv
     3.4  /* these typedefs are in the public/tmem.h interface
     3.5  typedef XEN_GUEST_HANDLE(void) cli_mfn_t;
     3.6  typedef XEN_GUEST_HANDLE(char) cli_va_t;
     3.7 -typedef XEN_GUEST_HANDLE(tmem_op_t) cli_tmemop_t;
     3.8  */
     3.9 +typedef XEN_GUEST_HANDLE(tmem_op_t) tmem_cli_op_t;
    3.10  
    3.11  static inline int tmh_get_tmemop_from_client(tmem_op_t *op, tmem_cli_op_t uops)
    3.12  {
    3.13 -    return __copy_from_guest(op, uops, 1);
    3.14 +    return copy_from_guest(op, uops, 1);
    3.15  }
    3.16  
    3.17  static inline void tmh_copy_to_client_buf_offset(tmem_cli_va_t clibuf, int off,