linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Bjarke Istrup Pedersen <gurligebis@gentoo.org>,
	rusty@au1.ibm.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	linux-api@vger.kernel.org, pbonzini@redhat.com,
	David Miller <davem@davemloft.net>,
	Alexei Starovoitov <ast@plumgrid.com>
Subject: Re: [PATCH v4 05/42] virtio: memory access APIs
Date: Tue, 25 Nov 2014 18:42:38 +0100	[thread overview]
Message-ID: <20141125184238.0a4436f8.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1416933600-21398-6-git-send-email-mst@redhat.com>

On Tue, 25 Nov 2014 18:41:42 +0200
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> virtio 1.0 makes all memory structures LE, so
> we need APIs to conditionally do a byteswap on BE
> architectures.
> 
> To make it easier to check code statically,
> add virtio specific types for multi-byte integers
> in memory.
> 
> Add low level wrappers that do a byteswap conditionally, these will be
> useful e.g. for vhost.  Add high level wrappers that
> query device endian-ness and act accordingly.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  include/linux/virtio_byteorder.h  | 59 +++++++++++++++++++++++++++++++++++++++
>  include/linux/virtio_config.h     | 32 +++++++++++++++++++++
>  include/uapi/linux/virtio_ring.h  | 45 ++++++++++++++---------------
>  include/uapi/linux/virtio_types.h | 48 +++++++++++++++++++++++++++++++
>  include/uapi/linux/Kbuild         |  1 +
>  5 files changed, 163 insertions(+), 22 deletions(-)
>  create mode 100644 include/linux/virtio_byteorder.h
>  create mode 100644 include/uapi/linux/virtio_types.h
> 
> diff --git a/include/linux/virtio_byteorder.h b/include/linux/virtio_byteorder.h
> new file mode 100644
> index 0000000..824ed0b
> --- /dev/null
> +++ b/include/linux/virtio_byteorder.h
> @@ -0,0 +1,59 @@
> +#ifndef _LINUX_VIRTIO_BYTEORDER_H
> +#define _LINUX_VIRTIO_BYTEORDER_H
> +#include <linux/types.h>
> +#include <uapi/linux/virtio_types.h>
> +
> +/*
> + * Memory accessors for handling virtio in modern little endian and in

"Low-level memory accessors"?

> + * compatibility native endian format.
> + */
(...)
> diff --git a/include/uapi/linux/virtio_types.h b/include/uapi/linux/virtio_types.h
> new file mode 100644
> index 0000000..b90385f
> --- /dev/null
> +++ b/include/uapi/linux/virtio_types.h
> @@ -0,0 +1,48 @@
> +#ifndef _UAPI_LINUX_VIRTIO_TYPES_H
> +#define _UAPI_LINUX_VIRTIO_TYPES_H
> +/* An interface for efficient virtio implementation, currently for use by KVM
> + * and lguest, but hopefully others soon.  

You probably copied this from the existing virtio header, didn't you?

What about simply:

"Type definitions for virtio implementations."

(and then the remaining text)

> Do NOT change this since it will
> + * break existing servers and clients.
> + *
> + * This header is BSD licensed so anyone can use the definitions to implement
> + * compatible drivers/servers.
(...)

  reply	other threads:[~2014-11-25 17:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1416933600-21398-1-git-send-email-mst@redhat.com>
2014-11-25 16:41 ` [PATCH v4 03/42] virtio: add virtio 1.0 feature bit Michael S. Tsirkin
2014-11-25 16:41 ` [PATCH v4 05/42] virtio: memory access APIs Michael S. Tsirkin
2014-11-25 17:42   ` Cornelia Huck [this message]
2014-11-25 16:42 ` [PATCH v4 09/42] virtio: set FEATURES_OK Michael S. Tsirkin
2014-11-25 17:48   ` Cornelia Huck
2014-11-25 21:38     ` Michael S. Tsirkin
2014-11-26  9:18       ` Cornelia Huck
2014-11-25 16:42 ` [PATCH v4 12/42] virtio_net: v1.0 endianness Michael S. Tsirkin
2014-11-25 16:42 ` [PATCH v4 13/42] virtio_blk: v1.0 support Michael S. Tsirkin
     [not found]   ` <1416933600-21398-14-git-send-email-mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-25 17:55     ` Cornelia Huck
2014-11-25 21:43       ` Michael S. Tsirkin
2014-11-26 15:40         ` David Hildenbrand
2014-11-26 15:48           ` Michael S. Tsirkin
     [not found] ` <1416933600-21398-1-git-send-email-mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-25 16:43   ` [PATCH v4 33/42] tun: move internal flag defines out of uapi Michael S. Tsirkin
2014-11-25 16:43   ` [PATCH v4 35/42] tun: add VNET_LE flag Michael S. Tsirkin
2014-11-25 16:44 ` [PATCH v4 40/42] virtio_scsi: export to userspace Michael S. Tsirkin

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=20141125184238.0a4436f8.cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=ast@plumgrid.com \
    --cc=davem@davemloft.net \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gurligebis@gentoo.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rusty@au1.ibm.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).