PATH:
usr
/
include
/
linux
#ifndef _LINUX_VHOST_H #define _LINUX_VHOST_H /* Userspace interface for in-kernel virtio accelerators. */ /* vhost is used to reduce the number of system calls involved in virtio. * * Existing virtio net code is used in the guest without modification. * * This header includes interface used by userspace hypervisor for * device configuration. */ #include <linux/types.h> #include <linux/ioctl.h> #include <linux/virtio_config.h> #include <linux/virtio_ring.h> struct vhost_vring_state { unsigned int index; unsigned int num; }; struct vhost_vring_file { unsigned int index; int fd; /* Pass -1 to unbind from file. */ }; struct vhost_vring_addr { unsigned int index; /* Option flags. */ unsigned int flags; /* Flag values: */ /* Whether log address is valid. If set enables logging. */ #define VHOST_VRING_F_LOG 0 /* Start of array of descriptors (virtually contiguous) */ __u64 desc_user_addr; /* Used structure address. Must be 32 bit aligned */ __u64 used_user_addr; /* Available structure address. Must be 16 bit aligned */ __u64 avail_user_addr; /* Logging support. */ /* Log writes to used structure, at offset calculated from specified * address. Address must be 32 bit aligned. */ __u64 log_guest_addr; }; /* no alignment requirement */ struct vhost_iotlb_msg { __u64 iova; __u64 size; __u64 uaddr; #define VHOST_ACCESS_RO 0x1 #define VHOST_ACCESS_WO 0x2 #define VHOST_ACCESS_RW 0x3 __u8 perm; #define VHOST_IOTLB_MISS 1 #define VHOST_IOTLB_UPDATE 2 #define VHOST_IOTLB_INVALIDATE 3 #define VHOST_IOTLB_ACCESS_FAIL 4 __u8 type; }; #define VHOST_IOTLB_MSG 0x1 struct vhost_msg { int type; union { struct vhost_iotlb_msg iotlb; __u8 padding[64]; }; }; struct vhost_memory_region { __u64 guest_phys_addr; __u64 memory_size; /* bytes */ __u64 userspace_addr; __u64 flags_padding; /* No flags are currently specified. */ }; /* All region addresses and sizes must be 4K aligned. */ #define VHOST_PAGE_SIZE 0x1000 struct vhost_memory { __u32 nregions; __u32 padding; struct vhost_memory_region regions[0]; }; /* ioctls */ #define VHOST_VIRTIO 0xAF /* Features bitmask for forward compatibility. Transport bits are used for * vhost specific features. */ #define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, __u64) #define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, __u64) /* Set current process as the (exclusive) owner of this file descriptor. This * must be called before any other vhost command. Further calls to * VHOST_OWNER_SET fail until VHOST_OWNER_RESET is called. */ #define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01) /* Give up ownership, and reset the device to default values. * Allows subsequent call to VHOST_OWNER_SET to succeed. */ #define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02) /* Set up/modify memory layout */ #define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory) /* Write logging setup. */ /* Memory writes can optionally be logged by setting bit at an offset * (calculated from the physical address) from specified log base. * The bit is set using an atomic 32 bit operation. */ /* Set base address for logging. */ #define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64) /* Specify an eventfd file descriptor to signal on log write. */ #define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int) /* Ring setup. */ /* Set number of descriptors in ring. This parameter can not * be modified while ring is running (bound to a device). */ #define VHOST_SET_VRING_NUM _IOW(VHOST_VIRTIO, 0x10, struct vhost_vring_state) /* Set addresses for the ring. */ #define VHOST_SET_VRING_ADDR _IOW(VHOST_VIRTIO, 0x11, struct vhost_vring_addr) /* Base value where queue looks for available descriptors */ #define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, struct vhost_vring_state) /* Get accessor: reads index, writes value in num */ #define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, struct vhost_vring_state) /* Set the vring byte order in num. Valid values are VHOST_VRING_LITTLE_ENDIAN * or VHOST_VRING_BIG_ENDIAN (other values return -EINVAL). * The byte order cannot be changed while the device is active: trying to do so * returns -EBUSY. * This is a legacy only API that is simply ignored when VIRTIO_F_VERSION_1 is * set. * Not all kernel configurations support this ioctl, but all configurations that * support SET also support GET. */ #define VHOST_VRING_LITTLE_ENDIAN 0 #define VHOST_VRING_BIG_ENDIAN 1 #define VHOST_SET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x13, struct vhost_vring_state) #define VHOST_GET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x14, struct vhost_vring_state) /* The following ioctls use eventfd file descriptors to signal and poll * for events. */ /* Set eventfd to poll for added buffers */ #define VHOST_SET_VRING_KICK _IOW(VHOST_VIRTIO, 0x20, struct vhost_vring_file) /* Set eventfd to signal when buffers have beed used */ #define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, struct vhost_vring_file) /* Set eventfd to signal an error */ #define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, struct vhost_vring_file) /* Set busy loop timeout (in us) */ #define VHOST_SET_VRING_BUSYLOOP_TIMEOUT _IOW(VHOST_VIRTIO, 0x23, \ struct vhost_vring_state) /* Get busy loop timeout (in us) */ #define VHOST_GET_VRING_BUSYLOOP_TIMEOUT _IOW(VHOST_VIRTIO, 0x24, \ struct vhost_vring_state) /* VHOST_NET specific defines */ /* Attach virtio net ring to a raw socket, or tap device. * The socket must be already bound to an ethernet device, this device will be * used for transmit. Pass fd -1 to unbind from the socket and the transmit * device. This can be used to stop the ring (e.g. for migration). */ #define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct vhost_vring_file) /* Feature bits */ /* Log all write descriptors. Can be changed while device is active. */ #define VHOST_F_LOG_ALL 26 /* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */ #define VHOST_NET_F_VIRTIO_NET_HDR 27 /* Vhost have device IOTLB */ #define VHOST_F_DEVICE_IOTLB 63 /* VHOST_SCSI specific definitions */ /* * Used by QEMU userspace to ensure a consistent vhost-scsi ABI. * * ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate + * RFC-v2 vhost-scsi userspace. Add GET_ABI_VERSION ioctl usage * ABI Rev 1: January 2013. Ignore vhost_tpgt filed in struct vhost_scsi_target. * All the targets under vhost_wwpn can be seen and used by guset. */ #define VHOST_SCSI_ABI_VERSION 1 struct vhost_scsi_target { int abi_version; char vhost_wwpn[224]; /* TRANSPORT_IQN_LEN */ unsigned short vhost_tpgt; unsigned short reserved; }; #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target) #define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) /* Changing this breaks userspace. */ #define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int) /* Set and get the events missed flag */ #define VHOST_SCSI_SET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x43, __u32) #define VHOST_SCSI_GET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x44, __u32) /* VHOST_VSOCK specific defines */ #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) #endif
[+]
..
[-] sysinfo.h
[edit]
[-] mroute.h
[edit]
[-] if_eql.h
[edit]
[-] serial_core.h
[edit]
[-] membarrier.h
[edit]
[-] sched.h
[edit]
[-] mei.h
[edit]
[-] bfs_fs.h
[edit]
[-] atmlec.h
[edit]
[-] v4l2-mediabus.h
[edit]
[-] videodev2.h
[edit]
[-] screen_info.h
[edit]
[-] if_slip.h
[edit]
[-] uuid.h
[edit]
[-] version.h
[edit]
[-] ipv6_route.h
[edit]
[-] ixjuser.h
[edit]
[-] pkt_cls.h
[edit]
[-] atm_he.h
[edit]
[-] raw.h
[edit]
[-] msdos_fs.h
[edit]
[-] mman.h
[edit]
[-] aio_abi.h
[edit]
[-] reboot.h
[edit]
[-] snmp.h
[edit]
[-] atm_eni.h
[edit]
[-] netfilter_bridge.h
[edit]
[-] patchkey.h
[edit]
[-] string.h
[edit]
[-] socket.h
[edit]
[+]
spi
[-] auxvec.h
[edit]
[-] sockios.h
[edit]
[-] keyboard.h
[edit]
[-] scc.h
[edit]
[-] dn.h
[edit]
[-] unistd.h
[edit]
[-] oom.h
[edit]
[-] pkt_sched.h
[edit]
[-] if_phonet.h
[edit]
[+]
byteorder
[-] if_arcnet.h
[edit]
[+]
caif
[-] fd.h
[edit]
[-] radeonfb.h
[edit]
[-] qnx4_fs.h
[edit]
[-] nfs2.h
[edit]
[-] magic.h
[edit]
[-] target_core_user.h
[edit]
[-] atm_zatm.h
[edit]
[-] pci.h
[edit]
[-] nfsacl.h
[edit]
[-] if_packet.h
[edit]
[-] arcfb.h
[edit]
[-] nfs_mount.h
[edit]
[-] fib_rules.h
[edit]
[-] atmsap.h
[edit]
[+]
dvb
[-] cciss_defs.h
[edit]
[+]
netfilter_ipv6
[-] atmdev.h
[edit]
[-] kexec.h
[edit]
[-] ipc.h
[edit]
[-] sock_diag.h
[edit]
[+]
wimax
[-] serial.h
[edit]
[-] if_link.h
[edit]
[-] route.h
[edit]
[-] if_bonding.h
[edit]
[-] auto_fs.h
[edit]
[-] pg.h
[edit]
[-] l2tp.h
[edit]
[-] perf_event.h
[edit]
[-] tcp_metrics.h
[edit]
[-] v4l2-controls.h
[edit]
[-] personality.h
[edit]
[-] dcbnl.h
[edit]
[-] netfilter_arp.h
[edit]
[-] toshiba.h
[edit]
[-] memfd.h
[edit]
[-] resource.h
[edit]
[-] tipc.h
[edit]
[-] virtio_vsock.h
[edit]
[-] atm_tcp.h
[edit]
[-] cn_proc.h
[edit]
[-] utime.h
[edit]
[-] nbd.h
[edit]
[-] netfilter_ipv6.h
[edit]
[-] meye.h
[edit]
[-] gfs2_ondisk.h
[edit]
[-] som.h
[edit]
[-] ncp_mount.h
[edit]
[-] coda.h
[edit]
[-] hw_breakpoint.h
[edit]
[-] shm.h
[edit]
[-] wanrouter.h
[edit]
[-] kernel-page-flags.h
[edit]
[-] auto_fs4.h
[edit]
[-] ppp_defs.h
[edit]
[-] tty.h
[edit]
[-] sysctl.h
[edit]
[-] joystick.h
[edit]
[-] ip.h
[edit]
[-] jffs2.h
[edit]
[-] nfs3.h
[edit]
[-] if_infiniband.h
[edit]
[-] agpgart.h
[edit]
[+]
raid
[-] blkpg.h
[edit]
[-] virtio_ids.h
[edit]
[-] udp.h
[edit]
[-] swab.h
[edit]
[-] romfs_fs.h
[edit]
[-] fb.h
[edit]
[-] kvm_para.h
[edit]
[-] btrfs.h
[edit]
[-] efs_fs_sb.h
[edit]
[-] xfrm.h
[edit]
[-] iso_fs.h
[edit]
[-] serial_reg.h
[edit]
[-] virtio_gpu.h
[edit]
[-] sound.h
[edit]
[-] errno.h
[edit]
[-] kernelcapi.h
[edit]
[-] net_tstamp.h
[edit]
[-] isdnif.h
[edit]
[-] hiddev.h
[edit]
[-] ncp_fs.h
[edit]
[-] hdlc.h
[edit]
[-] fcntl.h
[edit]
[-] if.h
[edit]
[-] minix_fs.h
[edit]
[-] hdreg.h
[edit]
[-] virtio_9p.h
[edit]
[-] coff.h
[edit]
[-] elf-em.h
[edit]
[-] mqueue.h
[edit]
[+]
tc_ematch
[-] gameport.h
[edit]
[-] if_ether.h
[edit]
[-] if_addrlabel.h
[edit]
[-] ife.h
[edit]
[-] isdn_divertif.h
[edit]
[-] rds.h
[edit]
[-] fdreg.h
[edit]
[-] pmu.h
[edit]
[-] cuda.h
[edit]
[-] stat.h
[edit]
[-] virtio_net.h
[edit]
[-] posix_types.h
[edit]
[-] cyclades.h
[edit]
[-] baycom.h
[edit]
[-] ipv6.h
[edit]
[-] net_dropmon.h
[edit]
[-] ipmi_msgdefs.h
[edit]
[+]
netfilter_arp
[-] v4l2-subdev.h
[edit]
[-] vsockmon.h
[edit]
[-] neighbour.h
[edit]
[-] sctp.h
[edit]
[-] atmppp.h
[edit]
[-] usbdevice_fs.h
[edit]
[-] dm-ioctl.h
[edit]
[-] netconf.h
[edit]
[-] v4l2-dv-timings.h
[edit]
[-] chio.h
[edit]
[-] msg.h
[edit]
[+]
netfilter_ipv4
[-] netlink.h
[edit]
[-] genetlink.h
[edit]
[-] cgroupstats.h
[edit]
[-] i8k.h
[edit]
[-] cciss_ioctl.h
[edit]
[-] major.h
[edit]
[-] nfs_fs.h
[edit]
[-] rfkill.h
[edit]
[-] atm.h
[edit]
[-] fuse.h
[edit]
[-] fsl_hypervisor.h
[edit]
[-] atalk.h
[edit]
[-] ivtv.h
[edit]
[-] nfs4_mount.h
[edit]
[-] pps.h
[edit]
[-] nubus.h
[edit]
[-] ethtool.h
[edit]
[-] hpet.h
[edit]
[-] atmmpc.h
[edit]
[-] fou.h
[edit]
[-] dccp.h
[edit]
[-] if_pppox.h
[edit]
[-] media.h
[edit]
[-] dm-log-userspace.h
[edit]
[-] ndctl.h
[edit]
[-] wmi.h
[edit]
[-] timex.h
[edit]
[-] mii.h
[edit]
[-] kd.h
[edit]
[-] if_pppol2tp.h
[edit]
[-] uinput.h
[edit]
[-] time.h
[edit]
[-] fadvise.h
[edit]
[-] phonet.h
[edit]
[-] dlm_device.h
[edit]
[-] bpf_perf_event.h
[edit]
[-] quota.h
[edit]
[-] ppdev.h
[edit]
[-] ivtvfb.h
[edit]
[-] if_plip.h
[edit]
[-] net_namespace.h
[edit]
[-] ipmi.h
[edit]
[-] vhost.h
[edit]
[-] v4l2-common.h
[edit]
[-] ultrasound.h
[edit]
[-] lp.h
[edit]
[-] wireless.h
[edit]
[-] keyctl.h
[edit]
[-] atm_idt77105.h
[edit]
[-] bt-bmc.h
[edit]
[-] netrom.h
[edit]
[-] rtc.h
[edit]
[-] types.h
[edit]
[-] qnxtypes.h
[edit]
[-] affs_hardblocks.h
[edit]
[-] if_ppp.h
[edit]
[-] prctl.h
[edit]
[-] firewire-cdev.h
[edit]
[-] sdla.h
[edit]
[-] atmbr2684.h
[edit]
[-] falloc.h
[edit]
[-] connector.h
[edit]
[+]
mmc
[-] rtnetlink.h
[edit]
[-] tty_flags.h
[edit]
[-] bpf.h
[edit]
[-] watchdog.h
[edit]
[-] bsg.h
[edit]
[-] kernel.h
[edit]
[-] reiserfs_fs.h
[edit]
[+]
can
[-] selinux_netlink.h
[edit]
[-] hdlcdrv.h
[edit]
[-] filter.h
[edit]
[-] hidraw.h
[edit]
[-] icmp.h
[edit]
[-] uio.h
[edit]
[-] if_ltalk.h
[edit]
[-] ppp-ioctl.h
[edit]
[-] vtpm_proxy.h
[edit]
[-] elfcore.h
[edit]
[-] limits.h
[edit]
[-] if_tunnel.h
[edit]
[-] if_fddi.h
[edit]
[-] uvcvideo.h
[edit]
[-] ioctl.h
[edit]
[-] capi.h
[edit]
[-] nvme_ioctl.h
[edit]
[-] dlm.h
[edit]
[-] tiocl.h
[edit]
[-] inotify.h
[edit]
[-] poll.h
[edit]
[-] rose.h
[edit]
[-] if_hippi.h
[edit]
[-] matroxfb.h
[edit]
[-] i2o-dev.h
[edit]
[-] tipc_config.h
[edit]
[-] ipsec.h
[edit]
[-] dlm_netlink.h
[edit]
[-] serio.h
[edit]
[-] cdrom.h
[edit]
[-] fanotify.h
[edit]
[-] virtio_blk.h
[edit]
[-] atmioc.h
[edit]
[-] securebits.h
[edit]
[-] bpf_common.h
[edit]
[-] if_team.h
[edit]
[-] omapfb.h
[edit]
[-] pktcdvd.h
[edit]
[-] phantom.h
[edit]
[-] atmapi.h
[edit]
[-] hyperv.h
[edit]
[-] stddef.h
[edit]
[-] vt.h
[edit]
[-] cycx_cfm.h
[edit]
[-] parport.h
[edit]
[-] ptrace.h
[edit]
[-] nfs.h
[edit]
[-] if_bridge.h
[edit]
[+]
netfilter_bridge
[-] unix_diag.h
[edit]
[-] times.h
[edit]
[-] n_r3964.h
[edit]
[-] nl80211.h
[edit]
[-] kvm.h
[edit]
[-] virtio_ring.h
[edit]
[-] bpqether.h
[edit]
[-] ip6_tunnel.h
[edit]
[-] sem.h
[edit]
[-] llc.h
[edit]
[-] omap3isp.h
[edit]
[-] virtio_types.h
[edit]
[-] xattr.h
[edit]
[-] netfilter.h
[edit]
[-] edd.h
[edit]
[-] inet_diag.h
[edit]
[-] vfio.h
[edit]
[-] un.h
[edit]
[-] termios.h
[edit]
[+]
usb
[-] firewire-constants.h
[edit]
[-] nfs4.h
[edit]
[-] atmclip.h
[edit]
[-] devlink.h
[edit]
[-] ip_vs.h
[edit]
[-] nfc.h
[edit]
[-] flat.h
[edit]
[-] elf.h
[edit]
[-] if_x25.h
[edit]
[-] mdio.h
[edit]
[-] isdn_ppp.h
[edit]
[+]
isdn
[-] cm4000_cs.h
[edit]
[-] nvram.h
[edit]
[-] param.h
[edit]
[-] dlm_plock.h
[edit]
[-] virtio_balloon.h
[edit]
[-] telephony.h
[edit]
[-] dlmconstants.h
[edit]
[-] tcp.h
[edit]
[-] futex.h
[edit]
[-] virtio_scsi.h
[edit]
[-] net.h
[edit]
[-] sonypi.h
[edit]
[-] wait.h
[edit]
[-] apm_bios.h
[edit]
[-] if_macsec.h
[edit]
[+]
hsi
[-] gigaset_dev.h
[edit]
[-] capability.h
[edit]
[-] errqueue.h
[edit]
[+]
netfilter
[-] a.out.h
[edit]
[-] utsname.h
[edit]
[-] gen_stats.h
[edit]
[-] kdev_t.h
[edit]
[-] if_vlan.h
[edit]
[-] lwtunnel.h
[edit]
[-] uhid.h
[edit]
[-] i2c-dev.h
[edit]
[-] wimax.h
[edit]
[-] openvswitch.h
[edit]
[-] virtio_input.h
[edit]
[-] sonet.h
[edit]
[+]
hdlc
[-] ppp-comp.h
[edit]
[-] veth.h
[edit]
[-] atmsvc.h
[edit]
[-] netlink_diag.h
[edit]
[-] hid.h
[edit]
[-] const.h
[edit]
[-] psample.h
[edit]
[-] vm_sockets.h
[edit]
[-] i2c.h
[edit]
[-] synclink.h
[edit]
[-] if_arp.h
[edit]
[-] pfkeyv2.h
[edit]
[-] virtio_config.h
[edit]
[-] if_fc.h
[edit]
[-] eventpoll.h
[edit]
[-] binfmts.h
[edit]
[-] soundcard.h
[edit]
[-] in6.h
[edit]
[-] b1lli.h
[edit]
[-] suspend_ioctls.h
[edit]
[-] loop.h
[edit]
[-] seccomp.h
[edit]
[-] blktrace_api.h
[edit]
[-] adfs_fs.h
[edit]
[-] netdevice.h
[edit]
[-] virtio_console.h
[edit]
[-] dqblk_xfs.h
[edit]
[-] netfilter_decnet.h
[edit]
[-] mmtimer.h
[edit]
[-] can.h
[edit]
[-] adb.h
[edit]
[-] acct.h
[edit]
[-] ax25.h
[edit]
[-] coda_psdev.h
[edit]
[-] elf-fdpic.h
[edit]
[-] virtio_rng.h
[edit]
[-] signal.h
[edit]
[-] libc-compat.h
[edit]
[-] taskstats.h
[edit]
[-] ncp_no.h
[edit]
[-] ipx.h
[edit]
[-] userfaultfd.h
[edit]
[-] mempolicy.h
[edit]
[-] icmpv6.h
[edit]
[-] atmarp.h
[edit]
[-] if_frad.h
[edit]
[-] signalfd.h
[edit]
[-] irda.h
[edit]
[-] fiemap.h
[edit]
[-] virtio_pci.h
[edit]
[-] if_cablemodem.h
[edit]
[-] in_route.h
[edit]
[-] mpls.h
[edit]
[-] input.h
[edit]
[-] nfs_idmap.h
[edit]
[-] cramfs_fs.h
[edit]
[-] ptp_clock.h
[edit]
[-] audit.h
[edit]
[-] if_tun.h
[edit]
[-] igmp.h
[edit]
[-] if_alg.h
[edit]
[-] random.h
[edit]
[-] netfilter_ipv4.h
[edit]
[-] atm_nicstar.h
[edit]
[-] packet_diag.h
[edit]
[-] x25.h
[edit]
[+]
tc_act
[-] in.h
[edit]
[-] irqnr.h
[edit]
[-] ncp.h
[edit]
[-] reiserfs_xattr.h
[edit]
[+]
iio
[-] fs.h
[edit]
[-] map_to_7segment.h
[edit]
[+]
sunrpc
[-] if_addr.h
[edit]
[-] mtio.h
[edit]
[+]
nfsd
[-] hysdn_if.h
[edit]
[-] pci_regs.h
[edit]
[-] mroute6.h
[edit]
[-] isdn.h
[edit]
[-] udf_fs_i.h
[edit]