From: David Gibson <david@gibson.dropbear.id.au>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <famz@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] dataplane: use virtio_ld/st_p() for endian-aware memory access
Date: Wed, 21 Jan 2015 11:17:26 +1100 [thread overview]
Message-ID: <20150121001726.GB27371@voom.fritz.box> (raw)
In-Reply-To: <1421687077-9025-3-git-send-email-stefanha@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]
On Mon, Jan 19, 2015 at 05:04:37PM +0000, Stefan Hajnoczi wrote:
> The vring.c code was written under the assumption that virtio devices
> have the same endianness as the host.
>
> This is wrong when emulating targets that differ in endianness from the
> host.
>
> It is also wrong when emulating bi-endian targets like POWER 8
> processors, which support both little- and big-endian at run-time. In
> this case the virtio device knows which endianness to use.
>
> This change requires the virtio-access.h APIs and therefore builds
> vring.o for each target (obj-y instead of common-obj-y).
>
> Note that $(CONFIG_VIRTIO) for dataplane/ was dropped in
> hw/virtio/Makefile.objs because hw/Makefile.objs conditionally includes
> hw/virtio/ on $(CONFIG_VIRTIO) already.
>
> Only a small change is needed to the vring.h interface: vring_push() now
> takes a VirtIODevice *vdev argument.
>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Fam Zheng <famz@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Without this patch adding an iothread to a secondary virtio-blk disk
caused the kernel to jam up during boot. With this patch it booted
up and I was able to do things with the disk.
I'm still not able to add an iothread to a primary virtio-blk device:
SLOF (guest firmware) gets errors attempting to read the kernel to
boot. However, SLOF is always big endian, so I think that's an
unrelated bug.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Tested-by: David Gibson <david@gibson.dropbear.id.au>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-01-21 0:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 17:04 [Qemu-devel] [PATCH 0/2] dataplane: use endian-aware memory accessors Stefan Hajnoczi
2015-01-19 17:04 ` [Qemu-devel] [PATCH 1/2] dataplane: move vring_more_avail() into vring.c Stefan Hajnoczi
2015-01-20 23:56 ` David Gibson
2015-01-21 13:25 ` Greg Kurz
2015-01-19 17:04 ` [Qemu-devel] [PATCH 2/2] dataplane: use virtio_ld/st_p() for endian-aware memory access Stefan Hajnoczi
2015-01-21 0:17 ` David Gibson [this message]
2015-01-19 17:33 ` [Qemu-devel] [PATCH 0/2] dataplane: use endian-aware memory accessors Cornelia Huck
2015-01-21 13:30 ` Stefan Hajnoczi
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=20150121001726.GB27371@voom.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=famz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--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).