direct-io.hg

changeset 12442:fe543184f7f9

[IA64] Fix xencomm for xm mem-set command

This patch saves and restores the hypercall parameter within xencomm.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Mon Nov 13 11:24:30 2006 -0700 (2006-11-13)
parents 169687dab774
children 7cffdb2b44c9
files linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c	Mon Nov 13 11:02:37 2006 -0700
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_hcall.c	Mon Nov 13 11:24:30 2006 -0700
     1.3 @@ -221,10 +221,17 @@ xencommize_memory_reservation (xen_memor
     1.4  int
     1.5  xencomm_hypercall_memory_op(unsigned int cmd, void *arg)
     1.6  {
     1.7 +	XEN_GUEST_HANDLE(xen_pfn_t) extent_start_va[2];
     1.8 +	xen_memory_reservation_t *xmr = NULL, *xme_in = NULL, *xme_out = NULL;
     1.9 +	int rc;
    1.10 +
    1.11  	switch (cmd) {
    1.12  	case XENMEM_increase_reservation:
    1.13  	case XENMEM_decrease_reservation:
    1.14  	case XENMEM_populate_physmap:
    1.15 +		xmr = (xen_memory_reservation_t *)arg;
    1.16 +		xen_guest_handle(extent_start_va[0]) =
    1.17 +			xen_guest_handle(xmr->extent_start);
    1.18  		xencommize_memory_reservation((xen_memory_reservation_t *)arg);
    1.19  		break;
    1.20  		
    1.21 @@ -232,6 +239,12 @@ xencomm_hypercall_memory_op(unsigned int
    1.22  		break;
    1.23  
    1.24  	case XENMEM_exchange:
    1.25 +		xme_in  = &((xen_memory_exchange_t *)arg)->in;
    1.26 +		xme_out = &((xen_memory_exchange_t *)arg)->out;
    1.27 +		xen_guest_handle(extent_start_va[0]) =
    1.28 +			xen_guest_handle(xme_in->extent_start);
    1.29 +		xen_guest_handle(extent_start_va[1]) =
    1.30 +			xen_guest_handle(xme_out->extent_start);
    1.31  		xencommize_memory_reservation
    1.32  			(&((xen_memory_exchange_t *)arg)->in);
    1.33  		xencommize_memory_reservation
    1.34 @@ -243,8 +256,25 @@ xencomm_hypercall_memory_op(unsigned int
    1.35  		return -ENOSYS;
    1.36  	}
    1.37  
    1.38 -	return xencomm_arch_hypercall_memory_op
    1.39 -		(cmd, xencomm_create_inline(arg));
    1.40 +	rc =  xencomm_arch_hypercall_memory_op(cmd, xencomm_create_inline(arg));
    1.41 +
    1.42 +	switch (cmd) {
    1.43 +	case XENMEM_increase_reservation:
    1.44 +	case XENMEM_decrease_reservation:
    1.45 +	case XENMEM_populate_physmap:
    1.46 +		xen_guest_handle(xmr->extent_start) =
    1.47 +			xen_guest_handle(extent_start_va[0]);
    1.48 +		break;
    1.49 +
    1.50 +	case XENMEM_exchange:
    1.51 +		xen_guest_handle(xme_in->extent_start) =
    1.52 +			xen_guest_handle(extent_start_va[0]);
    1.53 +		xen_guest_handle(xme_out->extent_start) =
    1.54 +			xen_guest_handle(extent_start_va[1]);
    1.55 +		break;
    1.56 +	}
    1.57 +
    1.58 +	return rc;
    1.59  }
    1.60  
    1.61  unsigned long