memory: Add MemoryRegionIOMMUOps.notify_started/stopped callbacks

The IOMMU driver may change behavior depending on whether a notifier
client is present. In the case of POWER, this represents a change in
the visibility of the IOTLB, for other drivers such as intel-iommu and
future AMD-Vi emulation, notifier support is not yet enabled and this
provides the opportunity to flag that incompatibility.

Backports commit d22d8956b185c002b50a4d0883aff61f857347ef from qemu
This commit is contained in:
Alexey Kardashevskiy 2018-02-25 00:22:53 -05:00 committed by Lioncash
parent c14d8226ab
commit 7187d77cfa
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -147,6 +147,10 @@ struct MemoryRegionIOMMUOps {
IOMMUTLBEntry (*translate)(MemoryRegion *iommu, hwaddr addr, bool is_write); IOMMUTLBEntry (*translate)(MemoryRegion *iommu, hwaddr addr, bool is_write);
/* Returns minimum supported page size */ /* Returns minimum supported page size */
uint64_t (*get_min_page_size)(MemoryRegion *iommu); uint64_t (*get_min_page_size)(MemoryRegion *iommu);
/* Called when the first notifier is set */
void (*notify_started)(MemoryRegion *iommu);
/* Called when the last notifier is removed */
void (*notify_stopped)(MemoryRegion *iommu);
}; };
struct MemoryRegion { struct MemoryRegion {