ia64/linux-2.6.18-xen.hg

changeset 743:6743af9fffc6

IA64: xencomm support for multi call with physdev_op and event_channel_op.

Recently the c/s of d545a95fca73 makes use of multi call
with __HYPERVISOR_event_channel_op and __HYPERVISOR_physdev_op.
This patch adds support of those hypercall.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Wed Dec 03 11:38:32 2008 +0900 (2008-12-03)
parents 6591b4869889
children 17adc5c344fe
files arch/ia64/xen/xcom_hcall.c
line diff
     1.1 --- a/arch/ia64/xen/xcom_hcall.c	Wed Nov 26 10:24:15 2008 +0900
     1.2 +++ b/arch/ia64/xen/xcom_hcall.c	Wed Dec 03 11:38:32 2008 +0900
     1.3 @@ -70,13 +70,27 @@ xencomm_hypercall_console_io(int cmd, in
     1.4  }
     1.5  EXPORT_SYMBOL_GPL(xencomm_hypercall_console_io);
     1.6  
     1.7 +static int
     1.8 +xencommize_event_channel_op(struct xencomm_mini **xc_area, void *op,
     1.9 +			    struct xencomm_handle **desc)
    1.10 +{
    1.11 +	*desc = __xencomm_map_no_alloc(op, sizeof(evtchn_op_t), *xc_area);
    1.12 +	if (*desc == NULL)
    1.13 +		return -EINVAL;
    1.14 +	(*xc_area)++;
    1.15 +	return 0;
    1.16 +}
    1.17 +
    1.18  int
    1.19  xencomm_hypercall_event_channel_op(int cmd, void *op)
    1.20  {
    1.21 +	int rc;
    1.22  	struct xencomm_handle *desc;
    1.23 -	desc = xencomm_map_no_alloc(op, sizeof(evtchn_op_t));
    1.24 -	if (desc == NULL)
    1.25 -		return -EINVAL;
    1.26 +	XENCOMM_MINI_ALIGNED(xc_area, 2);
    1.27 +
    1.28 +	rc = xencommize_event_channel_op(&xc_area, op, &desc);
    1.29 +	if (rc)
    1.30 +		return rc;
    1.31  
    1.32  	return xencomm_arch_hypercall_event_channel_op(cmd, desc);
    1.33  }
    1.34 @@ -127,8 +141,9 @@ xencomm_hypercall_xen_version(int cmd, v
    1.35  }
    1.36  EXPORT_SYMBOL_GPL(xencomm_hypercall_xen_version);
    1.37  
    1.38 -int
    1.39 -xencomm_hypercall_physdev_op(int cmd, void *op)
    1.40 +static int
    1.41 +xencommize_physdev_op(struct xencomm_mini **xc_area, int cmd, void *op,
    1.42 +		      struct xencomm_handle **desc)
    1.43  {
    1.44  	unsigned int argsize;
    1.45  	
    1.46 @@ -159,9 +174,26 @@ xencomm_hypercall_physdev_op(int cmd, vo
    1.47  		printk("%s: unknown physdev op %d\n", __func__, cmd);
    1.48  		return -ENOSYS;
    1.49  	}
    1.50 -	
    1.51 -	return xencomm_arch_hypercall_physdev_op
    1.52 -		(cmd, xencomm_map_no_alloc(op, argsize));
    1.53 +
    1.54 +	*desc = __xencomm_map_no_alloc(op, argsize, *xc_area);
    1.55 +	if (*desc == NULL)
    1.56 +		return -EINVAL;
    1.57 +	(*xc_area)++;
    1.58 +	return 0;
    1.59 +}
    1.60 +
    1.61 +int
    1.62 +xencomm_hypercall_physdev_op(int cmd, void *op)
    1.63 +{
    1.64 +	int rc;
    1.65 +	struct xencomm_handle *desc;
    1.66 +	XENCOMM_MINI_ALIGNED(xc_area, 2);
    1.67 +
    1.68 +	rc = xencommize_physdev_op(&xc_area, cmd, op, &desc);
    1.69 +	if (rc)
    1.70 +		return rc;
    1.71 +
    1.72 +	return xencomm_arch_hypercall_physdev_op(cmd, desc);
    1.73  }
    1.74  
    1.75  static int
    1.76 @@ -320,6 +352,34 @@ xencomm_hypercall_multicall(void *call_l
    1.77  				return rc;
    1.78  			mce->args[1] = (unsigned long)desc;
    1.79  			break;
    1.80 +		case __HYPERVISOR_event_channel_op:
    1.81 +			rc = xencommize_event_channel_op(&xc_area,
    1.82 +							 (void *)mce->args[1],
    1.83 +							 &desc);
    1.84 +			if (rc)
    1.85 +				return rc;
    1.86 +			mce->args[1] = (unsigned long)desc;
    1.87 +			break;
    1.88 +		case __HYPERVISOR_physdev_op:
    1.89 +			switch (mce->args[0]) {
    1.90 +			case PHYSDEVOP_eoi: {
    1.91 +				struct physdev_eoi *eoi =
    1.92 +					(struct physdev_eoi *)mce->args[1];
    1.93 +				mce->op = __HYPERVISOR_ia64_fast_eoi;
    1.94 +				mce->args[0] = eoi->irq;
    1.95 +				break;
    1.96 +			}
    1.97 +			default:
    1.98 +				rc = xencommize_physdev_op(&xc_area,
    1.99 +							   mce->args[0],
   1.100 +							   (void *)mce->args[1],
   1.101 +							   &desc);
   1.102 +				if (rc)
   1.103 +					return rc;
   1.104 +				mce->args[1] = (unsigned long)desc;
   1.105 +				break;
   1.106 +			}
   1.107 +			break;
   1.108  		case __HYPERVISOR_memory_op:
   1.109  		default:
   1.110  			printk("%s: unhandled multicall op entry op %lu\n",