[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-am
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio. |
Date: |
Wed, 19 Feb 2014 00:02:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Am 18.02.2014 15:48, schrieb Alexander Graf:
> On 02/18/2014 01:38 PM, Greg Kurz wrote:
>> From: Rusty Russell <address@hidden>
>>
>> virtio data structures are defined as "target endian", which assumes
>> that's a fixed value. In fact, that actually means it's
>> platform-specific.
>>
>> The OASIS virtio 1.0 spec will fix this. Meanwhile, create a hook for
>> little endian ppc (and potentially ARM). This is called at device
>> reset time (which is done before any driver is loaded) since it
>> may involve a system call to get the status when running under kvm.
>>
>> [ fixed checkpatch.pl error with the virtio_byteswap initialisation,
>> ldq_phys() API change, Greg Kurz <address@hidden> ]
>> Signed-off-by: Rusty Russell <address@hidden>
>> Signed-off-by: Greg Kurz <address@hidden>
>> ---
>> hw/virtio/virtio.c | 6 ++
>> include/hw/virtio/virtio-access.h | 132
>> +++++++++++++++++++++++++++++++++++++
>> include/hw/virtio/virtio.h | 2 +
>> stubs/Makefile.objs | 1
>> stubs/virtio_get_byteswap.c | 6 ++
>> 5 files changed, 147 insertions(+)
>> create mode 100644 include/hw/virtio/virtio-access.h
>> create mode 100644 stubs/virtio_get_byteswap.c
>>
>> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
>> index aeabf3a..4fd6ac2 100644
>> --- a/hw/virtio/virtio.c
>> +++ b/hw/virtio/virtio.c
>> @@ -19,6 +19,9 @@
>> #include "hw/virtio/virtio.h"
>> #include "qemu/atomic.h"
>> #include "hw/virtio/virtio-bus.h"
>> +#include "hw/virtio/virtio-access.h"
>> +
>> +bool virtio_byteswap;
>
> Could this be a virtio object property rather than a global? Imagine an
> AMP guest system with a BE and an LE system running in parallel
> accessing two separate virtio devices. With a single global that would
> break.
Déjà vu... ;)
http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg01043.html
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio., (continued)
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio., Cornelia Huck, 2014/02/18
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio., Cornelia Huck, 2014/02/18
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio., Alexander Graf, 2014/02/18
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio., Cornelia Huck, 2014/02/18
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio., Alexander Graf, 2014/02/18
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio., Rusty Russell, 2014/02/20
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio.,
Andreas Färber <=
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio., Andreas Färber, 2014/02/18
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio., Greg Kurz, 2014/02/19
- Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio., Rusty Russell, 2014/02/20
- [Qemu-devel] [PATCH 2/8] virtio: allow byte swapping for vring and config access, Greg Kurz, 2014/02/18
- Re: [Qemu-devel] [PATCH 2/8] virtio: allow byte swapping for vring and config access, Cornelia Huck, 2014/02/18
- Re: [Qemu-devel] [PATCH 2/8] virtio: allow byte swapping for vring and config access, Greg Kurz, 2014/02/18
- [Qemu-devel] [PATCH 3/8] hw/net/virtio-net: use virtio wrappers to access headers., Greg Kurz, 2014/02/18
- [Qemu-devel] [PATCH 4/8] hw/net/virtio-balloon: use virtio wrappers to access page frame numbers., Greg Kurz, 2014/02/18
- [Qemu-devel] [PATCH 6/8] hw/scsi/virtio-scsi: use virtio wrappers to access headers., Greg Kurz, 2014/02/18
- [Qemu-devel] [PATCH 5/8] hw/block/virtio-blk: use virtio wrappers to access headers., Greg Kurz, 2014/02/18