On 2 May 2018 at 10:25, Paolo Bonzini <pbonz...@redhat.com> wrote:
> On 01/05/2018 10:59, Peter Maydell wrote:
>> As well as the SMMU, I'm also thinking about using the IOMMU
>> infrastructure for the v8M Memory Protection Controller
>> (though that is a bit trickier as I also need it to support
>> TCG execution in an IOMMU-controlled region, which is an
>> orthogonal bit of work to attribute support).

> This is going to conflict with the MemoryRegionCache patches (review
> welcome :)), as they add a new function address_space_translate_iommu.
> But apart from this it seems like a no brainer.

(We talked about this on IRC, but I don't really have any
good ideas about the API changes needed, so I figured I'd
write it up here.)

While working through this and the MPC changes, I realized that
if we pass transaction attributes through to the IOMMU translate
method then we also need to change the API of the IOMMU notifier
system. This is because a txattrs-aware IOMMU might return more
than one mapping for a particular input address (eg "use mapping
A if txattrs.secure, but mapping B if not"). So map/unmap events
become more complex than just "unmap for address X" and "map for
address X" -- you need to distinguish "here's the new map for
address X with txattrs XA".

Presumably we also want a way for notifier users like vfio to
detect "I'm dealing with an IOMMU that is txattrs aware in a
way I can't deal with" so they can usefully bail out rather than
not working.

Unfortunately I don't really know enough about our two current
users of notifiers (vhost and vfio) to know what they actually
need the iommu notifications for...

(For the notifier I need to add for TCG, the requirements are
easy: I just want to be able to get unmap events so I can
flush the TCG TLB when the info I've cached from translate
calls is stale.)

thanks
-- PMM

Reply via email to