From: "Jan Beulich" Subject: Re: [PATCH 2/4] fix XENMEM_add_to_physmap preemption handling Date: Wed, 18 Dec 2013 16:03:13 +0000 Message-ID: <52B1D551020000780010EDF8@nat28.tlf.novell.com> References: <52B1BF76020000780010EC02@nat28.tlf.novell.com> <52B1C0AB020000780010EC23@nat28.tlf.novell.com> <20131218154854.GJ24792@deinos.phlegethon.org> 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 1VtJac-00067T-BW for xen-devel@lists.xenproject.org; Wed, 18 Dec 2013 16:03:14 +0000 In-Reply-To: <20131218154854.GJ24792@deinos.phlegethon.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: xen-devel , Keir Fraser , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org >>> 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 :-) Jan