aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/memory.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-12-10 11:18:25 +0100
committerJan Beulich <jbeulich@suse.com>2012-12-10 11:18:25 +0100
commite93e0d9d73ce77bd1f3471af68a194b47e0e8c45 (patch)
treebe7768d89381228bc3ed5f4867db23f631a78054 /xen/common/memory.c
parentedaa3f893f8f046e05099bc0d087b276a90451d4 (diff)
downloadxen-e93e0d9d73ce77bd1f3471af68a194b47e0e8c45.tar.gz
xen-e93e0d9d73ce77bd1f3471af68a194b47e0e8c45.tar.bz2
xen-e93e0d9d73ce77bd1f3471af68a194b47e0e8c45.zip
streamline guest copy operations
- use the variants not validating the VA range when writing back structures/fields to the same space that they were previously read from - when only a single field of a structure actually changed, copy back just that field where possible - consolidate copying back results in a few places Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/memory.c')
-rw-r--r--xen/common/memory.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xen/common/memory.c b/xen/common/memory.c
index b7fdd77c0f..c8541c4f9e 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -359,7 +359,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
{
exch.nr_exchanged = i << in_chunk_order;
rcu_unlock_domain(d);
- if ( copy_field_to_guest(arg, &exch, nr_exchanged) )
+ if ( __copy_field_to_guest(arg, &exch, nr_exchanged) )
return -EFAULT;
return hypercall_create_continuation(
__HYPERVISOR_memory_op, "lh", XENMEM_exchange, arg);
@@ -500,7 +500,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
}
exch.nr_exchanged = exch.in.nr_extents;
- if ( copy_field_to_guest(arg, &exch, nr_exchanged) )
+ if ( __copy_field_to_guest(arg, &exch, nr_exchanged) )
rc = -EFAULT;
rcu_unlock_domain(d);
return rc;
@@ -527,7 +527,7 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
exch.nr_exchanged = i << in_chunk_order;
fail_early:
- if ( copy_field_to_guest(arg, &exch, nr_exchanged) )
+ if ( __copy_field_to_guest(arg, &exch, nr_exchanged) )
rc = -EFAULT;
return rc;
}