From: Joerg Roedel <joerg.roedel@amd.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: dwmw2@infradead.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, chrisw@sous-sol.org,
iommu@lists.linux-foundation.org
Subject: Re: [PATCH v2] intel-iommu: Default to non-coherent for domains unattached to iommus
Date: Tue, 18 Sep 2012 13:58:02 +0200 [thread overview]
Message-ID: <20120918115802.GJ2505@amd.com> (raw)
In-Reply-To: <20111112002421.10875.8307.stgit@bling.home>
On Fri, Nov 11, 2011 at 05:26:44PM -0700, Alex Williamson wrote:
> domain_update_iommu_coherency() currently defaults to setting domains
> as coherent when the domain is not attached to any iommus. This
> allows for a window in domain_context_mapping_one() where such a
> domain can update context entries non-coherently, and only after
> update the domain capability to clear iommu_coherency.
>
> This can be seen using KVM device assignment on VT-d systems that
> do not support coherency in the ecap register. When a device is
> added to a guest, a domain is created (iommu_coherency = 0), the
> device is attached, and ranges are mapped. If we then hot unplug
> the device, the coherency is updated and set to the default (1)
> since no iommus are attached to the domain. A subsequent attach
> of a device makes use of the same dmar domain (now marked coherent)
> updates context entries with coherency enabled, and only disables
> coherency as the last step in the process.
>
> To fix this, switch domain_update_iommu_coherency() to use the
> safer, non-coherent default for domains not attached to iommus.
>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> Tested-by: Donald Dutile <ddutile@redhat.com>
> Acked-by: Donald Dutile <ddutile@redhat.com>
> Acked-by: Chris Wright <chrisw@sous-sol.org>
Applied, thanks.
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joerg.roedel@amd.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: <dwmw2@infradead.org>, <linux-pci@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <chrisw@sous-sol.org>,
<iommu@lists.linux-foundation.org>
Subject: Re: [PATCH v2] intel-iommu: Default to non-coherent for domains unattached to iommus
Date: Tue, 18 Sep 2012 13:58:02 +0200 [thread overview]
Message-ID: <20120918115802.GJ2505@amd.com> (raw)
In-Reply-To: <20111112002421.10875.8307.stgit@bling.home>
On Fri, Nov 11, 2011 at 05:26:44PM -0700, Alex Williamson wrote:
> domain_update_iommu_coherency() currently defaults to setting domains
> as coherent when the domain is not attached to any iommus. This
> allows for a window in domain_context_mapping_one() where such a
> domain can update context entries non-coherently, and only after
> update the domain capability to clear iommu_coherency.
>
> This can be seen using KVM device assignment on VT-d systems that
> do not support coherency in the ecap register. When a device is
> added to a guest, a domain is created (iommu_coherency = 0), the
> device is attached, and ranges are mapped. If we then hot unplug
> the device, the coherency is updated and set to the default (1)
> since no iommus are attached to the domain. A subsequent attach
> of a device makes use of the same dmar domain (now marked coherent)
> updates context entries with coherency enabled, and only disables
> coherency as the last step in the process.
>
> To fix this, switch domain_update_iommu_coherency() to use the
> safer, non-coherent default for domains not attached to iommus.
>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> Tested-by: Donald Dutile <ddutile@redhat.com>
> Acked-by: Donald Dutile <ddutile@redhat.com>
> Acked-by: Chris Wright <chrisw@sous-sol.org>
Applied, thanks.
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
next prev parent reply other threads:[~2012-09-18 11:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-12 0:26 [PATCH v2] intel-iommu: Default to non-coherent for domains unattached to iommus Alex Williamson
2012-08-20 20:39 ` Craig Hada
2012-09-18 11:58 ` Joerg Roedel [this message]
2012-09-18 11:58 ` Joerg Roedel
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=20120918115802.GJ2505@amd.com \
--to=joerg.roedel@amd.com \
--cc=alex.williamson@redhat.com \
--cc=chrisw@sous-sol.org \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.