ia64/xen-unstable

changeset 14235:9f49a53fea30

[XEN] Add arch hook for max_mem domctl.

This patch introduces an arch hook in the MAX_MEM hcall. In particular, PowerPC
will use this hook to create/update a p2m mapping array. This patch introduces
the hook only and should compile away on all arches.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Thu Mar 01 13:18:51 2007 -0600 (2007-03-01)
parents 6b42b8c08731
children 07066db94d89
files xen/common/domctl.c xen/include/asm-ia64/shadow.h xen/include/asm-powerpc/shadow.h xen/include/asm-x86/shadow.h
line diff
     1.1 --- a/xen/common/domctl.c	Thu Mar 01 14:32:58 2007 -0600
     1.2 +++ b/xen/common/domctl.c	Thu Mar 01 13:18:51 2007 -0600
     1.3 @@ -20,6 +20,7 @@
     1.4  #include <xen/rcupdate.h>
     1.5  #include <xen/guest_access.h>
     1.6  #include <xen/bitmap.h>
     1.7 +#include <xen/shadow.h>
     1.8  #include <asm/current.h>
     1.9  #include <public/domctl.h>
    1.10  #include <acm/acm_hooks.h>
    1.11 @@ -608,6 +609,9 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
    1.12          spin_lock(&d->page_alloc_lock);
    1.13          if ( new_max >= d->tot_pages )
    1.14          {
    1.15 +            ret = guest_physmap_max_mem_pages(d, new_max);
    1.16 +            if ( ret != 0 )
    1.17 +                break;
    1.18              d->max_pages = new_max;
    1.19              ret = 0;
    1.20          }
     2.1 --- a/xen/include/asm-ia64/shadow.h	Thu Mar 01 14:32:58 2007 -0600
     2.2 +++ b/xen/include/asm-ia64/shadow.h	Thu Mar 01 13:18:51 2007 -0600
     2.3 @@ -61,6 +61,8 @@ shadow_mark_page_dirty(struct domain *d,
     2.4          return 0;
     2.5  }
     2.6  
     2.7 +#define guest_physmap_max_mem_pages(d, n) (0)
     2.8 +
     2.9  #endif // _XEN_SHADOW_H
    2.10  
    2.11  /*
     3.1 --- a/xen/include/asm-powerpc/shadow.h	Thu Mar 01 14:32:58 2007 -0600
     3.2 +++ b/xen/include/asm-powerpc/shadow.h	Thu Mar 01 13:18:51 2007 -0600
     3.3 @@ -13,9 +13,10 @@
     3.4   * along with this program; if not, write to the Free Software
     3.5   * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     3.6   *
     3.7 - * Copyright (C) IBM Corp. 2005, 2006
     3.8 + * Copyright IBM Corp. 2005, 2006, 2007
     3.9   *
    3.10   * Authors: Hollis Blanchard <hollisb@us.ibm.com>
    3.11 + *          Ryan Harper <ryanh@us.ibm.com>
    3.12   */
    3.13  
    3.14  #ifndef _ASM_SHADOW_H_
    3.15 @@ -58,4 +59,8 @@ static inline unsigned int shadow_get_al
    3.16  {
    3.17      return (1ULL << (d->arch.htab.order + PAGE_SHIFT)) >> 20;
    3.18  }
    3.19 +
    3.20 +#define guest_physmap_max_mem_pages(d, n) (0)
    3.21 +
    3.22  #endif
    3.23 +
     4.1 --- a/xen/include/asm-x86/shadow.h	Thu Mar 01 14:32:58 2007 -0600
     4.2 +++ b/xen/include/asm-x86/shadow.h	Thu Mar 01 13:18:51 2007 -0600
     4.3 @@ -121,6 +121,8 @@ static inline void shadow_remove_all_sha
     4.4      sh_remove_shadows(v, gmfn, 0 /* Be thorough */, 1 /* Must succeed */);
     4.5  }
     4.6  
     4.7 +#define guest_physmap_max_mem_pages(d, n) (0)
     4.8 +
     4.9  #endif /* _XEN_SHADOW_H */
    4.10  
    4.11  /*