1
2 #ifndef _LINUX_VHOST_TYPES_H
3 #define _LINUX_VHOST_TYPES_H
4
5
6
7
8
9
10
11
12
13
14 #include <linux/types.h>
15 #include <linux/compiler.h>
16 #include <linux/virtio_config.h>
17 #include <linux/virtio_ring.h>
18
19 struct vhost_vring_state {
20 unsigned int index;
21 unsigned int num;
22 };
23
24 struct vhost_vring_file {
25 unsigned int index;
26 int fd;
27
28 };
29
30 struct vhost_vring_addr {
31 unsigned int index;
32
33 unsigned int flags;
34
35
36 #define VHOST_VRING_F_LOG 0
37
38
39 __u64 desc_user_addr;
40
41 __u64 used_user_addr;
42
43 __u64 avail_user_addr;
44
45
46
47 __u64 log_guest_addr;
48 };
49
50
51 struct vhost_iotlb_msg {
52 __u64 iova;
53 __u64 size;
54 __u64 uaddr;
55 #define VHOST_ACCESS_RO 0x1
56 #define VHOST_ACCESS_WO 0x2
57 #define VHOST_ACCESS_RW 0x3
58 __u8 perm;
59 #define VHOST_IOTLB_MISS 1
60 #define VHOST_IOTLB_UPDATE 2
61 #define VHOST_IOTLB_INVALIDATE 3
62 #define VHOST_IOTLB_ACCESS_FAIL 4
63 __u8 type;
64 };
65
66 #define VHOST_IOTLB_MSG 0x1
67 #define VHOST_IOTLB_MSG_V2 0x2
68
69 struct vhost_msg {
70 int type;
71 union {
72 struct vhost_iotlb_msg iotlb;
73 __u8 padding[64];
74 };
75 };
76
77 struct vhost_msg_v2 {
78 __u32 type;
79 __u32 reserved;
80 union {
81 struct vhost_iotlb_msg iotlb;
82 __u8 padding[64];
83 };
84 };
85
86 struct vhost_memory_region {
87 __u64 guest_phys_addr;
88 __u64 memory_size;
89 __u64 userspace_addr;
90 __u64 flags_padding;
91 };
92
93
94 #define VHOST_PAGE_SIZE 0x1000
95
96 struct vhost_memory {
97 __u32 nregions;
98 __u32 padding;
99 struct vhost_memory_region regions[0];
100 };
101
102
103
104
105
106
107
108
109
110
111
112
113 #define VHOST_SCSI_ABI_VERSION 1
114
115 struct vhost_scsi_target {
116 int abi_version;
117 char vhost_wwpn[224];
118 unsigned short vhost_tpgt;
119 unsigned short reserved;
120 };
121
122
123
124 #define VHOST_F_LOG_ALL 26
125
126 #define VHOST_NET_F_VIRTIO_NET_HDR 27
127
128 #endif