aboutsummaryrefslogtreecommitdiff
path: root/include/hw/virtio/vhost-vdpa.h
diff options
context:
space:
mode:
authorEugenio Pérez <eperezma@redhat.com>2021-10-14 16:12:36 +0200
committerMichael S. Tsirkin <mst@redhat.com>2021-10-20 04:37:55 -0400
commit013108b6e51e1c10b78859e2e091202364aa7a7d (patch)
treeb3520190e397232a7349a871b7bdad06c11fc1e9 /include/hw/virtio/vhost-vdpa.h
parent032e4d686e9c6f8ae3b9206c720ae3614e28d8a3 (diff)
vdpa: Check for iova range at mappings changes
Check vdpa device range before updating memory regions so we don't add any outside of it, and report the invalid change if any. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Message-Id: <20211014141236.923287-4-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Diffstat (limited to 'include/hw/virtio/vhost-vdpa.h')
-rw-r--r--include/hw/virtio/vhost-vdpa.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h
index a8963da2d9..c288cf7ecb 100644
--- a/include/hw/virtio/vhost-vdpa.h
+++ b/include/hw/virtio/vhost-vdpa.h
@@ -13,6 +13,7 @@
#define HW_VIRTIO_VHOST_VDPA_H
#include "hw/virtio/virtio.h"
+#include "standard-headers/linux/vhost_types.h"
typedef struct VhostVDPAHostNotifier {
MemoryRegion mr;
@@ -24,6 +25,7 @@ typedef struct vhost_vdpa {
uint32_t msg_type;
bool iotlb_batch_begin_sent;
MemoryListener listener;
+ struct vhost_vdpa_iova_range iova_range;
struct vhost_dev *dev;
VhostVDPAHostNotifier notifier[VIRTIO_QUEUE_MAX];
} VhostVDPA;