>>> On 13.11.11 at 18:40, Jean Guyader <jean.guyader@xxxxxxxxxxxxx> wrote:
>@@ -4715,10 +4747,20 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
> return -EPERM;
> }
>
>- rc = xenmem_add_to_physmap(d, xatp);
>+ rc = xenmem_add_to_physmap(d, &xatp);
>
> rcu_unlock_domain(d);
>
>+ if ( rc )
I thought that we had agreed to do the copying back only for the new
space.
>+ {
>+ if ( copy_to_guest(arg, &xatp, 1) )
>+ return -EFAULT;
>+ }
Also, I personally would prefer avoiding unnecessary extra return
points (as they always bare the risk of being overlooked for
subsequent changes, and when they aren't, the resulting patches
usually are bigger and less readable). Here this is rather simple:
if ( rc && ... == XENMAPSPACE_gmfn_range &&
copy_to_guest(arg, &xatp, 1) )
rc = -EFAULT;
Jan
>+
>+ if ( rc == -EAGAIN )
>+ rc = hypercall_create_continuation(
>+ __HYPERVISOR_memory_op, "ih", op, arg);
>+
> return rc;
> }
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|