Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-17 Thread Takao Indoh
(2013/04/15 19:18), Joerg Roedel wrote: > On Mon, Apr 15, 2013 at 06:00:13PM +0900, Takao Indoh wrote: >> On DMAR initialization during kdump boot, do you guys agree to change >> order like this? >> >> Current order: >> (1) Disable translation >> (2) PCI initialization >> (3) Make pgtable and enabl

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-15 Thread Joerg Roedel
On Mon, Apr 15, 2013 at 06:00:13PM +0900, Takao Indoh wrote: > On DMAR initialization during kdump boot, do you guys agree to change > order like this? > > Current order: > (1) Disable translation > (2) PCI initialization > (3) Make pgtable and enable translation. > > Order I'm proposing: > (1) P

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-15 Thread Takao Indoh
(2013/04/10 13:47), Takao Indoh wrote: > (2013/04/05 20:06), Joerg Roedel wrote: >> On Wed, Apr 03, 2013 at 09:24:39AM +0100, David Woodhouse wrote: >>> On Wed, 2013-04-03 at 16:11 +0900, Takao Indoh wrote: Yeah, you are right. I forgot such a case. >>> >>> If you disable translation and there

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-09 Thread Takao Indoh
(2013/04/05 20:06), Joerg Roedel wrote: > On Wed, Apr 03, 2013 at 09:24:39AM +0100, David Woodhouse wrote: >> On Wed, 2013-04-03 at 16:11 +0900, Takao Indoh wrote: >>> Yeah, you are right. I forgot such a case. >> >> If you disable translation and there's some device still doing DMA, it's >> going

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-08 Thread Takao Indoh
(2013/04/04 23:24), David Woodhouse wrote: > On Thu, 2013-04-04 at 14:48 +0900, Takao Indoh wrote: >> >> - DMAR fault messages floods and second kernel does not boot. Recently I >>saw similar report. https://lkml.org/lkml/2013/3/8/120 > > Right. So the fix for that is to make the subsequent er

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-05 Thread Joerg Roedel
On Wed, Apr 03, 2013 at 09:24:39AM +0100, David Woodhouse wrote: > On Wed, 2013-04-03 at 16:11 +0900, Takao Indoh wrote: > > Yeah, you are right. I forgot such a case. > > If you disable translation and there's some device still doing DMA, it's > going to scribble over random areas of memory. You

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-04 Thread David Woodhouse
On Thu, 2013-04-04 at 14:48 +0900, Takao Indoh wrote: > > - DMAR fault messages floods and second kernel does not boot. Recently I > saw similar report. https://lkml.org/lkml/2013/3/8/120 Right. So the fix for that is to make the subsequent errors silent, until/unless we actually get a request

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-03 Thread Takao Indoh
(2013/04/03 17:24), David Woodhouse wrote: > On Wed, 2013-04-03 at 16:11 +0900, Takao Indoh wrote: >> (2013/04/02 23:05), Joerg Roedel wrote: >>> On Mon, Apr 01, 2013 at 02:45:18PM +0900, Takao Indoh wrote: enable_IR intel_enable_irq_remapping iommu_disable_irq_remapp

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-03 Thread David Woodhouse
On Wed, 2013-04-03 at 16:11 +0900, Takao Indoh wrote: > (2013/04/02 23:05), Joerg Roedel wrote: > > On Mon, Apr 01, 2013 at 02:45:18PM +0900, Takao Indoh wrote: > >> > >> enable_IR > >>intel_enable_irq_remapping > >> iommu_disable_irq_remapping <== IRES/QIES/TES disabled here > >> d

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-03 Thread Takao Indoh
(2013/04/02 23:05), Joerg Roedel wrote: > On Mon, Apr 01, 2013 at 02:45:18PM +0900, Takao Indoh wrote: >> >> enable_IR >>intel_enable_irq_remapping >> iommu_disable_irq_remapping <== IRES/QIES/TES disabled here >> dmar_disable_qi <== do nothing >> dmar_enable_qi

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-04-02 Thread Joerg Roedel
On Mon, Apr 01, 2013 at 02:45:18PM +0900, Takao Indoh wrote: > > enable_IR > intel_enable_irq_remapping > iommu_disable_irq_remapping <== IRES/QIES/TES disabled here > dmar_disable_qi <== do nothing > dmar_enable_qi <== QIES enabled > intel_setup_irq_r

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-03-31 Thread Takao Indoh
(2013/03/27 19:31), Joerg Roedel wrote: > On Wed, Mar 27, 2013 at 02:02:44PM +0900, Takao Indoh wrote: >> The root cause of this problem is mismatch between iommu->gcmd and >> global command register in the case of kdump. At boot time, initial >> value of iommu->gcmd is zero as I wrote above, but a

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-03-27 Thread Joerg Roedel
On Wed, Mar 27, 2013 at 02:02:44PM +0900, Takao Indoh wrote: > The root cause of this problem is mismatch between iommu->gcmd and > global command register in the case of kdump. At boot time, initial > value of iommu->gcmd is zero as I wrote above, but actual global command > register is *not* zero

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-03-26 Thread Takao Indoh
(2013/03/26 23:46), Joerg Roedel wrote: > On Thu, Mar 21, 2013 at 10:32:36AM +0900, Takao Indoh wrote: >> In this function, clearing IRE bit in iommu->gcmd and writing it to >> global command register. But initial value of iommu->gcmd is zero, so >> this writel means clearing all bits in global com

Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-03-26 Thread Joerg Roedel
On Thu, Mar 21, 2013 at 10:32:36AM +0900, Takao Indoh wrote: > In this function, clearing IRE bit in iommu->gcmd and writing it to > global command register. But initial value of iommu->gcmd is zero, so > this writel means clearing all bits in global command register. Seems weird. Why is the value

[PATCH] intel-iommu: Synchronize gcmd value with global command register

2013-03-20 Thread Takao Indoh
This patch synchronize iommu->gcmd value with global command register so that bits in the register could be handled correctly. iommu_disable_irq_remapping() should disable only IR(Interrupt Remapping), but in the case of kdump, it also disables QI(Queued Invalidation) and DMAR(DMA remapping) at th