···11-#include <stdint.h>
22-#include "qemu/compiler.h"
11+/* For QEMU all types are already defined via osdep.h, so this
22+ * header does not need to do anything.
33+ */
+1-1
include/standard-headers/linux/virtio_balloon.h
···5151#define VIRTIO_BALLOON_S_MINFLT 3 /* Number of minor faults */
5252#define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */
5353#define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */
5454-#define VIRTIO_BALLOON_S_AVAIL 6 /* Amount of available memory in guest */
5454+#define VIRTIO_BALLOON_S_AVAIL 6 /* Available memory as in /proc */
5555#define VIRTIO_BALLOON_S_NR 7
56565757/*
+3-3
include/standard-headers/linux/virtio_blk.h
···4343#ifndef VIRTIO_BLK_NO_LEGACY
4444#define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */
4545#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */
4646-#define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */
4646+#define VIRTIO_BLK_F_FLUSH 9 /* Flush command supported */
4747#define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */
4848-/* Old (deprecated) name for VIRTIO_BLK_F_WCE. */
4949-#define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE
4848+/* Old (deprecated) name for VIRTIO_BLK_F_FLUSH. */
4949+#define VIRTIO_BLK_F_WCE VIRTIO_BLK_F_FLUSH
5050#endif /* !VIRTIO_BLK_NO_LEGACY */
51515252#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */
+6
linux-headers/asm-arm64/kvm.h
···9494#define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */
9595#define KVM_ARM_VCPU_EL1_32BIT 1 /* CPU running a 32bit VM */
9696#define KVM_ARM_VCPU_PSCI_0_2 2 /* CPU uses PSCI v0.2 */
9797+#define KVM_ARM_VCPU_PMU_V3 3 /* Support guest PMUv3 */
97989899struct kvm_vcpu_init {
99100 __u32 target;
···203204#define KVM_DEV_ARM_VGIC_GRP_NR_IRQS 3
204205#define KVM_DEV_ARM_VGIC_GRP_CTRL 4
205206#define KVM_DEV_ARM_VGIC_CTRL_INIT 0
207207+208208+/* Device Control API on vcpu fd */
209209+#define KVM_ARM_VCPU_PMU_V3_CTRL 0
210210+#define KVM_ARM_VCPU_PMU_V3_IRQ 0
211211+#define KVM_ARM_VCPU_PMU_V3_INIT 1
206212207213/* KVM_IRQ_LINE irq field index values */
208214#define KVM_ARM_IRQ_TYPE_SHIFT 24
+2-2
linux-headers/asm-powerpc/epapr_hcalls.h
···7878#define EV_SUCCESS 0
7979#define EV_EPERM 1 /* Operation not permitted */
8080#define EV_ENOENT 2 /* Entry Not Found */
8181-#define EV_EIO 3 /* I/O error occured */
8181+#define EV_EIO 3 /* I/O error occurred */
8282#define EV_EAGAIN 4 /* The operation had insufficient
8383 * resources to complete and should be
8484 * retried
···8989#define EV_ENODEV 7 /* No such device */
9090#define EV_EINVAL 8 /* An argument supplied to the hcall
9191 was out of range or invalid */
9292-#define EV_INTERNAL 9 /* An internal error occured */
9292+#define EV_INTERNAL 9 /* An internal error occurred */
9393#define EV_CONFIG 10 /* A configuration error was detected */
9494#define EV_INVALID_STATE 11 /* The object is in an invalid state */
9595#define EV_UNIMPLEMENTED 12 /* Unimplemented hypercall */
···7878 __u64 reserved3;
7979 } reserved;
8080 } arg;
8181-} __packed;
8181+} __attribute__((packed));
82828383/*
8484 * Start at 0x12 and not at 0 to be more strict against bugs.
+90-2
linux-headers/linux/vfio.h
···5959#define VFIO_TYPE (';')
6060#define VFIO_BASE 100
61616262+/*
6363+ * For extension of INFO ioctls, VFIO makes use of a capability chain
6464+ * designed after PCI/e capabilities. A flag bit indicates whether
6565+ * this capability chain is supported and a field defined in the fixed
6666+ * structure defines the offset of the first capability in the chain.
6767+ * This field is only valid when the corresponding bit in the flags
6868+ * bitmap is set. This offset field is relative to the start of the
6969+ * INFO buffer, as is the next field within each capability header.
7070+ * The id within the header is a shared address space per INFO ioctl,
7171+ * while the version field is specific to the capability id. The
7272+ * contents following the header are specific to the capability id.
7373+ */
7474+struct vfio_info_cap_header {
7575+ __u16 id; /* Identifies capability */
7676+ __u16 version; /* Version specific to the capability ID */
7777+ __u32 next; /* Offset of next capability */
7878+};
7979+8080+/*
8181+ * Callers of INFO ioctls passing insufficiently sized buffers will see
8282+ * the capability chain flag bit set, a zero value for the first capability
8383+ * offset (if available within the provided argsz), and argsz will be
8484+ * updated to report the necessary buffer size. For compatibility, the
8585+ * INFO ioctl will not report error in this case, but the capability chain
8686+ * will not be available.
8787+ */
8888+6289/* -------- IOCTLs for VFIO file descriptor (/dev/vfio/vfio) -------- */
63906491/**
···194221#define VFIO_REGION_INFO_FLAG_READ (1 << 0) /* Region supports read */
195222#define VFIO_REGION_INFO_FLAG_WRITE (1 << 1) /* Region supports write */
196223#define VFIO_REGION_INFO_FLAG_MMAP (1 << 2) /* Region supports mmap */
224224+#define VFIO_REGION_INFO_FLAG_CAPS (1 << 3) /* Info supports caps */
197225 __u32 index; /* Region index */
198198- __u32 resv; /* Reserved for alignment */
226226+ __u32 cap_offset; /* Offset within info struct of first cap */
199227 __u64 size; /* Region size (bytes) */
200228 __u64 offset; /* Region offset from start of device fd */
201229};
202230#define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8)
203231232232+/*
233233+ * The sparse mmap capability allows finer granularity of specifying areas
234234+ * within a region with mmap support. When specified, the user should only
235235+ * mmap the offset ranges specified by the areas array. mmaps outside of the
236236+ * areas specified may fail (such as the range covering a PCI MSI-X table) or
237237+ * may result in improper device behavior.
238238+ *
239239+ * The structures below define version 1 of this capability.
240240+ */
241241+#define VFIO_REGION_INFO_CAP_SPARSE_MMAP 1
242242+243243+struct vfio_region_sparse_mmap_area {
244244+ __u64 offset; /* Offset of mmap'able area within region */
245245+ __u64 size; /* Size of mmap'able area */
246246+};
247247+248248+struct vfio_region_info_cap_sparse_mmap {
249249+ struct vfio_info_cap_header header;
250250+ __u32 nr_areas;
251251+ __u32 reserved;
252252+ struct vfio_region_sparse_mmap_area areas[];
253253+};
254254+255255+/*
256256+ * The device specific type capability allows regions unique to a specific
257257+ * device or class of devices to be exposed. This helps solve the problem for
258258+ * vfio bus drivers of defining which region indexes correspond to which region
259259+ * on the device, without needing to resort to static indexes, as done by
260260+ * vfio-pci. For instance, if we were to go back in time, we might remove
261261+ * VFIO_PCI_VGA_REGION_INDEX and let vfio-pci simply define that all indexes
262262+ * greater than or equal to VFIO_PCI_NUM_REGIONS are device specific and we'd
263263+ * make a "VGA" device specific type to describe the VGA access space. This
264264+ * means that non-VGA devices wouldn't need to waste this index, and thus the
265265+ * address space associated with it due to implementation of device file
266266+ * descriptor offsets in vfio-pci.
267267+ *
268268+ * The current implementation is now part of the user ABI, so we can't use this
269269+ * for VGA, but there are other upcoming use cases, such as opregions for Intel
270270+ * IGD devices and framebuffers for vGPU devices. We missed VGA, but we'll
271271+ * use this for future additions.
272272+ *
273273+ * The structure below defines version 1 of this capability.
274274+ */
275275+#define VFIO_REGION_INFO_CAP_TYPE 2
276276+277277+struct vfio_region_info_cap_type {
278278+ struct vfio_info_cap_header header;
279279+ __u32 type; /* global per bus driver */
280280+ __u32 subtype; /* type specific */
281281+};
282282+283283+#define VFIO_REGION_TYPE_PCI_VENDOR_TYPE (1 << 31)
284284+#define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff)
285285+286286+/* 8086 Vendor sub-types */
287287+#define VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION (1)
288288+#define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2)
289289+#define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3)
290290+204291/**
205292 * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,
206293 * struct vfio_irq_info)
···336423 * between described ranges are unimplemented.
337424 */
338425 VFIO_PCI_VGA_REGION_INDEX,
339339- VFIO_PCI_NUM_REGIONS
426426+ VFIO_PCI_NUM_REGIONS = 9 /* Fixed user ABI, region indexes >=9 use */
427427+ /* device specific cap to define content. */
340428};
341429342430enum {
+6
linux-headers/linux/vhost.h
···126126#define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, struct vhost_vring_file)
127127/* Set eventfd to signal an error */
128128#define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, struct vhost_vring_file)
129129+/* Set busy loop timeout (in us) */
130130+#define VHOST_SET_VRING_BUSYLOOP_TIMEOUT _IOW(VHOST_VIRTIO, 0x23, \
131131+ struct vhost_vring_state)
132132+/* Get busy loop timeout (in us) */
133133+#define VHOST_GET_VRING_BUSYLOOP_TIMEOUT _IOW(VHOST_VIRTIO, 0x24, \
134134+ struct vhost_vring_state)
129135130136/* VHOST_NET specific defines */
131137