ia64/xen-unstable

changeset 15138:010370333a88

[IA64] memmap: save/restore implemented

Implemented XENMEM_maximum_gpfn for domain save/restore with domain memmap.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Thu May 24 15:48:31 2007 -0600 (2007-05-24)
parents 27735ce15f97
children c693c50a6ad5
files linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c xen/arch/ia64/xen/mm.c xen/include/asm-ia64/mm.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c	Thu May 24 15:43:58 2007 -0600
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c	Thu May 24 15:48:31 2007 -0600
     1.3 @@ -430,6 +430,21 @@ xencomm_privcmd_memory_op(privcmd_hyperc
     1.4  
     1.5  		return ret;
     1.6  	}
     1.7 +	case XENMEM_maximum_gpfn:
     1.8 +	{
     1.9 +		domid_t kern_domid;
    1.10 +		domid_t __user *user_domid;
    1.11 +		struct xencomm_handle *desc;
    1.12 +
    1.13 +		user_domid = (domid_t __user *)hypercall->arg[1];
    1.14 +		if (copy_from_user(&kern_domid, user_domid, sizeof(domid_t)))
    1.15 +			return -EFAULT;
    1.16 +		desc = xencomm_create_inline(&kern_domid);
    1.17 +
    1.18 +		ret = xencomm_arch_hypercall_memory_op(cmd, desc);
    1.19 +
    1.20 +		return ret;
    1.21 +	}
    1.22  	case XENMEM_translate_gpfn_list:
    1.23  	{
    1.24  		xen_translate_gpfn_list_t kern_op;
     2.1 --- a/xen/arch/ia64/xen/mm.c	Thu May 24 15:43:58 2007 -0600
     2.2 +++ b/xen/arch/ia64/xen/mm.c	Thu May 24 15:48:31 2007 -0600
     2.3 @@ -370,6 +370,12 @@ mm_final_teardown(struct domain* d)
     2.4      mm_p2m_teardown(d);
     2.5  }
     2.6  
     2.7 +unsigned long
     2.8 +domain_get_maximum_gpfn(struct domain *d)
     2.9 +{
    2.10 +    return (d->arch.convmem_end + PAGE_SIZE - 1) >> PAGE_SHIFT;
    2.11 +}
    2.12 +
    2.13  // stolen from share_xen_page_with_guest() in xen/arch/x86/mm.c
    2.14  void
    2.15  share_xen_page_with_guest(struct page_info *page,
     3.1 --- a/xen/include/asm-ia64/mm.h	Thu May 24 15:43:58 2007 -0600
     3.2 +++ b/xen/include/asm-ia64/mm.h	Thu May 24 15:48:31 2007 -0600
     3.3 @@ -506,6 +506,6 @@ int steal_page(
     3.4  
     3.5  #define domain_clamp_alloc_bitsize(d, b) (b)
     3.6  
     3.7 -#define domain_get_maximum_gpfn(d) (-ENOSYS)
     3.8 +unsigned long domain_get_maximum_gpfn(struct domain *d);
     3.9  
    3.10  #endif /* __ASM_IA64_MM_H__ */