ia64/xen-unstable

changeset 11027:d735526b02ec

[IA64] catch up new hypercall HYPERVISR_hvm_op for IPF

append HYPERVISOR_hvm_op for IPF

Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Wed Aug 09 09:59:52 2006 -0600 (2006-08-09)
parents 54550e85f25a
children 111936ef4291
files xen/arch/ia64/vmx/vmx_hypercall.c xen/arch/ia64/xen/hypercall.c xen/include/asm-ia64/vmx_platform.h
line diff
     1.1 --- a/xen/arch/ia64/vmx/vmx_hypercall.c	Wed Aug 09 08:34:06 2006 -0600
     1.2 +++ b/xen/arch/ia64/vmx/vmx_hypercall.c	Wed Aug 09 09:59:52 2006 -0600
     1.3 @@ -35,4 +35,50 @@
     1.4  #include <asm/dom_fw.h>
     1.5  #include <xen/domain.h>
     1.6  
     1.7 -/* This file will include the hypercall code for VT-i domain, soon. */
     1.8 +long
     1.9 +do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
    1.10 +{
    1.11 +    long rc = 0;
    1.12 +
    1.13 +    switch (op) {
    1.14 +    case HVMOP_set_param:
    1.15 +    case HVMOP_get_param:
    1.16 +    {
    1.17 +        struct xen_hvm_param a;
    1.18 +        struct domain *d;
    1.19 +
    1.20 +        if (copy_from_guest(&a, arg, 1))
    1.21 +            return -EFAULT;
    1.22 +
    1.23 +        if (a.index > HVM_NR_PARAMS)
    1.24 +            return -EINVAL;
    1.25 +
    1.26 +        if (a.domid == DOMID_SELF) {
    1.27 +            get_knownalive_domain(current->domain);
    1.28 +            d = current->domain;
    1.29 +        }
    1.30 +        else if (IS_PRIV(current->domain)) {
    1.31 +            d = find_domain_by_id(a.domid);
    1.32 +            if (!d)
    1.33 +                return -ESRCH;
    1.34 +        }
    1.35 +        else
    1.36 +            return -EPERM;
    1.37 +
    1.38 +        if (op == HVMOP_set_param) {
    1.39 +            rc = 0;
    1.40 +            d->arch.hvm_domain.params[a.index] = a.value;
    1.41 +        }
    1.42 +        else
    1.43 +            rc = d->arch.hvm_domain.params[a.index];
    1.44 +
    1.45 +        put_domain(d);
    1.46 +        return rc;
    1.47 +    }
    1.48 +
    1.49 +    default:
    1.50 +        DPRINTK("Bad HVM op %ld.\n", op);
    1.51 +        rc = -ENOSYS;
    1.52 +    }
    1.53 +    return rc;
    1.54 +}
     2.1 --- a/xen/arch/ia64/xen/hypercall.c	Wed Aug 09 08:34:06 2006 -0600
     2.2 +++ b/xen/arch/ia64/xen/hypercall.c	Wed Aug 09 09:59:52 2006 -0600
     2.3 @@ -70,7 +70,7 @@ hypercall_t ia64_hypercall_table[] =
     2.4  	(hypercall_t)do_ni_hypercall,		/*  */
     2.5  	(hypercall_t)do_event_channel_op,
     2.6  	(hypercall_t)do_physdev_op,
     2.7 -	(hypercall_t)do_ni_hypercall,		/*  */
     2.8 +	(hypercall_t)do_hvm_op,			/*  */
     2.9  	(hypercall_t)do_ni_hypercall,		/*  */                  /* 35 */
    2.10  	(hypercall_t)do_ni_hypercall,		/*  */
    2.11  	(hypercall_t)do_ni_hypercall,		/*  */
     3.1 --- a/xen/include/asm-ia64/vmx_platform.h	Wed Aug 09 08:34:06 2006 -0600
     3.2 +++ b/xen/include/asm-ia64/vmx_platform.h	Wed Aug 09 09:59:52 2006 -0600
     3.3 @@ -20,6 +20,7 @@
     3.4  #define __ASM_IA64_VMX_PLATFORM_H__
     3.5  
     3.6  #include <public/xen.h>
     3.7 +#include <public/hvm/params.h>
     3.8  #include <public/arch-ia64.h>
     3.9  #include <asm/hvm/vioapic.h>
    3.10  struct mmio_list;
    3.11 @@ -27,6 +28,7 @@ typedef struct virtual_platform_def {
    3.12      unsigned long       shared_page_va;
    3.13      unsigned long       pib_base;
    3.14      unsigned char       xtp;
    3.15 +    unsigned long       params[HVM_NR_PARAMS];
    3.16      struct mmio_list    *mmio;
    3.17      /* One IOSAPIC now... */
    3.18      struct hvm_vioapic  vioapic;