From: Scott Wood <scottwood@freescale.com>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: Stuart Yoder <b08248@gmail.com>,
Alex Williamson <alex.williamson@redhat.com>,
Alexey Kardashevskiy <aik@au1.ibm.com>, <aafabbri@cisco.com>,
<kvm@vger.kernel.org>, <pmac@au1.ibm.com>,
<qemu-devel@nongnu.org>, <konrad.wilk@oracle.com>,
<agraf@suse.de>, <dwg@au1.ibm.com>, <chrisw@sous-sol.org>,
<B08248@freescale.com>, <iommu@lists.linux-foundation.org>,
<avi@redhat.com>, <linux-pci@vger.kernel.org>,
<B07421@freescale.com>, <benve@cisco.com>,
<benh@kernel.crashing.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: vfio / iommu domain attributes
Date: Wed, 7 Dec 2011 12:59:30 -0600 [thread overview]
Message-ID: <4EDFB792.3040302@freescale.com> (raw)
In-Reply-To: <20111207163842.GC29680@amd.com>
On 12/07/2011 10:38 AM, Joerg Roedel wrote:
> On Wed, Dec 07, 2011 at 09:54:39AM -0600, Stuart Yoder wrote:
>> Alex, Alexey I'm wondering if you've had any new thoughts on this over
>> the last week.
>>
>> For Freescale, our iommu domain attributes would look something like:
>> -domain iova base address
>> -domain iova window size
>
> I agree with that.
>
>> -domain enable/disable
>> -number of subwindows
>> -operation mapping table index
>> -stash destination CPU
>> -stash target (cache– L1, L2, L3)
>
> Why does the user of the IOMMU-API need to have control over these
> things?
Stash configuration needs to match what the user of the device is doing
(in particular, which CPU(s) it is accessing the device's ring buffer
from). Operation mapping table is related to stashing, and while
perhaps not as critical to be controlled by the driver (though I'm not
too familiar with the details here), it seems better than hardcoding
this knowledge elsewhere in the system -- it does relate to the kind of
things that the specific device is doing.
Domain enable/disable is something we'd use when we reset a KVM or
userspace device user (or reassign the device). We need the device to
not be able to DMA until it has been quiesced from previous activity,
and we don't have anything like PCIe function-level reset or the PCI
bus-master enable bit. The driver needs to let us know when it's safe
to enable DMA. This *could* be done via map/unmap, but in
configurations where maps are static, we'd like to not risk the map
failing post-init. Plus, it's simpler to just have a toggle rather than
need to tear down and rebuild the maps, and guest reset/failover is a
performance-critical path for some of our customers.
Number of subwindows goes along with iova base/size. It affects which
mappings will be valid. If you're using large pages and a small iova
window, a smaller number of subwindows may suffice. We could just
always use the maximum number of subwindows, but that has a good chance
of thrashing the IOMMU's cache. On p4080, max subwindows per device is
256 and the cache can hold 128 entries globally. Lower-end chips may
have a smaller cache.
-Scott
next prev parent reply other threads:[~2011-12-07 18:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-07 15:54 vfio / iommu domain attributes Stuart Yoder
2011-12-07 15:54 ` [Qemu-devel] " Stuart Yoder
2011-12-07 16:38 ` Joerg Roedel
2011-12-07 16:38 ` [Qemu-devel] " Joerg Roedel
2011-12-07 18:59 ` Scott Wood [this message]
2011-12-07 19:11 ` Stuart Yoder
2011-12-07 19:11 ` [Qemu-devel] " Stuart Yoder
2011-12-07 19:11 ` Stuart Yoder
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=4EDFB792.3040302@freescale.com \
--to=scottwood@freescale.com \
--cc=B07421@freescale.com \
--cc=B08248@freescale.com \
--cc=aafabbri@cisco.com \
--cc=agraf@suse.de \
--cc=aik@au1.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=b08248@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=benve@cisco.com \
--cc=chrisw@sous-sol.org \
--cc=david@gibson.dropbear.id.au \
--cc=dwg@au1.ibm.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joerg.roedel@amd.com \
--cc=konrad.wilk@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=pmac@au1.ibm.com \
--cc=qemu-devel@nongnu.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.