From: Joerg Roedel <joerg.roedel@amd.com>
To: Ingo Molnar <mingo@redhat.com>
Cc: x86@kernel.org, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, Chris Wright <chrisw@sous-sol.org>,
stable@kernel.org, Neil Horman <nhorman@tuxdriver.com>,
Vivek Goyal <vgoyal@redhat.com>,
Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 06/12] x86/amd-iommu: enable iommu before attaching devices
Date: Wed, 7 Apr 2010 14:46:43 +0200 [thread overview]
Message-ID: <1270644409-10123-7-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1270644409-10123-1-git-send-email-joerg.roedel@amd.com>
From: Chris Wright <chrisw@sous-sol.org>
Hit another kdump problem as reported by Neil Horman. When initializaing
the IOMMU, we attach devices to their domains before the IOMMU is
fully (re)initialized. Attaching a device will issue some important
invalidations. In the context of the newly kexec'd kdump kernel, the
IOMMU may have stale cached data from the original kernel. Because we
do the attach too early, the invalidation commands are placed in the new
command buffer before the IOMMU is updated w/ that buffer. This leaves
the stale entries in the kdump context and can renders device unusable.
Simply enable the IOMMU before we do the attach.
Cc: stable@kernel.org
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
arch/x86/kernel/amd_iommu_init.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index feaf471..8975965 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -1304,6 +1304,8 @@ static int __init amd_iommu_init(void)
if (ret)
goto free;
+ enable_iommus();
+
if (iommu_pass_through)
ret = amd_iommu_init_passthrough();
else
@@ -1316,8 +1318,6 @@ static int __init amd_iommu_init(void)
amd_iommu_init_notifier();
- enable_iommus();
-
if (iommu_pass_through)
goto out;
@@ -1331,6 +1331,7 @@ out:
return ret;
free:
+ disable_iommus();
amd_iommu_uninit_devices();
--
1.7.0.4
next prev parent reply other threads:[~2010-04-07 12:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-07 12:46 [GIT PULL][PATCH 0/12] IOMMU fixes for 2.6.34-rc3 Joerg Roedel
2010-04-07 12:46 ` [PATCH 01/12] x86/amd-iommu: Remove double NULL check in check_device Joerg Roedel
2010-04-07 12:46 ` [PATCH 02/12] x86/amd-iommu: Protect IOMMU-API map/unmap path Joerg Roedel
2010-04-07 12:46 ` [PATCH 03/12] x86/amd-iommu: Pt mode fix for domain_destroy Joerg Roedel
2010-04-07 12:46 ` [PATCH 04/12] x86/amd-iommu: Report errors in acpi parsing functions upstream Joerg Roedel
2010-04-07 12:46 ` [PATCH 05/12] x86/amd-iommu: Use helper function to destroy domain Joerg Roedel
2010-04-07 12:46 ` Joerg Roedel [this message]
2010-04-07 12:46 ` [PATCH 07/12] x86/amd-iommu: warn when issuing command to uninitialized cmd buffer Joerg Roedel
2010-04-07 12:46 ` [PATCH 08/12] Revert "x86: disable IOMMUs on kernel crash" Joerg Roedel
2010-04-07 12:46 ` [PATCH 09/12] x86/amd-iommu: use for_each_pci_dev Joerg Roedel
2010-04-07 12:46 ` [PATCH 10/12] x86/amd-iommu: Remove obsolete parameter documentation Joerg Roedel
2010-04-07 12:46 ` [PATCH 11/12] dma-debug: Cleanup for copy-loop in filter_write() Joerg Roedel
2010-04-07 12:46 ` [PATCH 12/12] x86/gart: Disable GART explicitly before initialization Joerg Roedel
2010-04-13 11:25 ` [GIT PULL][PATCH 0/12] IOMMU fixes for 2.6.34-rc3 Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1270644409-10123-7-git-send-email-joerg.roedel@amd.com \
--to=joerg.roedel@amd.com \
--cc=chrisw@sous-sol.org \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nhorman@tuxdriver.com \
--cc=stable@kernel.org \
--cc=vgoyal@redhat.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®