[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] memory.h: Improve IOMMU related documentation
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] memory.h: Improve IOMMU related documentation |
Date: |
Mon, 30 Apr 2018 14:34:46 +0100 |
On 30 April 2018 at 13:24, Peter Maydell <address@hidden> wrote:
> Add more detail to the documentation for memory_region_init_iommu()
> and other IOMMU-related functions and data structures.
> @@ -203,20 +211,58 @@ typedef struct IOMMUMemoryRegionClass {
> * be the access permission of this translation operation. We can
> * set flag to IOMMU_NONE to mean that we don't need any
> * read/write permission checks, like, when for region replay.
> + *
> + * Once the IOMMU has returned a TLB entry, it must notify
> + * the IOMMU's users if that TLB entry changes, using
> + * memory_region_notify_iommu() (or, if necessary, by calling
> + * memory_region_notify_one() for each registered notifier).
> + *
> + * @iommu: the IOMMUMemoryRegion
> + * @hwaddr: address to be translated within the memory region
> + * @flag: requested access permissions
> */
> IOMMUTLBEntry (*translate)(IOMMUMemoryRegion *iommu, hwaddr addr,
> IOMMUAccessFlags flag);
A question I just thought of -- how long is the IOMMUTLBEntry I get
back guaranteed to be valid for? For instance if I'm in an RCU
critical section can I assume it won't become invalid before I
leave the critical section? Or must I always register an IOMMU
notifier before I call translate? I'm guessing not the latter
because flatview_do_translate() does not, but is the guarantee
only RCU-critical section or while-holding-big-QEMU-lock or
something else?
thanks
-- PMM
Re: [Qemu-devel] [PATCH] memory.h: Improve IOMMU related documentation,
Peter Maydell <=