summaryrefslogtreecommitdiff
path: root/include/exec/memory.h
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-04-07 18:59:13 +0800
committerEduardo Habkost <ehabkost@redhat.com>2017-04-20 15:22:41 -0300
commitf06a696dc958dd80f7eaf5be66fdefac77741ee0 (patch)
tree07cc14f116759afb5659eadaabac4d55afde01a9 /include/exec/memory.h
parent10315b9b28c28655ce64500281f4a028d0f8c5ff (diff)
downloadqemu-f06a696dc958dd80f7eaf5be66fdefac77741ee0.tar.gz
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/exec/memory.h')
-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;