public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark McLoughlin <markmc@redhat.com>
To: "Han, Weidong" <weidong.han@intel.com>
Cc: "'Avi Kivity'" <avi@redhat.com>,
	"Woodhouse, David" <david.woodhouse@intel.com>,
	"'Jesse Barnes'" <jbarnes@virtuousgeek.org>,
	"Yu, Fenghua" <fenghua.yu@intel.com>,
	"'iommu@lists.linux-foundation.org'"
	<iommu@lists.linux-foundation.org>,
	"'kvm@vger.kernel.org'" <kvm@vger.kernel.org>
Subject: Re: [PATCH 04/13] iommu coherency
Date: Thu, 04 Dec 2008 17:12:43 +0000	[thread overview]
Message-ID: <1228410763.3732.139.camel@blaa> (raw)
In-Reply-To: <715D42877B251141A38726ABF5CABF2C018BF0598A@pdsmsx503.ccr.corp.intel.com>

On Tue, 2008-12-02 at 22:22 +0800, Han, Weidong wrote:

> in dmar_domain, more than one iommus may be included in iommu_bmp. Due
> to "Coherency" capability may be different across iommus, set this
> variable to indicate iommu access is coherent or not. Only when all
> related iommus in a dmar_domain are all coherent, iommu access of this
> domain is coherent.
> 
> Signed-off-by: Weidong Han <weidong.han@intel.com>
> ---
>  drivers/pci/intel-iommu.c     |    6 ++++++
>  include/linux/dma_remapping.h |    2 ++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
> index a18e0b4..fa1507b 100644
> --- a/drivers/pci/intel-iommu.c
> +++ b/drivers/pci/intel-iommu.c
> @@ -982,6 +982,12 @@ static struct dmar_domain * iommu_alloc_domain(struct intel_iommu *iommu)
>  	domain->id = num;
>  	memset(&domain->iommu_bmp, 0, sizeof(unsigned long));
>  	set_bit(iommu->seq_id, &domain->iommu_bmp);
> +
> +	if (ecap_coherent(iommu->ecap))
> +		domain->iommu_coherency = 1;
> +	else
> +		domain->iommu_coherency = 0;

If you allocate a non-coherent iommu, followed by a coherent iommu, then
iommu_coherency ends up as 1

In patch 6/13 you add domain_update_iommu_coherency(). It would make
more sense to add that function in this patch and use it here.

Cheers,
Mark.


  reply	other threads:[~2008-12-04 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 14:22 [PATCH 04/13] iommu coherency Han, Weidong
2008-12-04 17:12 ` Mark McLoughlin [this message]
2008-12-05  1:00   ` Han, Weidong

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=1228410763.3732.139.camel@blaa \
    --to=markmc@redhat.com \
    --cc=avi@redhat.com \
    --cc=david.woodhouse@intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kvm@vger.kernel.org \
    --cc=weidong.han@intel.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