public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: Takao Indoh <indou.takao@jp.fujitsu.com>
To: joro@8bytes.org, dwmw2@infradead.org
Cc: iommu@lists.linux-foundation.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, tindoh@gmail.com
Subject: Re: [PATCH] intel-iommu: Synchronize gcmd value with global command register
Date: Mon, 15 Apr 2013 18:00:13 +0900	[thread overview]
Message-ID: <516BC19D.4090303@jp.fujitsu.com> (raw)
In-Reply-To: <5164EEE6.8000707@jp.fujitsu.com>

(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's some device still doing DMA, it's
>>> going to scribble over random areas of memory. You really want to have
>>> translation enabled and all the page tables *cleared*, during kexec. I
>>> think it's fair to insist that the secondary kernel should use the IOMMU
>>> if the first one did.
>>
>> Do we really need to insist on that? The IOMMU initialization on x86
>> happens after the kernel scanned and enumerated the PCI bus. While doing
>> this the kernel (at least it should) disables all devices it finds. So
>> when the IOMMU init code runs we should be safe from any in-flight DMA
>> and can either disable translation or re-initialize it for the kdump
>> kernel. Until then translation needs to stay enabled of course, so that
>> the old page-tables are still used and in-flight DMA doesn't corrupt
>> any data.
> 
> So we should do in this order, right?
> (1) PCI initialization. Stop all ongoing DMA here.
> (2) Disable translation if already enable.
> (3) Make pgtable and enable translation.

Joerg, David,

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) PCI initialization
(2) Disable translation
(3) Make pgtable and enable translation.

The purpose to change the behavior is to stop DMA in PCI layer.

As Joerg said, if we need to consider the case that kdump kernel is
compiled without dma-remapping(CONFIG_INTEL_IOMMU is off?), I can update
my patch to handle such a case properly by adding ifdef
CONFIG_INTEL_IOMMU.

About how to stop the DMA on PCI layer, I'll post another mail to
discuss it to iommu and pci list.

Thanks,
Takao Indoh


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2013-04-15  9:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21  1:32 [PATCH] intel-iommu: Synchronize gcmd value with global command register Takao Indoh
2013-03-26 14:46 ` Joerg Roedel
2013-03-27  5:02   ` Takao Indoh
2013-03-27 10:31     ` Joerg Roedel
2013-04-01  5:45       ` Takao Indoh
2013-04-02 14:05         ` Joerg Roedel
2013-04-03  7:11           ` Takao Indoh
2013-04-03  8:24             ` David Woodhouse
2013-04-04  5:48               ` Takao Indoh
2013-04-04 14:24                 ` David Woodhouse
2013-04-08  8:57                   ` Takao Indoh
2013-04-05 11:06               ` Joerg Roedel
2013-04-10  4:47                 ` Takao Indoh
2013-04-15  9:00                   ` Takao Indoh [this message]
2013-04-15 10:18                     ` Joerg Roedel
2013-04-17  8:48                       ` Takao Indoh

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=516BC19D.4090303@jp.fujitsu.com \
    --to=indou.takao@jp.fujitsu.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tindoh@gmail.com \
    /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