From: Tim Deegan Subject: Re: [PATCH 2/4] fix XENMEM_add_to_physmap preemption handling Date: Wed, 18 Dec 2013 17:04:44 +0100 Message-ID: <20131218160444.GL24792@deinos.phlegethon.org> References: <52B1BF76020000780010EC02@nat28.tlf.novell.com> <52B1C0AB020000780010EC23@nat28.tlf.novell.com> <20131218154854.GJ24792@deinos.phlegethon.org> <52B1D551020000780010EDF8@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VtJcB-0006VZ-4s for xen-devel@lists.xenproject.org; Wed, 18 Dec 2013 16:04:51 +0000 Content-Disposition: inline In-Reply-To: <52B1D551020000780010EDF8@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:03 +0000 on 18 Dec (1387378993), Jan Beulich wrote: > >>> On 18.12.13 at 16:48, Tim Deegan wrote: > > At 14:35 +0000 on 18 Dec (1387373707), Jan Beulich wrote: > >> Just like for all other hypercalls we shouldn't be modifying the input > >> structure - all of the fields are, even if not explicitly documented, > >> just inputs. > >> > >> Signed-off-by: Jan Beulich > > > >> @@ -543,22 +543,32 @@ static long memory_exchange(XEN_GUEST_HA > >> } > >> > >> static int xenmem_add_to_physmap(struct domain *d, > >> - struct xen_add_to_physmap *xatp) > >> + struct xen_add_to_physmap *xatp, > >> + unsigned int start) > >> { > >> - struct xen_add_to_physmap start_xatp; > >> - int rc = 0; > >> + unsigned int done = 0; > >> + long rc = 0; > >> > >> if ( xatp->space != XENMAPSPACE_gmfn_range ) > >> + { > >> + ASSERT(!start); > > > > I don't think you've enforced this in the caller; you only check that > > the guest hasn't supplied an over-sized start-extent. I think it's > > fine just to ignore start for singleton operations anyway. > > Right, if at all I should be returning an error here. But that should > perhaps either done uniformly at once for all mem ops, or not at > all. > > I'll just drop that change - makes the patch smaller :-) Grand so. :) With that dropped, 1/4 and 2/4 are Reviewed-by: Tim Deegan