summary refs log tree commit diff stats
path: root/include/exec
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2024-05-16 14:46:56 +0200
committerCédric Le Goater <clg@redhat.com>2024-05-16 16:59:19 +0200
commitebb481c03c22eaf052b02c37ddd53989a078b771 (patch)
treedd4b890ff0ff8b3ba69f9b72208f52a851270e37 /include/exec
parent94d12088409b9544dd4e191e2971c47ecec4c315 (diff)
downloadfocaccia-qemu-ebb481c03c22eaf052b02c37ddd53989a078b771.tar.gz
focaccia-qemu-ebb481c03c22eaf052b02c37ddd53989a078b771.zip
memory: Add Error** argument to memory_get_xlat_addr()
Let the callers do the reporting. This will be useful in
vfio_iommu_map_dirty_notify().

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Avihai Horon <avihaih@nvidia.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/memory.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h
index d417d7f363..9cdd64e9c6 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -774,9 +774,22 @@ void ram_discard_manager_register_listener(RamDiscardManager *rdm,
 void ram_discard_manager_unregister_listener(RamDiscardManager *rdm,
                                              RamDiscardListener *rdl);
 
+/**
+ * memory_get_xlat_addr: Extract addresses from a TLB entry
+ *
+ * @iotlb: pointer to an #IOMMUTLBEntry
+ * @vaddr: virtual address
+ * @ram_addr: RAM address
+ * @read_only: indicates if writes are allowed
+ * @mr_has_discard_manager: indicates memory is controlled by a
+ *                          RamDiscardManager
+ * @errp: pointer to Error*, to store an error if it happens.
+ *
+ * Return: true on success, else false setting @errp with error.
+ */
 bool memory_get_xlat_addr(IOMMUTLBEntry *iotlb, void **vaddr,
                           ram_addr_t *ram_addr, bool *read_only,
-                          bool *mr_has_discard_manager);
+                          bool *mr_has_discard_manager, Error **errp);
 
 typedef struct CoalescedMemoryRange CoalescedMemoryRange;
 typedef struct MemoryRegionIoeventfd MemoryRegionIoeventfd;