2020-07-01 16:55:37 +02:00
|
|
|
/*
|
|
|
|
* vhost-vdpa.h
|
|
|
|
*
|
|
|
|
* Copyright(c) 2017-2018 Intel Corporation.
|
|
|
|
* Copyright(c) 2020 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HW_VIRTIO_VHOST_VDPA_H
|
|
|
|
#define HW_VIRTIO_VHOST_VDPA_H
|
|
|
|
|
2022-03-14 18:34:42 +01:00
|
|
|
#include <gmodule.h>
|
|
|
|
|
2022-03-14 18:34:51 +01:00
|
|
|
#include "hw/virtio/vhost-iova-tree.h"
|
2020-07-01 16:55:37 +02:00
|
|
|
#include "hw/virtio/virtio.h"
|
2021-10-14 16:12:36 +02:00
|
|
|
#include "standard-headers/linux/vhost_types.h"
|
2020-07-01 16:55:37 +02:00
|
|
|
|
2021-04-15 09:33:56 +02:00
|
|
|
typedef struct VhostVDPAHostNotifier {
|
|
|
|
MemoryRegion mr;
|
|
|
|
void *addr;
|
|
|
|
} VhostVDPAHostNotifier;
|
|
|
|
|
2020-07-01 16:55:37 +02:00
|
|
|
typedef struct vhost_vdpa {
|
|
|
|
int device_fd;
|
2021-10-20 06:55:52 +02:00
|
|
|
int index;
|
2020-07-01 16:55:37 +02:00
|
|
|
uint32_t msg_type;
|
2021-08-12 16:09:33 +02:00
|
|
|
bool iotlb_batch_begin_sent;
|
2020-07-01 16:55:37 +02:00
|
|
|
MemoryListener listener;
|
2021-10-14 16:12:36 +02:00
|
|
|
struct vhost_vdpa_iova_range iova_range;
|
2022-03-14 18:34:54 +01:00
|
|
|
uint64_t acked_features;
|
2022-03-14 18:34:42 +01:00
|
|
|
bool shadow_vqs_enabled;
|
2022-03-14 18:34:51 +01:00
|
|
|
/* IOVA mapping used by the Shadow Virtqueue */
|
|
|
|
VhostIOVATree *iova_tree;
|
2022-03-14 18:34:42 +01:00
|
|
|
GPtrArray *shadow_vqs;
|
2020-09-07 12:49:03 +02:00
|
|
|
struct vhost_dev *dev;
|
2021-04-15 09:33:56 +02:00
|
|
|
VhostVDPAHostNotifier notifier[VIRTIO_QUEUE_MAX];
|
2020-07-01 16:55:37 +02:00
|
|
|
} VhostVDPA;
|
|
|
|
|
|
|
|
#endif
|