From: Tim Deegan Subject: Re: [PATCH 2/4] fix XENMEM_add_to_physmap preemption handling Date: Wed, 18 Dec 2013 16:48:54 +0100 Message-ID: <20131218154854.GJ24792@deinos.phlegethon.org> References: <52B1BF76020000780010EC02@nat28.tlf.novell.com> <52B1C0AB020000780010EC23@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 1VtJMn-0004Gv-ED for xen-devel@lists.xenproject.org; Wed, 18 Dec 2013 15:48:57 +0000 Content-Disposition: inline In-Reply-To: <52B1C0AB020000780010EC23@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 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. Cheers, Tim.