On Wed, Sep 14, 2016 at 04:17:26PM +0800, Peter Xu wrote: > On Wed, Sep 14, 2016 at 05:15:03PM +1000, David Gibson wrote: > > [...] > > > Peter suggested commenting this next to the IOTLBEntry definition, and > > I think that's probably ok for now. > > Looks like we have something already (just not that obvious): > > /** > * memory_region_notify_iommu: notify a change in an IOMMU translation entry. > * > * @mr: the memory region that was changed > * @entry: the new entry in the IOMMU translation table. The entry > * replaces all old entries for the same virtual I/O address range. > * Deleted entries have .@perm == 0. > */ > void memory_region_notify_iommu(MemoryRegion *mr, > IOMMUTLBEntry entry); > > Though it's quite simple, it did explain that perm==0 is for deleted > entries.
That is definitely not sufficient. It misses the crucial point is
that @perm != 0 is NOT ALLOWED if there was an existing mapping at
that address.
It's not that we really _need_ to support in-place change. The point
is that we want to keep our interface contracts simple and clear.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
