From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH for-4.6] xen/mm: populate_physmap: validate correctly the gfn for direct mapped domain Date: Thu, 13 Aug 2015 11:41:43 +0100 Message-ID: <1439462503.23981.81.camel@citrix.com> References: <1439314888-24813-1-git-send-email-julien.grall@citrix.com> <1439458426.23981.37.camel@citrix.com> <55CC8580020000780009A90A@prv-mh.provo.novell.com> <1439460884.23981.59.camel@citrix.com> <55CC8DC5020000780009A9D6@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZPpxE-0006uV-5u for xen-devel@lists.xenproject.org; Thu, 13 Aug 2015 10:41:48 +0000 In-Reply-To: <55CC8DC5020000780009A9D6@prv-mh.provo.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: Wei.Liu2@citrix.com, Tim Deegan , Ian Jackson , Julien Grall , stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org, Keir Fraser List-Id: xen-devel@lists.xenproject.org On Thu, 2015-08-13 at 04:29 -0600, Jan Beulich wrote: > > > > > > On 13.08.15 at 12:14, wrote: > > There isn't a race here is there? What if the reference were dropped > > after > > this check but before the guest_physmap_add_page (which takes new > > references)? We are implicitly relying on a guarantee made elsewhere > > that a > > direct mapped guest never drops the final ref until it is destroyed > > (which > > can't be happening in this window I think), but it would be obviously > > safer > > against such bugs if we just held the ref until after the p2m was > > updated. > > Yeah, we depend on this, and what you suggest would indeed be > an improvment. > > > Another thing for a future/4.7 cleanup I guess. > > Right. > > But as bottom line I take it that your objections to the patch going in > soon have been eliminated? Correct. Acked-by: Ian Campbell