summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPeter Xu2017-04-07 12:59:13 +0200
committerEduardo Habkost2017-04-20 20:22:41 +0200
commitf06a696dc958dd80f7eaf5be66fdefac77741ee0 (patch)
tree07cc14f116759afb5659eadaabac4d55afde01a9 /include
parentintel_iommu: use the correct memory region for device IOTLB notification (diff)
downloadqemu-f06a696dc958dd80f7eaf5be66fdefac77741ee0.tar.gz
qemu-f06a696dc958dd80f7eaf5be66fdefac77741ee0.tar.xz
qemu-f06a696dc958dd80f7eaf5be66fdefac77741ee0.zip
intel_iommu: provide its own replay() callback
The default replay() don't work for VT-d since vt-d will have a huge default memory region which covers address range 0-(2^64-1). This will normally consumes a lot of time (which looks like a dead loop). The solution is simple - we don't walk over all the regions. Instead, we jump over the regions when we found that the page directories are empty. It'll greatly reduce the time to walk the whole region. To achieve this, we provided a page walk helper to do that, invoking corresponding hook function when we found an page we are interested in. vtd_page_walk_level() is the core logic for the page walking. It's interface is designed to suite further use case, e.g., to invalidate a range of addresses. Reviewed-by: Jason Wang <jasowang@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: \"Michael S. Tsirkin\" <mst@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1491562755-23867-8-git-send-email-peterx@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/exec/memory.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h
index c0280b7064..c4fc94d504 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -55,6 +55,8 @@ typedef enum {
IOMMU_RW = 3,
} IOMMUAccessFlags;
+#define IOMMU_ACCESS_FLAG(r, w) (((r) ? IOMMU_RO : 0) | ((w) ? IOMMU_WO : 0))
+
struct IOMMUTLBEntry {
AddressSpace *target_as;
hwaddr iova;