From: Tim Deegan Subject: Re: [PATCH 3/4] move XENMEM_add_to_physmap_range handling framework to common code Date: Wed, 18 Dec 2013 17:14:07 +0100 Message-ID: <20131218161407.GM24792@deinos.phlegethon.org> References: <52B1BF76020000780010EC02@nat28.tlf.novell.com> <52B1C0C9020000780010EC27@nat28.tlf.novell.com> <20131218155955.GK24792@deinos.phlegethon.org> <52B1D69C020000780010EE13@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VtJlG-0007fT-4N for xen-devel@lists.xenproject.org; Wed, 18 Dec 2013 16:14:14 +0000 Content-Disposition: inline In-Reply-To: <52B1D69C020000780010EE13@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , Keir Fraser , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org At 16:08 +0000 on 18 Dec (1387379324), Jan Beulich wrote: > >>> On 18.12.13 at 16:59, Tim Deegan wrote: > > At 14:35 +0000 on 18 Dec (1387373737), Jan Beulich wrote: > >> There's really nothing really architecture specific here; the > >> architecture specific handling is limited to > >> xenmem_add_to_physmap_one(). > >> > >> Note the restriction of XENMAPSPACE_gmfn_range only being supported > >> through XENMEM_add_to_physmap is being dropped as being pointless. > > > > Hmmm. With that restriction removed, this: > > > >> + rc = xenmem_add_to_physmap_one(d, xatpr->space, > >> + xatpr->foreign_domid, > >> + idx, gpfn); > >> + > >> + if ( unlikely(__copy_to_guest_offset(xatpr->errs, 0, &rc, 1)) ) > >> + { > >> + rc = -EFAULT; > >> + goto out; > >> + } > >> + > >> + guest_handle_add_offset(xatpr->idxs, 1); > >> + guest_handle_add_offset(xatpr->gpfns, 1); > >> + guest_handle_add_offset(xatpr->errs, 1); > >> + xatpr->size--; > >> + > >> + /* Check for continuation if it's not the last interation. */ > >> + if ( xatpr->size > 0 && hypercall_preempt_check() ) > >> + { > >> + rc = -EAGAIN; > >> + goto out; > >> + } > > > > will save the partial result of a preempted XENMAPSPACE_gmfn_range > > sub-op into the errors array, and then the whole operation may or may > > not return -EAGAIN. > > > > I guess the caller now has enough information to figure out what > > happened and restart, but given that the rest of this interface nicely > > hides preemption from the caller, it's a bit of an ugly corner case. > > I'm afraid I don't follow: XENMAPSPACE_gmfn_range and > XENMAPSPACE_gmfn will be treated equally now - there simply > is no range being specified for the individual > add_to_physmap_range elements. Oh of course. Then it's just a slightly odd API, but I guess no odder this way than before, and with slightly less code. :) So Reviewed-by: Tim Deegan for 3/4 and 4/4 as they stand. Cheers, Tim.