diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-12-10 11:18:25 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-12-10 11:18:25 +0100 |
commit | e93e0d9d73ce77bd1f3471af68a194b47e0e8c45 (patch) | |
tree | be7768d89381228bc3ed5f4867db23f631a78054 /xen/arch/x86/mm.c | |
parent | edaa3f893f8f046e05099bc0d087b276a90451d4 (diff) | |
download | xen-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/arch/x86/mm.c')
-rw-r--r-- | xen/arch/x86/mm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index e2b74be6d4..3657b258cd 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -4407,7 +4407,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg) if ( xatp.space == XENMAPSPACE_gmfn_range ) { - if ( rc && copy_to_guest(arg, &xatp, 1) ) + if ( rc && __copy_to_guest(arg, &xatp, 1) ) rc = -EFAULT; if ( rc == -EAGAIN ) @@ -4492,7 +4492,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg) map.nr_entries = min(map.nr_entries, d->arch.pv_domain.nr_e820); if ( copy_to_guest(map.buffer, d->arch.pv_domain.e820, map.nr_entries) || - copy_to_guest(arg, &map, 1) ) + __copy_to_guest(arg, &map, 1) ) { spin_unlock(&d->arch.pv_domain.e820_lock); return -EFAULT; @@ -4559,7 +4559,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg) ctxt.map.nr_entries = ctxt.n; - if ( copy_to_guest(arg, &ctxt.map, 1) ) + if ( __copy_to_guest(arg, &ctxt.map, 1) ) return -EFAULT; return 0; @@ -4630,7 +4630,7 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg) target.pod_cache_pages = p2m->pod.count; target.pod_entries = p2m->pod.entry_count; - if ( copy_to_guest(arg, &target, 1) ) + if ( __copy_to_guest(arg, &target, 1) ) { rc= -EFAULT; goto pod_target_out_unlock; |