From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757851Ab3BGCk4 (ORCPT ); Wed, 6 Feb 2013 21:40:56 -0500 Received: from g6t0185.atlanta.hp.com ([15.193.32.62]:46464 "EHLO g6t0185.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754094Ab3BGCky (ORCPT ); Wed, 6 Feb 2013 21:40:54 -0500 Message-ID: <1360204850.2615.10.camel@lorien2> Subject: Re: IO_PAGE_FAULTs on unity mapped regions during amd_iommu_init() in Linux 3.4 From: Shuah Khan Reply-To: shuah.khan@hp.com To: Joerg Roedel Cc: LKML , stable , iommu@lists.linux-foundation.org, Greg KH , shuahkhan@gmail.com Date: Wed, 06 Feb 2013 19:40:50 -0700 In-Reply-To: <20130206121223.GT25591@8bytes.org> References: <1359657210.6061.3.camel@lorien2> <20130201130035.GE25591@8bytes.org> <1359743519.2759.38.camel@lorien2> <20130205133104.GC2532@8bytes.org> <20130206121223.GT25591@8bytes.org> Organization: ISS-Linux Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2013-02-06 at 13:12 +0100, Joerg Roedel wrote: > On Tue, Feb 05, 2013 at 06:57:21AM -0700, Shuah Khan wrote: > > Thanks much. I will hang on to this test system for testing your fix. > > Okay, here is the simple fix for v3.8-rc6. I guess it is not > straighforward to port it to v3.4, but it should be doable. > > From 2ecf57c85e67e0243b36b787d0490c0b47202ba8 Mon Sep 17 00:00:00 2001 > From: Joerg Roedel > Date: Wed, 6 Feb 2013 12:55:23 +0100 > Subject: [PATCH] iommu/amd: Initialize device table after dma_ops > > When dma_ops are initialized the unity mappings are > created. The init_device_table_dma() function makes sure DMA > from all devices is blocked by default. This opens a short > window in time where DMA to unity mapped regions is blocked > by the IOMMU. Make sure this does not happen by initializing > the device table after dma_ops. > > Signed-off-by: Joerg Roedel Joerg, I tested your patch on 3.8. I was able to reproduce the problem and then apply your patch to verify that the problem is fixed. This patch applies cleanly to 3.7.6, however I could not reproduce the problem on 3.7.6 without the patch. But the window exists on 3.7 as well. Your patch can be applied to 3.7.6 as is. I back-ported the patch to 3.4 and 3.0 and tested. I am sending those patches after this email. On 3.4.29 and 3.0.62 I was able to reproduce the problem and then applied the back-ported patch to verify that the problem is fixed. Thanks again for the fix. -- Shuah