ia64/xen-unstable

changeset 10659:2aa910eb3713

[XEN] Hypercall-init dom0_op takes GMFN, not MFN.
Signed-off-by: Steven Smith <sos22@cl.cam.ac.uk>
author kfraser@localhost.localdomain
date Wed Jul 05 17:16:10 2006 +0100 (2006-07-05)
parents d6363854fb35
children 74018b65c369
files tools/libxc/xc_linux_build.c xen/arch/x86/dom0_ops.c xen/include/public/dom0_ops.h
line diff
     1.1 --- a/tools/libxc/xc_linux_build.c	Wed Jul 05 14:31:22 2006 +0100
     1.2 +++ b/tools/libxc/xc_linux_build.c	Wed Jul 05 17:16:10 2006 +0100
     1.3 @@ -1053,7 +1053,8 @@ static int setup_guest(int xc_handle,
     1.4          if ( hypercall_pfn >= nr_pages )
     1.5              goto error_out;
     1.6          op.u.hypercall_init.domain = (domid_t)dom;
     1.7 -        op.u.hypercall_init.mfn    = page_array[hypercall_pfn];
     1.8 +        op.u.hypercall_init.gmfn   = shadow_mode_enabled ?
     1.9 +            hypercall_pfn : page_array[hypercall_pfn];
    1.10          op.cmd = DOM0_HYPERCALL_INIT;
    1.11          if ( xc_dom0_op(xc_handle, &op) )
    1.12              goto error_out;
     2.1 --- a/xen/arch/x86/dom0_ops.c	Wed Jul 05 14:31:22 2006 +0100
     2.2 +++ b/xen/arch/x86/dom0_ops.c	Wed Jul 05 17:16:10 2006 +0100
     2.3 @@ -407,15 +407,17 @@ long arch_do_dom0_op(struct dom0_op *op,
     2.4  
     2.5      case DOM0_HYPERCALL_INIT:
     2.6      {
     2.7 -        struct domain *d; 
     2.8 -        unsigned long mfn = op->u.hypercall_init.mfn;
     2.9 +        struct domain *d = find_domain_by_id(op->u.hypercall_init.domain);
    2.10 +        unsigned long gmfn = op->u.hypercall_init.gmfn;
    2.11 +        unsigned long mfn;
    2.12          void *hypercall_page;
    2.13  
    2.14          ret = -ESRCH;
    2.15 -        if ( unlikely((d = find_domain_by_id(
    2.16 -            op->u.hypercall_init.domain)) == NULL) )
    2.17 +        if ( unlikely(d == NULL) )
    2.18              break;
    2.19  
    2.20 +        mfn = gmfn_to_mfn(d, gmfn);
    2.21 +
    2.22          ret = -EACCES;
    2.23          if ( !mfn_valid(mfn) ||
    2.24               !get_page_and_type(mfn_to_page(mfn), d, PGT_writable_page) )
     3.1 --- a/xen/include/public/dom0_ops.h	Wed Jul 05 14:31:22 2006 +0100
     3.2 +++ b/xen/include/public/dom0_ops.h	Wed Jul 05 17:16:10 2006 +0100
     3.3 @@ -509,8 +509,8 @@ DEFINE_XEN_GUEST_HANDLE(dom0_iomem_permi
     3.4  
     3.5  #define DOM0_HYPERCALL_INIT   48
     3.6  struct dom0_hypercall_init {
     3.7 -    domid_t  domain;          /* domain to be affected */
     3.8 -    xen_pfn_t mfn;            /* machine frame to be initialised */
     3.9 +    domid_t   domain;          /* domain to be affected */
    3.10 +    xen_pfn_t gmfn;            /* GMFN to be initialised */
    3.11  };
    3.12  typedef struct dom0_hypercall_init dom0_hypercall_init_t;
    3.13  DEFINE_XEN_GUEST_HANDLE(dom0_hypercall_init_t);