vhost: fix physical address mapping
PATCH 1/1 vhost: fix physical address mapping
From: Xuan Ding <[email protected]>
When choosing IOVA as PA mode, IOVA is likely to be discontinuous, which requires page by page mapping for DMA devices. To be consistent, this patch implements page by page mapping instead of mapping at the region granularity for both IOVA as VA and PA mode.
Fixes 7c61fa08b716 ("vhost: enable IOMMU for async vhost")
Signed-off-by Xuan Ding <[email protected]>
Signed-off-by Yuan Wang <[email protected]>
--- lib/vhost/vhost.h | 1 + lib/vhost/vhost_user.c | 116 ++++++++++++++++++++--------------------- 2 files changed, 57 insertions(+), 60 deletions(-)
lib/vhost/vhost.h +1 -0
@@ -355,6 +355,7 @@ struct vring_packed_desc_event {struct guest_page {uint64_t guest_phys_addr;uint64_t host_phys_addr; +uint64_t host_user_addr;uint64_t size; };
lib/vhost/vhost_user.c +56 -60
187 lines not on this page · raw message
Signature · 1 line
2.25.1