From: Joerg Roedel <joro@8bytes.org>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Joerg Roedel <Joerg.Roedel@amd.com>,
linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org,
dwmw2@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu: Include MSI susceptibility to DMA in creating iommu groups
Date: Sun, 20 Nov 2011 13:00:43 +0100 [thread overview]
Message-ID: <20111120120043.GB20535@8bytes.org> (raw)
In-Reply-To: <1321633956.26410.126.camel@bling.home>
On Fri, Nov 18, 2011 at 09:32:36AM -0700, Alex Williamson wrote:
> I guess I fail to see the difference. We group devices behind certain
> bridges together because we can't distinguish DMA from those devices.
> MSI presents an address window across all devices for which we
> potentially can't distinguish between any of them.
With an IOMMU the address window is per-device and not shared between
all devices. A MSI message is nothing more than a DMA write transaction
to a specific address. This message has a requestor-id so an IOMMU can
distinguish between devices. The AMD IOMMU for example uses that to
implement per-device remapping tables.
> The trouble is that interrupt remapping closing a hole in DMA isolation
> is a platform issue. Is vfio supposed to know that on architecture foo
> we don't have such a hole and we don't need to look for interrupt
> remapping. Or maybe that platform bar solved it differently and we need
> to instead check flag MSI_OK. Current KVM doesn't care about this
> because it only does device assignment on x86.
>From device standpoint a MSI transaction is always a DMA memory write
to a given address range. The IOMMU-API should export a feature flag
whether it supports filtering on those transaction or not. We have that
today with the IOMMU_CAP_INTR_REMAP. I agree that the interface to get
this information is ugly because a domain is needed. But the interface
can be fixed. While doing this I suggest to rename that feature
IOMMU_CAP_INTR_ISOLATION or something like that.
VFIO can then check for this flag on module-load and refuse to load if
it is not available.
Regards,
Joerg
next prev parent reply other threads:[~2011-11-20 12:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-17 17:09 [PATCH] iommu: Include MSI susceptibility to DMA in creating iommu groups Alex Williamson
2011-11-18 4:37 ` Kai Huang
2011-11-18 5:40 ` Alex Williamson
2011-11-18 6:20 ` Kai Huang
2011-11-18 10:46 ` Joerg Roedel
2011-11-18 14:56 ` Alex Williamson
2011-11-18 15:27 ` Joerg Roedel
2011-11-18 16:32 ` Alex Williamson
2011-11-20 12:00 ` Joerg Roedel [this message]
2011-11-21 4:39 ` Kai Huang
2011-11-21 23:35 ` Chris Wright
2011-11-23 10:56 ` Joerg Roedel
2011-11-23 20:12 ` Chris Wright
2011-11-23 18:37 ` Alex Williamson
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=20111120120043.GB20535@8bytes.org \
--to=joro@8bytes.org \
--cc=Joerg.Roedel@amd.com \
--cc=alex.williamson@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).