From: "Jan Beulich" Subject: Re: [PATCH v2 3/4] xen/arm: introduce GNTTABOP_cache_flush Date: Mon, 06 Oct 2014 09:49:50 +0100 Message-ID: <543273CE020000780003C5A5@mail.emea.novell.com> References: <1412347845-27755-3-git-send-email-stefano.stabellini@eu.citrix.com> <542EBDE1.2000702@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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: Andrew Cooper , Stefano Stabellini Cc: julien.grall@citrix.com, xen-devel@lists.xensource.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 03.10.14 at 18:33, wrote: > On Fri, 3 Oct 2014, Andrew Cooper wrote: >> On 03/10/14 15:50, Stefano Stabellini wrote: >> > + } >> > + >> > + spin_lock(&owner->grant_table->lock); >> >> Is this safe without taking the paging lock and doing a dying check on >> 'owner' ? > > In gnttab_release_mappings we do take the grant_table lock before > releasing any entries so it seems to me that it should be sufficient. Now did you check at all when gnttab_release_mappings() gets called? Only ever on a dying domain (there's even a BUG_ON() to that effect at the start of the function). Yet here you want to avoid dying domains, i.e. your point of reference would rather be gnttab_transfer(). That said, since you take a reference to the page, I don't think you need to pay attention to whether the page owner is dying. Jan