From: "Jan Beulich" Subject: Re: Xen-unstable-staging: Xen BUG at iommu_map.c:455 Date: Tue, 05 May 2015 16:10:06 +0100 Message-ID: <5548F96E0200007800076C7F@mail.emea.novell.com> References: <55294CA8.2070208@citrix.com> <55294DF9.9040207@citrix.com> <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> 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 1YpeU6-0007ug-3g for xen-devel@lists.xenproject.org; Tue, 05 May 2015 15:10:10 +0000 In-Reply-To: <20150416092830.GD13443@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 16.04.15 at 11:28, wrote: > At 22:35 +0100 on 11 Apr (1428791713), Andrew Cooper wrote: >> I am not certain that it is the correct way to fix the issue, nor that >> the ioreq server code is the only way to trigger it. There are several >> ways to shoot a gfn mapping from the guests physmap. >> >> At least we now understand why it happens. I will defer to others CC'd >> on this thread for their opinions in the matter. > > The patch semes like a pretty good check to me, though I'm not > convinced it's race-free. At the least I'd cache the m2p lookup so we > use the same value for the checks and the map_page() call. Did you have a chance to look at the patch Sander meanwhile successfully tested [1]? I'm trying to understand where you see possible races here, and hence whether anything else needs to be done to that patch before formally submitting it. 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. Thanks, Jan [1] http://lists.xenproject.org/archives/html/xen-devel/2015-04/msg02253.html > And IMO update_paging_mode() ought to log and reject bogus GFNs as > well. > > Cheers, > > Tim.