qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] memory: add iommu_notify_flag


From: Peter Xu
Subject: Re: [Qemu-devel] [PATCH 2/3] memory: add iommu_notify_flag
Date: Tue, 6 Sep 2016 13:33:02 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

On Tue, Sep 06, 2016 at 03:12:26PM +1000, David Gibson wrote:
> >  /**
> > @@ -611,9 +613,11 @@ uint64_t 
> > memory_region_iommu_get_min_page_size(MemoryRegion *mr);
> >   * @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 address@hidden == 0.
> > + * @flag: type of IOMMU notification (IOMMU_RW, IOMMU_NONE)
> 
> This makes no sense.  The overall type of the notifier is already
> noted in register / notify_start.  The permission on this specific
> mapping is already included in the IOMMUTLBEntry.

This is not meant to be the same as the one in IOMMUTLBEntry. For
example, we can have:

  memory_region_notify_iommu(..., entry, IOMMU_RW);

This means that the caller of notification will notify all changed
entries (will only be used for checking, see the assert() in
memory_region_notify_iommu()). While within the entry, we can have:

  entry.perm == IOMMU_NONE

Which means that this specific invalidation is an unmap() operation.

The naming is bad.

We can put this aside and see whether we can have better solution in
general...

Thanks,

-- peterx



reply via email to

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