diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-10-22 15:14:51 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2010-10-22 15:14:51 +0100 |
commit | 3ee48e02ba3a3c83d1314af4db4e6d6c3b3891ef (patch) | |
tree | 0e9a13b05ccc70cc4a6ddbc6b7f2aecf6e11ad86 /tools/libxc/xc_private.c | |
parent | 2c63bc60a890e617af2639ee4d95cc05006d7e1c (diff) | |
download | xen-3ee48e02ba3a3c83d1314af4db4e6d6c3b3891ef.tar.gz xen-3ee48e02ba3a3c83d1314af4db4e6d6c3b3891ef.tar.bz2 xen-3ee48e02ba3a3c83d1314af4db4e6d6c3b3891ef.zip |
libxc: convert mmuext op interface over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_private.c')
-rw-r--r-- | tools/libxc/xc_private.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 2b9628a065..266a7c078f 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -341,23 +341,24 @@ int xc_mmuext_op( domid_t dom) { DECLARE_HYPERCALL; + DECLARE_HYPERCALL_BOUNCE(op, nr_ops*sizeof(*op), XC_HYPERCALL_BUFFER_BOUNCE_BOTH); long ret = -EINVAL; - if ( hcall_buf_prep(xch, (void **)&op, nr_ops*sizeof(*op)) != 0 ) + if ( xc_hypercall_bounce_pre(xch, op) ) { - PERROR("Could not lock memory for Xen hypercall"); + PERROR("Could not bounce memory for mmuext op hypercall"); goto out1; } hypercall.op = __HYPERVISOR_mmuext_op; - hypercall.arg[0] = (unsigned long)op; + hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(op); hypercall.arg[1] = (unsigned long)nr_ops; hypercall.arg[2] = (unsigned long)0; hypercall.arg[3] = (unsigned long)dom; ret = do_xen_hypercall(xch, &hypercall); - hcall_buf_release(xch, (void **)&op, nr_ops*sizeof(*op)); + xc_hypercall_bounce_post(xch, op); out1: return ret; @@ -367,23 +368,24 @@ static int flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu) { int err = 0; DECLARE_HYPERCALL; + DECLARE_NAMED_HYPERCALL_BOUNCE(updates, mmu->updates, mmu->idx*sizeof(*mmu->updates), XC_HYPERCALL_BUFFER_BOUNCE_BOTH); if ( mmu->idx == 0 ) return 0; - hypercall.op = __HYPERVISOR_mmu_update; - hypercall.arg[0] = (unsigned long)mmu->updates; - hypercall.arg[1] = (unsigned long)mmu->idx; - hypercall.arg[2] = 0; - hypercall.arg[3] = mmu->subject; - - if ( lock_pages(xch, mmu->updates, sizeof(mmu->updates)) != 0 ) + if ( xc_hypercall_bounce_pre(xch, updates) ) { - PERROR("flush_mmu_updates: mmu updates lock_pages failed"); + PERROR("flush_mmu_updates: bounce buffer failed"); err = 1; goto out; } + hypercall.op = __HYPERVISOR_mmu_update; + hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(updates); + hypercall.arg[1] = (unsigned long)mmu->idx; + hypercall.arg[2] = 0; + hypercall.arg[3] = mmu->subject; + if ( do_xen_hypercall(xch, &hypercall) < 0 ) { ERROR("Failure when submitting mmu updates"); @@ -392,7 +394,7 @@ static int flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu) mmu->idx = 0; - unlock_pages(xch, mmu->updates, sizeof(mmu->updates)); + xc_hypercall_bounce_post(xch, updates); out: return err; |