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/sysctl.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/sysctl.c')
-rw-r--r-- | xen/arch/x86/sysctl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index b84dd34007..8f1c4be8fc 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -93,7 +93,7 @@ long arch_do_sysctl( if ( iommu_enabled ) pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm_directio; - if ( copy_to_guest(u_sysctl, sysctl, 1) ) + if ( __copy_field_to_guest(u_sysctl, sysctl, u.physinfo) ) ret = -EFAULT; } break; @@ -133,7 +133,8 @@ long arch_do_sysctl( } } - ret = ((i <= max_cpu_index) || copy_to_guest(u_sysctl, sysctl, 1)) + ret = ((i <= max_cpu_index) || + __copy_field_to_guest(u_sysctl, sysctl, u.topologyinfo)) ? -EFAULT : 0; } break; @@ -185,7 +186,8 @@ long arch_do_sysctl( } } - ret = ((i <= max_node_index) || copy_to_guest(u_sysctl, sysctl, 1)) + ret = ((i <= max_node_index) || + __copy_field_to_guest(u_sysctl, sysctl, u.numainfo)) ? -EFAULT : 0; } break; |