diff options
| author | Peter Xu | 2017-05-19 05:19:40 +0200 |
|---|---|---|
| committer | Michael S. Tsirkin | 2017-05-25 20:25:27 +0200 |
| commit | bf55b7afce53718ef96f4e6616da62c0ccac37dd (patch) | |
| tree | ac502b7d8fa21ab67434cd05c9a1390c6c2ddea6 /include/exec | |
| parent | Merge remote-tracking branch 'jasowang/tags/net-pull-request' into staging (diff) | |
| download | qemu-bf55b7afce53718ef96f4e6616da62c0ccac37dd.tar.gz qemu-bf55b7afce53718ef96f4e6616da62c0ccac37dd.tar.xz qemu-bf55b7afce53718ef96f4e6616da62c0ccac37dd.zip | |
memory: tune last param of iommu_ops.translate()
This patch converts the old "is_write" bool into IOMMUAccessFlags. The
difference is that "is_write" can only express either read/write, but
sometimes what we really want is "none" here (neither read nor write).
Replay is an good example - during replay, we should not check any RW
permission bits since thats not an actual IO at all.
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include/exec')
| -rw-r--r-- | include/exec/memory.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index 99e0f54d86..97fd0c242b 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -185,8 +185,14 @@ struct MemoryRegionOps { typedef struct MemoryRegionIOMMUOps MemoryRegionIOMMUOps; struct MemoryRegionIOMMUOps { - /* Return a TLB entry that contains a given address. */ - IOMMUTLBEntry (*translate)(MemoryRegion *iommu, hwaddr addr, bool is_write); + /* + * Return a TLB entry that contains a given address. Flag should + * be the access permission of this translation operation. We can + * set flag to IOMMU_NONE to mean that we don't need any + * read/write permission checks, like, when for region replay. + */ + IOMMUTLBEntry (*translate)(MemoryRegion *iommu, hwaddr addr, + IOMMUAccessFlags flag); /* Returns minimum supported page size */ uint64_t (*get_min_page_size)(MemoryRegion *iommu); /* Called when IOMMU Notifier flag changed */ |
