qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 00/11] iommu: add MemTxAttrs argument to IOM


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC PATCH 00/11] iommu: add MemTxAttrs argument to IOMMU translate function
Date: Tue, 1 May 2018 09:57:18 +0100

On 30 April 2018 at 19:18, Peter Maydell <address@hidden> wrote:
> This is an RFC patchset because it's a little bit unmotivated
> and only lightly tested, but in principle it could be
> committed, so half-RFC-half-not :-)
>
> The Arm SMMU wants to know if the transaction it is handling
> is secure/nonsecure and user/privileged, because the iommu
> page tables can be configured by the guest to only allow
> transactions which satisfy those criteria. At the moment
> Eric's implementation ignores all that, because we don't
> provide the IOMMUMemoryRegion translate function with any
> memory transaction attribute information. This patchset fixes
> that by plumbing through transaction attributes.
>
> Most of the patchset is just starting at the leaves of the calltree
> rooted at "flatview_do_translate()" and making callsites provide
> attributes where appropriate or plumbing through existing attribute
> information where it exists.  General principles of when I made a
> caller pass MEMTXATTRS_UNSPECIFIED and when I had it take an
> attrs value from further up:
>  * dma_memory_* functions all assume UNSPECIFIED (matching
>    the read/write/rw functions that already do that)
>  * cpu_physical_memory_* also all assume UNSPECIFIED,
>    following the pattern of existing functions in that family
>  * address_space_* take an attributes argument, by analogy
>    with existing functions in that family
>  * endpoints like target-specific code or vhost has to
>    provide attributes, but for all the targets affected here
>    they don't care about attributes and can use UNSPECIFIED
>
> 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).
>
> Based-on: <address@hidden>
> ("memory.h: Improve IOMMU related documentation") but
> only for textual reasons.
>
> thanks
> -- PMM
>
> Peter Maydell (11):
>   Make address_space_translate() take a MemTxAttrs argument
>   Make address_space_map() take a MemTxAttrs argument
>   Make address_space_access_valid() take a MemTxAttrs argument
>   Make flatview_extend_translation() take a MemTxAttrs argument
>   Make memory_region_access_valid() take a MemTxAttrs argument
>   Make MemoryRegion valid.accepts callback take a MemTxAttrs argument
>   Make flatview_access_valid() take a MemTxAttrs argument
>   Make flatview_translate() take a MemTxAttrs argument
>   Make address_space_get_iotlb_entry() take a MemTxAttrs argument
>   Make flatview_do_translate() take a MemTxAttrs argument
>   Add MemTxAttrs argument to IOMMU translate function

Whoops, I misdrove the git format-patch command and it's missing
what should have been patch 1 in the set:
    Make tb_invalidate_phys_addr() take a MemTxAttrs argument

I'll resend the series, that's probably easiest.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]