public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wan Zongshun <vw@iommu.org>
To: Joerg Roedel <joro@8bytes.org>
Cc: iommu@lists.linux-foundation.org, Joerg Roedel <jroedel@suse.de>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] iommu/amd: Fix unity mapping initialization race
Date: Mon, 11 Jul 2016 17:25:29 +0800	[thread overview]
Message-ID: <57836609.5060406@iommu.org> (raw)
In-Reply-To: <20160711071959.GB12639@8bytes.org>



On 2016年07月11日 15:19, Joerg Roedel wrote:
> On Sun, Jul 10, 2016 at 07:40:53PM +0800, Wan Zongshun wrote:
>> Do you mean we need enable the V and TV bits to DTE entry after all
>> DTEs tables were initialized completely?
>
> Yes, this is what my patch does and what fixes the bug that was
> reported on machines which have unity-mapping entries.

Okay, this patch should also better to general case not only unity-mapping.

How about the interrupt remap function? Do we need same considering for 
IV bit enable for interrupt remap?

>
>> I checked this function 'init_device_table_dma', and find it just set
>> V and TV bit, to set translation info valid and DTE bits127:1 valid.
>
> Right, if no other bits are set this blocks all DMA from the gives
> device-id.

Sorry, why you still say this 'init_device_table_dma' can block DMA?
I just think this function will enable DMA transfer, since  we set the V 
and TV bits, right? or I misunderstand what "block DMA" mean?

>
>> So I just think all things it should to do are to allow DMA access,
>> GPA-to-SPA translation should be active, why you add function
>> comments below is to not allow DMA access and suppress all page
>> faults?
>>
>> /*
>>   * Init the device table to not allow DMA access for devices and
>>   * suppress all page faults
>>   */
>
> Yeah, that comment needs to be updated. Not all DMA is blocked and
> page-faults are not suppressed at all. Thanks for noticing.
>
>
>
> 	Joerg
>
>

  reply	other threads:[~2016-07-11  9:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 16:00 [PATCH] iommu/amd: Fix unity mapping initialization race Joerg Roedel
2016-07-10 11:40 ` Wan Zongshun
2016-07-11  7:19   ` Joerg Roedel
2016-07-11  9:25     ` Wan Zongshun [this message]
2016-07-11  9:39       ` Joerg Roedel
2016-07-11 10:05         ` Wan ZongShun

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=57836609.5060406@iommu.org \
    --to=vw@iommu.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.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