qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Greg Kurz <gkurz@linux.vnet.ibm.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Juan Quintela" <quintela@redhat.com>,
	"Rusty Russell" <rusty@rustcorp.com.au>,
	qemu-devel@nongnu.org, "Alexander Graf" <agraf@suse.de>,
	aneesh.kumar@linux.vnet.ibm.com,
	"Anthony Liguori" <aliguori@amazon.com>,
	"Amit Shah" <amit.shah@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v9 00/22] legacy virtio support for cross-endian targets
Date: Sun, 29 Jun 2014 18:13:53 +0300	[thread overview]
Message-ID: <20140629151353.GB29448@redhat.com> (raw)
In-Reply-To: <20140624151955.17522.62537.stgit@bahia.local>

On Tue, Jun 24, 2014 at 07:06:58PM +0200, Greg Kurz wrote:
> The current legacy virtio devices have a fundamental flaw: they all share
> data between host and guest with guest endianness ordering. This is ok for
> nearly all architectures that have fixed endianness. Unfortunately, it breaks
> for recent PPC64 and ARM targets that can change endianness at runtime.
> The virtio-1.0 specification fixes the issue by enforcing little-endian
> ordering. It may take some time though until the code for 1.0 gets available
> and supported, and all the users can migrate. There have been discussions
> for some monthes about supporting such oddity: now we have little-endian
> PPC64 distros available, it is worth to propose something.
> 
> This patch set brings legacy virtio support for cross-endian targets. The
> rationale is that we add a new device_endianness property to VirtIODevice.
> This property is used as a runtime indicator to decide wether we should
> do little-endian or big-endian conversion, as opposed to the compile time
> choice we have now with TARGTE_WORDS_BIGENDIAN. The choice was made to
> sample the device endianness out of the endianness mode of the guest
> CPU that does the reset. It is an evil but logical consequence of the
> initial flaw in the virtio specification, and it was agreed that the concept
> would be a good common base for ARM and PPC64 enablement at least. Please
> note also that this new property is state and must be preserved across
> migrations.
> 
> There are several parts in the serie:
> - patches 1 and 2 are simple fixes
> - patches 3 to 9 introduce VMState based subsections in the virtio
>   migration code. This is needed because we introduce a new property
>   in VirtIODevice that we want to migrate without ruining compatibility
>   efforts
> - patches 10 to 13 bring virtio device endianness and memory accessors
>   to be used by the virtio code
> - patches 14 to 20 wire the new memory accessors everywhere accross the
>   virtio code
> - patch 21 is the PPC64 enablement
> - patch 22 is a follow-up workaround to disable vhost-net acceleration
>   in the case the host and guest have different endianness, because
>   it is not supported for the moment
> 
> Changes since v8 are provided in each patch.
> 
> Cheers.

Applied, thanks everyone.

> ---
> 
> Alexander Graf (1):
>       virtio-serial: don't migrate the config space
> 
> Cédric Le Goater (1):
>       virtio-net: byteswap virtio-net header
> 
> Greg Kurz (14):
>       virtio: introduce device specific migration calls
>       virtio-net: implement per-device migration calls
>       virtio-blk: implement per-device migration calls
>       virtio-serial: implement per-device migration calls
>       virtio-balloon: implement per-device migration calls
>       virtio-rng: implement per-device migration calls
>       virtio: add subsections to the migration stream
>       exec: introduce target_words_bigendian() helper
>       cpu: introduce CPUClass::virtio_is_big_endian()
>       virtio: add endian-ambivalent support to VirtIODevice
>       virtio: memory accessors for endian-ambivalent targets
>       virtio-9p: use virtio wrappers to access headers
>       target-ppc: enable virtio endian ambivalent support
>       vhost-net: disable when cross-endian
> 
> Rusty Russell (6):
>       virtio: allow byte swapping for vring
>       virtio-net: use virtio wrappers to access headers
>       virtio-balloon: use virtio wrappers to access page frame numbers
>       virtio-blk: use virtio wrappers to access headers
>       virtio-scsi: use virtio wrappers to access headers
>       virtio-serial-bus: use virtio wrappers to access headers
> 
> 
>  exec.c                            |    8 -
>  hw/9pfs/virtio-9p-device.c        |    3 -
>  hw/block/virtio-blk.c             |   62 ++++++-----
>  hw/char/virtio-serial-bus.c       |   94 ++++++++++------
>  hw/net/vhost_net.c                |   19 +++
>  hw/net/virtio-net.c               |   56 +++++++---
>  hw/scsi/virtio-scsi.c             |   40 ++++---
>  hw/virtio/virtio-balloon.c        |   33 +++---
>  hw/virtio/virtio-pci.c            |   11 +-
>  hw/virtio/virtio-rng.c            |   12 +-
>  hw/virtio/virtio.c                |  216 ++++++++++++++++++++++++++++---------
>  include/hw/virtio/virtio-access.h |  170 +++++++++++++++++++++++++++++
>  include/hw/virtio/virtio.h        |   17 +++
>  include/qom/cpu.h                 |    1 
>  qom/cpu.c                         |    6 +
>  target-ppc/cpu.h                  |    2 
>  target-ppc/translate_init.c       |   15 +++
>  17 files changed, 583 insertions(+), 182 deletions(-)
>  create mode 100644 include/hw/virtio/virtio-access.h
> 
> --
> Greg

  parent reply	other threads:[~2014-06-29 15:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 17:06 [Qemu-devel] [PATCH v9 00/22] legacy virtio support for cross-endian targets Greg Kurz
2014-06-24 17:11 ` [Qemu-devel] [PATCH v9 01/22] virtio-net: byteswap virtio-net header Greg Kurz
2014-06-24 17:13 ` [Qemu-devel] [PATCH v9 02/22] virtio-serial: don't migrate the config space Greg Kurz
2014-06-26  9:57   ` Amit Shah
2014-06-24 17:15 ` [Qemu-devel] [PATCH v9 03/22] virtio: introduce device specific migration calls Greg Kurz
2014-06-24 17:19 ` [Qemu-devel] [PATCH v9 04/22] virtio-net: implement per-device " Greg Kurz
2014-06-24 17:19 ` [Qemu-devel] [PATCH v9 05/22] virtio-blk: " Greg Kurz
2014-06-24 17:19 ` [Qemu-devel] [PATCH v9 06/22] virtio-serial: " Greg Kurz
2014-06-24 17:20 ` [Qemu-devel] [PATCH v9 07/22] virtio-balloon: " Greg Kurz
2014-06-24 17:20 ` [Qemu-devel] [PATCH v9 08/22] virtio-rng: " Greg Kurz
2014-06-24 17:22 ` [Qemu-devel] [PATCH v9 09/22] virtio: add subsections to the migration stream Greg Kurz
2014-06-24 17:25 ` [Qemu-devel] [PATCH v9 00/22] legacy virtio support for cross-endian targets Michael S. Tsirkin
2014-06-24 18:16   ` Greg Kurz
2014-06-24 17:26 ` [Qemu-devel] [PATCH v9 10/22] exec: introduce target_words_bigendian() helper Greg Kurz
2014-06-24 17:33 ` [Qemu-devel] [PATCH v9 11/22] cpu: introduce CPUClass::virtio_is_big_endian() Greg Kurz
2014-06-24 17:38 ` [Qemu-devel] [PATCH v9 12/22] virtio: add endian-ambivalent support to VirtIODevice Greg Kurz
2014-06-24 17:39 ` [Qemu-devel] [PATCH v9 13/22] virtio: memory accessors for endian-ambivalent targets Greg Kurz
2014-06-24 17:40 ` [Qemu-devel] [PATCH v9 14/22] virtio: allow byte swapping for vring Greg Kurz
2014-06-24 17:42 ` [Qemu-devel] [PATCH v9 15/22] virtio-net: use virtio wrappers to access headers Greg Kurz
2014-06-24 17:43 ` [Qemu-devel] [PATCH v9 16/22] virtio-balloon: use virtio wrappers to access page frame numbers Greg Kurz
2014-06-24 17:43 ` [Qemu-devel] [PATCH v9 17/22] virtio-blk: use virtio wrappers to access headers Greg Kurz
2014-06-24 17:48 ` [Qemu-devel] [PATCH v9 18/22] virtio-scsi: " Greg Kurz
2014-06-24 17:49 ` [Qemu-devel] [PATCH v9 19/22] virtio-serial-bus: " Greg Kurz
2014-06-24 17:49 ` [Qemu-devel] [PATCH v9 20/22] virtio-9p: " Greg Kurz
2014-06-24 17:51 ` [Qemu-devel] [PATCH v9 21/22] target-ppc: enable virtio endian ambivalent support Greg Kurz
2014-06-24 17:55 ` [Qemu-devel] [PATCH v9 22/22] vhost-net: disable when cross-endian Greg Kurz
2014-06-29 15:07   ` Michael S. Tsirkin
2014-06-29 15:13 ` Michael S. Tsirkin [this message]
2014-06-29 16:02   ` [Qemu-devel] [PATCH v9 00/22] legacy virtio support for cross-endian targets Alexander Graf
2014-06-30  6:48   ` Greg Kurz

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=20140629151353.GB29448@redhat.com \
    --to=mst@redhat.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aliguori@amazon.com \
    --cc=amit.shah@redhat.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=stefanha@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 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).