From: "Michael S. Tsirkin" <mst@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: "Ingo Molnar" <mingo@kernel.org>,
"Clark Williams" <williams@redhat.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
"Arnaldo Carvalho de Melo" <acme@redhat.com>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"Jiri Olsa" <jolsa@kernel.org>,
"Luis Cláudio Gonçalves" <lclaudio@redhat.com>,
"Namhyung Kim" <namhyung@kernel.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Wang Nan" <wangnan0@huawei.com>
Subject: Re: [PATCH 16/16] tools include uapi: Sync linux/vhost.h with the kernel sources
Date: Tue, 8 Jan 2019 23:10:10 -0500 [thread overview]
Message-ID: <20190108230822-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20190108195910.17726-17-acme@kernel.org>
On Tue, Jan 08, 2019 at 04:59:10PM -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> To get the changes in:
>
> 4b86713236e4 ("vhost: split structs into a separate header file")
>
> Silencing this perf build warning:
>
> Warning: Kernel ABI header at 'tools/include/uapi/linux/vhost.h' differs from latest version at 'include/uapi/linux/vhost.h'
> diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
>
> Those didn't touch things used in tools, i.e. the following continues
> working:
>
> $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh
> static const char *vhost_virtio_ioctl_cmds[] = {
> [0x00] = "SET_FEATURES",
> [0x01] = "SET_OWNER",
> [0x02] = "RESET_OWNER",
> [0x03] = "SET_MEM_TABLE",
> [0x04] = "SET_LOG_BASE",
> [0x07] = "SET_LOG_FD",
> [0x10] = "SET_VRING_NUM",
> [0x11] = "SET_VRING_ADDR",
> [0x12] = "SET_VRING_BASE",
> [0x13] = "SET_VRING_ENDIAN",
> [0x14] = "GET_VRING_ENDIAN",
> [0x20] = "SET_VRING_KICK",
> [0x21] = "SET_VRING_CALL",
> [0x22] = "SET_VRING_ERR",
> [0x23] = "SET_VRING_BUSYLOOP_TIMEOUT",
> [0x24] = "GET_VRING_BUSYLOOP_TIMEOUT",
> [0x25] = "SET_BACKEND_FEATURES",
> [0x30] = "NET_SET_BACKEND",
> [0x40] = "SCSI_SET_ENDPOINT",
> [0x41] = "SCSI_CLEAR_ENDPOINT",
> [0x42] = "SCSI_GET_ABI_VERSION",
> [0x43] = "SCSI_SET_EVENTS_MISSED",
> [0x44] = "SCSI_GET_EVENTS_MISSED",
> [0x60] = "VSOCK_SET_GUEST_CID",
> [0x61] = "VSOCK_SET_RUNNING",
> };
> static const char *vhost_virtio_ioctl_read_cmds[] = {
> [0x00] = "GET_FEATURES",
> [0x12] = "GET_VRING_BASE",
> [0x26] = "GET_BACKEND_FEATURES",
> };
> $
>
> At some point in the eBPFication of perf, using something like:
>
> # perf trace -e ioctl(cmd=VHOST_VRING*)
>
> Will setup a BPF filter right at the raw_syscalls:sys_enter tracepoint,
> i.e. filtering at the origin.
>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Wang Nan <wangnan0@huawei.com>
> Link: https://lkml.kernel.org/n/tip-g28usrt7l59lwq3wuh8vzbig@git.kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> tools/include/uapi/linux/vhost.h | 113 +------------------------------
> 1 file changed, 2 insertions(+), 111 deletions(-)
> diff --git a/tools/include/uapi/linux/vhost.h b/tools/include/uapi/linux/vhost.h
> index 84c3de89696a..40d028eed645 100644
> --- a/tools/include/uapi/linux/vhost.h
> +++ b/tools/include/uapi/linux/vhost.h
> @@ -11,94 +11,9 @@
> * device configuration.
> */
>
> +#include <linux/vhost_types.h>
Don't you then also need to import vhost_types.h?
> #include <linux/types.h>
> -#include <linux/compiler.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
> -#define VHOST_IOTLB_MSG_V2 0x2
> -
> -struct vhost_msg {
> - int type;
> - union {
> - struct vhost_iotlb_msg iotlb;
> - __u8 padding[64];
> - };
> -};
> -
> -struct vhost_msg_v2 {
> - __u32 type;
> - __u32 reserved;
> - 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 */
>
> @@ -186,31 +101,7 @@ struct vhost_memory {
> * 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_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;
> -};
> +/* VHOST_SCSI specific defines */
>
> #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)
> --
> 2.20.1
next prev parent reply other threads:[~2019-01-09 4:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-08 19:58 [GIT PULL 00/16] perf/core fixes and improvements Arnaldo Carvalho de Melo
2019-01-08 19:58 ` [PATCH 01/16] perf trace: Fix ')' placement in "interrupted" syscall lines Arnaldo Carvalho de Melo
2019-01-08 19:58 ` [PATCH 02/16] perf trace: Fix alignment for [continued] lines Arnaldo Carvalho de Melo
2019-01-08 19:58 ` [PATCH 03/16] perf tools: Make find_vdso_map() more modular Arnaldo Carvalho de Melo
2019-01-08 19:58 ` [PATCH 04/16] perf tests: Add a test for the ARM 32-bit [vectors] page Arnaldo Carvalho de Melo
2019-01-08 19:58 ` [PATCH 05/16] tools lib traceevent: Introduce new libtracevent API: tep_override_comm() Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 06/16] tools lib traceevent: Initialize host_bigendian at tep_handle allocation Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 07/16] tools lib traceevent: Rename struct cmdline to struct tep_cmdline Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 08/16] tools lib traceevent: Changed return logic of trace_seq_printf() and trace_seq_vprintf() APIs Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 09/16] tools lib traceevent: Changed return logic of tep_register_event_handler() API Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 10/16] tools lib traceevent: Rename tep_is_file_bigendian() to tep_file_bigendian() Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 11/16] tools lib traceevent: Remove tep_data_event_from_type() API Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 12/16] perf top: Lift restriction on using callchains without "sym" in --sort Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 13/16] tools include uapi: Grab a copy of linux/mount.h Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 14/16] perf beauty: Switch from using uapi/linux/fs.h to uapi/linux/mount.h Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 15/16] tools include uapi: Sync linux/fs.h copy with the kernel sources Arnaldo Carvalho de Melo
2019-01-08 19:59 ` [PATCH 16/16] tools include uapi: Sync linux/vhost.h " Arnaldo Carvalho de Melo
2019-01-09 4:10 ` Michael S. Tsirkin [this message]
2019-01-09 13:11 ` Arnaldo Carvalho de Melo
2019-01-09 7:05 ` [GIT PULL 00/16] perf/core fixes and improvements Ingo Molnar
2019-01-09 13:04 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190108230822-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=jolsa@kernel.org \
--cc=lclaudio@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=pbonzini@redhat.com \
--cc=wangnan0@huawei.com \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.