qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 01/15] s390x: fix virtio feature bitmap


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 01/15] s390x: fix virtio feature bitmap
Date: Sun, 10 Apr 2011 21:26:26 +0200

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 <address@hidden>
>> ---
>> 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.


Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]