ia64/linux-2.6.18-xen.hg

changeset 543:e5933404dada

[IA64] implement xencomm routine for HVMOP_track_dirty_vram.

This patches implement xencomm routine for HVMOP_track_dirty_vram hypercall.
Without this, using vfb results in annoying messages in dom0 as
> xencomm_privcmd_hvm_op: unknown HVMOP 6
xen/ia64 doesn't implement the hypercall at this moment so that
it simply returns -ENOSYS. So the xencomm routine returns -ENOSYS
directly without issuing the useless hypercall.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Tue May 13 10:42:09 2008 +0900 (2008-05-13)
parents f6fcc65413ae
children 2d858799d109
files arch/ia64/xen/xcom_privcmd.c
line diff
     1.1 --- a/arch/ia64/xen/xcom_privcmd.c	Tue May 13 10:38:04 2008 +0900
     1.2 +++ b/arch/ia64/xen/xcom_privcmd.c	Tue May 13 10:42:09 2008 +0900
     1.3 @@ -661,6 +661,41 @@ xencomm_privcmd_event_channel_op(privcmd
     1.4  }
     1.5  
     1.6  static int
     1.7 +xencomm_privcmd_hvm_op_track_dirty_vram(privcmd_hypercall_t *hypercall)
     1.8 +{
     1.9 +#if 1
    1.10 +	/*
    1.11 +	 * At this moment HVMOP_track_dirty_vram isn't implemented
    1.12 +	 * on xen/ia64 so that it just returns -ENOSYS.
    1.13 +	 * Don't issue hypercall to get -ENOSYS.
    1.14 +	 * When the hypercall is implemented, enable the following codes.
    1.15 +	 */
    1.16 +	return -ENOSYS;
    1.17 +#else
    1.18 +	int cmd = hypercall->arg[0];
    1.19 +	struct xen_hvm_track_dirty_vram *user_op = (void*)hypercall->arg[1];
    1.20 +	struct xen_hvm_track_dirty_vram kern_op;
    1.21 +	struct xencomm_handle *desc;
    1.22 +	struct xencomm_handle *bitmap_desc;
    1.23 +	int ret;
    1.24 +
    1.25 +	BUG_ON(cmd != HVMOP_track_dirty_vram);
    1.26 +	if (copy_from_user(&kern_op, user_op, sizeof(kern_op)))
    1.27 +		return -EFAULT;
    1.28 +	desc = xencomm_map_no_alloc(&kern_op, sizeof(kern_op));
    1.29 +	bitmap_desc = xencomm_map(xen_guest_handle(kern_op.dirty_bitmap),
    1.30 +				  kern_op.nr * sizeof(uint8_t));
    1.31 +	if (bitmap_desc == NULL)
    1.32 +		return -ENOMEM;
    1.33 +	set_xen_guest_handle(kern_op.dirty_bitmap, (void*)bitmap_desc);
    1.34 +	ret = xencomm_arch_hypercall_hvm_op(cmd, desc);
    1.35 +	xencomm_free(bitmap_desc);
    1.36 +
    1.37 +	return ret;
    1.38 +#endif
    1.39 +}
    1.40 +
    1.41 +static int
    1.42  xencomm_privcmd_hvm_op(privcmd_hypercall_t *hypercall)
    1.43  {
    1.44  	int cmd = hypercall->arg[0];
    1.45 @@ -683,6 +718,9 @@ xencomm_privcmd_hvm_op(privcmd_hypercall
    1.46  		argsize = sizeof(xen_hvm_set_pci_link_route_t);
    1.47  		break;
    1.48  
    1.49 +	case HVMOP_track_dirty_vram:
    1.50 +		return xencomm_privcmd_hvm_op_track_dirty_vram(hypercall);
    1.51 +
    1.52  	default:
    1.53  		printk("%s: unknown HVMOP %d\n", __func__, cmd);
    1.54  		return -EINVAL;