Re: [PATCH 1/2] x86/amd-iommu: enable iommu before attaching devices

2010-04-02 Thread Joerg Roedel
On Thu, Apr 01, 2010 at 06:23:53PM -0700, Chris Wright wrote: 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

Re: [PATCH 1/2] x86/amd-iommu: enable iommu before attaching devices

2010-04-02 Thread Vivek Goyal
On Thu, Apr 01, 2010 at 06:23:53PM -0700, Chris Wright wrote: 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

Re: [PATCH 1/2] x86/amd-iommu: enable iommu before attaching devices

2010-04-02 Thread Chris Wright
* Vivek Goyal (vgo...@redhat.com) wrote: Following is just for my education purposes. Trying to understand better the impact of in-flight DMAs. So IIUC, in kudmp context following seems to be sequence of events. 1. kernel crashes, we leave IOMMU enabled. No, we actually disable the IOMMU

Re: [PATCH 1/2] x86/amd-iommu: enable iommu before attaching devices

2010-04-02 Thread Eric W. Biederman
Chris Wright chr...@sous-sol.org writes: * Vivek Goyal (vgo...@redhat.com) wrote: Following is just for my education purposes. Trying to understand better the impact of in-flight DMAs. So IIUC, in kudmp context following seems to be sequence of events. 1. kernel crashes, we leave IOMMU

Re: [PATCH 1/2] x86/amd-iommu: enable iommu before attaching devices

2010-04-02 Thread Chris Wright
* Joerg Roedel (j...@8bytes.org) wrote: Ok, good to know this fixes the problem. One issue: If the initialization of the domains fails the iommu hardware needs to be disabled again in the free path. Sure, thanks for catching. Will resend shortly thanks, -chris

[PATCH 0/4] AMD IOMMU kdump fix plus cleanups (v2)

2010-04-02 Thread Chris Wright
Series includes the following patches: x86/amd-iommu: enable iommu before attaching devices x86/amd-iommu: warn when issuing command to uninitialized cmd buffer Revert x86: disable IOMMUs on kernel crash x86/amd-iommu: use for_each_pci_dev First one is the primary bug fix. v2 - add

[PATCH 4/4] x86/amd-iommu: use for_each_pci_dev

2010-04-02 Thread Chris Wright
Replace open coded version with for_each_pci_dev Signed-off-by: Chris Wright chr...@sous-sol.org --- arch/x86/kernel/amd_iommu.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c @@ -2187,7 +2187,7 @@ static void

[PATCH 2/4] x86/amd-iommu: warn when issuing command to uninitialized cmd buffer

2010-04-02 Thread Chris Wright
To catch future potential issues we can add a warning whenever we issue a command before the command buffer is fully initialized. Signed-off-by: Chris Wright chr...@sous-sol.org --- Or not...this is just if you think it's useful ;-) arch/x86/include/asm/amd_iommu_types.h |1 +

[PATCH 3/4] Revert x86: disable IOMMUs on kernel crash

2010-04-02 Thread Chris Wright
This effectively reverts commit 61d047be99757fd9b0af900d7abce9a13a337488. Disabling the IOMMU can potetially allow DMA transactions to complete without being translated. Leave it enabled, and allow crash kernel to do the IOMMU reinitialization properly. Cc: Joerg Roedel joerg.roe...@amd.com Cc: