On 30 April 2018 at 19:18, Peter Maydell <peter.mayd...@linaro.org> 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: <20180430122404.10741-1-peter.mayd...@linaro.org> > ("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