ia64/linux-2.6.18-xen.hg

changeset 633:a18df47f671b

[IA64] Fix PV driver domains - xenlinux xencomm support

This adds xencomm support for several PHYSDEVOP calls (map_pirq and
unmap_pirq) as well as XEN_DOMCTL_assign_device.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Fri Aug 08 11:39:35 2008 +0900 (2008-08-08)
parents 324a5c041301
children cdd156cb645b
files arch/ia64/xen/xcom_hcall.c arch/ia64/xen/xcom_privcmd.c
line diff
     1.1 --- a/arch/ia64/xen/xcom_hcall.c	Thu Aug 07 11:58:10 2008 +0900
     1.2 +++ b/arch/ia64/xen/xcom_hcall.c	Fri Aug 08 11:39:35 2008 +0900
     1.3 @@ -148,6 +148,12 @@ xencomm_hypercall_physdev_op(int cmd, vo
     1.4  	case PHYSDEVOP_manage_pci_remove:
     1.5  		argsize = sizeof(physdev_manage_pci_t);
     1.6  		break;
     1.7 +	case PHYSDEVOP_map_pirq:
     1.8 +		argsize = sizeof(physdev_map_pirq_t);
     1.9 +		break;
    1.10 +	case PHYSDEVOP_unmap_pirq:
    1.11 +		argsize = sizeof(physdev_unmap_pirq_t);
    1.12 +		break;
    1.13  
    1.14  	default:
    1.15  		printk("%s: unknown physdev op %d\n", __func__, cmd);
     2.1 --- a/arch/ia64/xen/xcom_privcmd.c	Thu Aug 07 11:58:10 2008 +0900
     2.2 +++ b/arch/ia64/xen/xcom_privcmd.c	Fri Aug 08 11:39:35 2008 +0900
     2.3 @@ -327,6 +327,7 @@ xencomm_privcmd_domctl(privcmd_hypercall
     2.4  	case XEN_DOMCTL_settimeoffset:
     2.5  	case XEN_DOMCTL_sendtrigger:
     2.6  	case XEN_DOMCTL_set_opt_feature:
     2.7 +	case XEN_DOMCTL_assign_device:
     2.8  		break;
     2.9  	case XEN_DOMCTL_pin_mem_cacheattr:
    2.10  		return -ENOSYS;
    2.11 @@ -831,6 +832,36 @@ xencomm_privcmd_ia64_debug_op(privcmd_hy
    2.12  	return ret;	
    2.13  }
    2.14  
    2.15 +static int
    2.16 +xencomm_privcmd_ia64_physdev_op(privcmd_hypercall_t *hypercall)
    2.17 +{
    2.18 +	int cmd = hypercall->arg[0];
    2.19 +	struct xencomm_handle *desc;
    2.20 +	unsigned int argsize;
    2.21 +	int ret;
    2.22 +
    2.23 +	switch (cmd) {
    2.24 +	case PHYSDEVOP_map_pirq:
    2.25 +		argsize = sizeof(physdev_map_pirq_t);
    2.26 +		break;
    2.27 +	case PHYSDEVOP_unmap_pirq:
    2.28 +		argsize = sizeof(physdev_unmap_pirq_t);
    2.29 +		break;
    2.30 +	default:
    2.31 +		printk("%s: unknown PHYSDEVOP %d\n", __func__, cmd);
    2.32 +		return -EINVAL;
    2.33 +	}
    2.34 +
    2.35 +	desc = xencomm_map((void *)hypercall->arg[1], argsize);
    2.36 +	if ((void *)hypercall->arg[1] != NULL && argsize > 0 && desc == NULL)
    2.37 +		return -ENOMEM;
    2.38 +
    2.39 +	ret = xencomm_arch_hypercall_physdev_op(cmd, desc);
    2.40 +
    2.41 +	xencomm_free(desc);
    2.42 +	return ret;
    2.43 +}
    2.44 +
    2.45  int
    2.46  privcmd_hypercall(privcmd_hypercall_t *hypercall)
    2.47  {
    2.48 @@ -857,6 +888,8 @@ privcmd_hypercall(privcmd_hypercall_t *h
    2.49  		return xencomm_privcmd_ia64_dom0vp_op(hypercall);
    2.50  	case __HYPERVISOR_ia64_debug_op:
    2.51  		return xencomm_privcmd_ia64_debug_op(hypercall);
    2.52 +	case __HYPERVISOR_physdev_op:
    2.53 +		return xencomm_privcmd_ia64_physdev_op(hypercall);
    2.54  	default:
    2.55  		printk("%s: unknown hcall (%ld)\n", __func__, hypercall->op);
    2.56  		return -ENOSYS;