From 7187d77cfa57b34d20f15f6e61546ac7d42fe006 Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Sun, 25 Feb 2018 00:22:53 -0500 Subject: [PATCH] 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 --- qemu/include/exec/memory.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qemu/include/exec/memory.h b/qemu/include/exec/memory.h index 8231aa8f..ebbca270 100644 --- a/qemu/include/exec/memory.h +++ b/qemu/include/exec/memory.h @@ -147,6 +147,10 @@ struct MemoryRegionIOMMUOps { IOMMUTLBEntry (*translate)(MemoryRegion *iommu, hwaddr addr, bool is_write); /* Returns minimum supported page size */ 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 {