On 30/04/2018 15:34, Peter Maydell wrote: >> */ >> 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?
The only pointer inside is to the target AddressSpace, which (see address_space_destroy) is safe to access inside either of those condition. In practice we use the former. Paolo