From: Wei Liu Subject: Re: Question on grant copying a previous grant mapped page Date: Wed, 29 Feb 2012 10:49:38 +0000 Message-ID: <1330512578.10387.36.camel@leeds.uk.xensource.com> References: <1330511786.10387.32.camel@leeds.uk.xensource.com> <291EDFCB1E9E224A99088639C4762022C8115F63F7@LONPMAILBOX01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <291EDFCB1E9E224A99088639C4762022C8115F63F7@LONPMAILBOX01.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Paul Durrant Cc: "Keir (Xen.org)" , xen-devel , wei.liu2@citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, 2012-02-29 at 10:39 +0000, Paul Durrant wrote: > That sounds like a basic bug in gnttab2 and it also sounds very similar to something I thought I already fixed. > > Paul You mean this one? changeset: 22994:299ed79acecf user: Keir Fraser date: Tue Mar 08 16:30:30 2011 +0000 files: xen/common/grant_table.c xen/include/xen/grant_table.h description: Fix rcu domain locking for transitive grants When acquiring a transitive grant for copy then the owning domain needs to be locked down as well as the granting domain. This was being done, but the unlocking was not. The acquire code now stores the struct domain * of the owning domain (rather than the domid) in the active entry in the granting domain. The release code then does the unlock on the owning domain. Note that I believe I also fixed a bug where, for non-transitive grants the active entry contained a reference to the acquiring domain rather than the granting domain. From my reading of the code this would stop the release code for transitive grants from terminating its recursion correctly. Signed-off-by: Paul Durrant This is the non-transitive case, but active entry contains no reference to any domain. Wei.