xref: /openbmc/qemu/include/hw/virtio/vhost-vdpa.h (revision 096b778f)
1 /*
2  * vhost-vdpa.h
3  *
4  * Copyright(c) 2017-2018 Intel Corporation.
5  * Copyright(c) 2020 Red Hat, Inc.
6  *
7  * This work is licensed under the terms of the GNU GPL, version 2 or later.
8  * See the COPYING file in the top-level directory.
9  *
10  */
11 
12 #ifndef HW_VIRTIO_VHOST_VDPA_H
13 #define HW_VIRTIO_VHOST_VDPA_H
14 
15 #include <gmodule.h>
16 
17 #include "hw/virtio/vhost-iova-tree.h"
18 #include "hw/virtio/virtio.h"
19 #include "standard-headers/linux/vhost_types.h"
20 
21 typedef struct VhostVDPAHostNotifier {
22     MemoryRegion mr;
23     void *addr;
24 } VhostVDPAHostNotifier;
25 
26 typedef struct vhost_vdpa {
27     int device_fd;
28     int index;
29     uint32_t msg_type;
30     bool iotlb_batch_begin_sent;
31     MemoryListener listener;
32     struct vhost_vdpa_iova_range iova_range;
33     uint64_t acked_features;
34     bool shadow_vqs_enabled;
35     /* IOVA mapping used by the Shadow Virtqueue */
36     VhostIOVATree *iova_tree;
37     GPtrArray *shadow_vqs;
38     struct vhost_dev *dev;
39     VhostVDPAHostNotifier notifier[VIRTIO_QUEUE_MAX];
40 } VhostVDPA;
41 
42 #endif
43