From: "Jan Beulich" Subject: Re: [PATCH 5/7] mm: New XENMEM space, XENMAPSPACE_gmfn_range Date: Fri, 11 Nov 2011 08:09:33 +0000 Message-ID: <4EBCE64D020000780006059C@nat28.tlf.novell.com> References: <4EBBD5F602000078000602EE@nat28.tlf.novell.com> <20111110173720.GA29605@spongy.cam.xci-test.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20111110173720.GA29605@spongy.cam.xci-test.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jean.Guyader@citrix.com, Jean Guyader Cc: George Dunlap , "Keir (Xen.org)" , "xen-devel@lists.xensource.com" , "allen.m.kay@intel.com" , "Tim(Xen.org)" List-Id: xen-devel@lists.xenproject.org >>> On 10.11.11 at 18:37, Jean Guyader wrote: > On 10/11 12:47, Jan Beulich wrote: >> >>> On 10.11.11 at 12:35, Jean Guyader = wrote: >> >@@ -4716,6 +4748,17 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE(voi= d)=20 > arg) >> > } >> >=20 >> > rc =3D xenmem_add_to_physmap(d, &xatp); >> >+ if ( rc =3D=3D -EAGAIN ) >>=20 >> if ( rc ) >>=20 >> >+ { >> >+ if ( copy_to_guest(arg, &xatp, 1) ) >> >+ { >> >+ rcu_unlock_domain(d); >> >+ return -EFAULT; >> >+ } >>=20 >> } >> if ( rc =3D=3D -EAGAIN ) >>=20 >> (with some room for further simplification). Without that (or the = minimal >> alternative of copying back just .size or yet some other mechanism), as >> pointed out before, the caller won't have a way to know how far into >> the batch things succeeded. >>=20 >=20 > In xenmem_add_to_physmap I modify xatp in place so when I exit this > function xatp will contain the updated value (new start value in > .gpfn and .idx, how far do I need to go in .size). >=20 > The idea here was to call the copy_to_guest only when we got preempted. > If I copy xatp back to the guest I should get the updated value > in xatp from the copy_from_guest when I'll be called by the continuation.= I understand the continuation aspect. But you appear to have not read my comments completely: I'm asking how your caller, in the event of failure, would know how much of the batch was processed successfully. Jan