From: "Jan Beulich" Subject: Re: Xen-unstable-staging: Xen BUG at iommu_map.c:455 Date: Tue, 05 May 2015 16:31:38 +0100 Message-ID: <5548FE7A0200007800076CD3@mail.emea.novell.com> References: <1189087521.20150411192519@eikelenboom.it> <55295B7D.4020107@citrix.com> <4810067032.20150411194249@eikelenboom.it> <55296730.30802@citrix.com> <1468678653.20150411213342@eikelenboom.it> <55298278.2080406@citrix.com> <1698372572.20150411230533@eikelenboom.it> <55299391.4030900@citrix.com> <20150416092830.GD13443@deinos.phlegethon.org> <5548F96E0200007800076C7F@mail.emea.novell.com> <20150505151711.GC31485@deinos.phlegethon.org> 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 1Ypeow-0001BN-Tv for xen-devel@lists.xenproject.org; Tue, 05 May 2015 15:31:43 +0000 In-Reply-To: <20150505151711.GC31485@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: Andrew Cooper , Paul Durrant , xen-devel , Sander Eikelenboom List-Id: xen-devel@lists.xenproject.org >>> On 05.05.15 at 17:17, wrote: > At 16:10 +0100 on 05 May (1430842206), Jan Beulich wrote: >> From what I >> can tell (and assuming other code works correctly) the fact that >> arch_iommu_populate_page_table() sets d->need_iommu to -1 >> first thing should make sure that any subsequent changes to the >> p2m get propagated to IOMMU code for setting up respective >> mappings. > > Yes, but might they then be overridden by the previous mapping when > this new code calls map_page()? Ah, I see now. > This seems like a case where we should be using get_gfn()/put_gfn(). Yes - provided these may be called at all with the page_alloc_lock held. IOW - is there lock ordering defined between this one and the various mm locks? Also, if doing so, would I then need to check the result of the inverse (p2m) translation after having done get_gfn() to make sure this is still the MFN I'm after? If so, and if it ends up being a different one, I'd have to retry and presumably somehow limit the number of retries... Jan