From: Aurelien Jarno <aurelien@aurel32.net>
To: Alexander Graf <agraf@suse.de>
Cc: peter.maydell@linaro.org,
QEMU-devel Developers <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 01/15] s390x: fix virtio feature bitmap
Date: Sun, 10 Apr 2011 22:26:07 +0200 [thread overview]
Message-ID: <20110410202607.GI4551@volta.aurel32.net> (raw)
In-Reply-To: <A6348A14-1D5D-44D5-94E0-25694A162C79@suse.de>
On Sun, Apr 10, 2011 at 10:11:15PM +0200, Alexander Graf wrote:
>
> On 10.04.2011, at 22:06, Aurelien Jarno wrote:
>
> > On Sun, Apr 10, 2011 at 09:26:26PM +0200, Alexander Graf wrote:
> >>
> >> On 10.04.2011, at 21:25, Aurelien Jarno wrote:
> >>
> >>> On Mon, Apr 04, 2011 at 04:32:10PM +0200, Alexander Graf wrote:
> >>>> The feature bitmap in the s390 virtio machine is little endian. To
> >>>> address for that, we need to bswap the values after reading them out.
> >>>>
> >>>> Signed-off-by: Alexander Graf <agraf@suse.de>
> >>>> ---
> >>>> hw/s390-virtio-bus.c | 4 ++--
> >>>> 1 files changed, 2 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
> >>>> index 58af164..60e0135 100644
> >>>> --- a/hw/s390-virtio-bus.c
> >>>> +++ b/hw/s390-virtio-bus.c
> >>>> @@ -223,7 +223,7 @@ void s390_virtio_device_sync(VirtIOS390Device *dev)
> >>>> cur_offs += num_vq * VIRTIO_VQCONFIG_LEN;
> >>>>
> >>>> /* Sync feature bitmap */
> >>>> - stl_phys(cur_offs, dev->host_features);
> >>>> + stl_phys(cur_offs, bswap32(dev->host_features));
> >>>
> >>> Is bswap32 correct here for both big and little endian guests? I don't
> >>> really understand the reason why a bswap is needed here, especially
> >>> given that AFAIK this code was already used when using KVM.
> >>
> >> This is target specific code. The s390-virtio-bus is s390 specific. And yes, the code was also broken with KVM. That's how I first found it actually.
> >>
> >
> > So in short, s390-virtio-bus is specific to big endian machines, but is
> > using little endian? That looks a bit weired. I guess it's probably to
> > late to change the specification anyway...
>
> Yeah. In fact, it mixes big and little endian pieces. But it really is too late to change the (unwritten) spec, unfortunately.
>
Ok, thanks for the explanations, I have applied it.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2011-04-10 20:26 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-04 14:32 [Qemu-devel] [PATCH 00/15] s390x emulation support v3 Alexander Graf
2011-04-04 14:32 ` [Qemu-devel] [PATCH 01/15] s390x: fix virtio feature bitmap Alexander Graf
2011-04-10 19:25 ` Aurelien Jarno
2011-04-10 19:26 ` Alexander Graf
2011-04-10 20:06 ` Aurelien Jarno
2011-04-10 20:11 ` Alexander Graf
2011-04-10 20:26 ` Aurelien Jarno [this message]
2011-04-04 14:32 ` [Qemu-devel] [PATCH 02/15] s390x: set alignment for long to 8 Alexander Graf
2011-04-10 19:25 ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 03/15] s390x: s390x-linux-user support Alexander Graf
2011-04-10 20:16 ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 04/15] linux-user: define a couple of syscalls for non-uid16 targets Alexander Graf
2011-04-10 20:25 ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 05/15] s390x: Enable s390x-softmmu target Alexander Graf
2011-04-10 20:34 ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 06/15] s390x: Dispatch interrupts to KVM or the real CPU Alexander Graf
2011-04-10 20:37 ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 07/15] s390x: Adjust GDB stub Alexander Graf
2011-04-10 20:39 ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 08/15] s390x: virtio machine storage keys Alexander Graf
2011-04-10 20:41 ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 09/15] s390x: Prepare cpu.h for emulation Alexander Graf
2011-04-12 21:32 ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 10/15] s390x: helper functions for system emulation Alexander Graf
2011-04-12 21:32 ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 11/15] s390x: Implement opcode helpers Alexander Graf
2011-04-12 21:32 ` Aurelien Jarno
2011-04-13 5:20 ` Alexander Graf
2011-04-04 14:32 ` [Qemu-devel] [PATCH 12/15] s390x: Adjust internal kvm code Alexander Graf
2011-04-12 21:32 ` Aurelien Jarno
2011-04-04 14:32 ` [Qemu-devel] [PATCH 13/15] s390x: translate engine for s390x CPU Alexander Graf
2011-04-04 14:32 ` [Qemu-devel] [PATCH 14/15] s390x: build s390x by default Alexander Graf
2011-04-04 14:32 ` [Qemu-devel] [PATCH 15/15] tcg: use ext op for deposit Alexander Graf
2011-04-05 4:54 ` Aurelien Jarno
2011-04-05 7:55 ` Alexander Graf
2011-04-10 19:23 ` Aurelien Jarno
2011-04-10 19:25 ` Alexander Graf
2011-04-10 20:08 ` Aurelien Jarno
2011-04-10 20:17 ` Alexander Graf
2011-04-10 20:28 ` Aurelien Jarno
2011-04-14 16:27 ` Alexander Graf
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=20110410202607.GI4551@volta.aurel32.net \
--to=aurelien@aurel32.net \
--cc=agraf@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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.