[Top][All Lists]

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

Re: [qemu-s390x] [PATCH 2/3] hw/s390x/css: Remove QEMU_PACKED from struc

From: Thomas Huth
Subject: Re: [qemu-s390x] [PATCH 2/3] hw/s390x/css: Remove QEMU_PACKED from struct SenseId
Date: Tue, 25 Sep 2018 18:43:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 2018-09-25 18:14, Cornelia Huck wrote:
> On Tue, 25 Sep 2018 17:20:08 +0200
> Thomas Huth <address@hidden> wrote:
>> The uint16_t member cu_type of struct SenseId is not naturally aligned,
>> and since the struct is marked with QEMU_PACKED, this can lead to
>> unaligned memory accesses - which does not work on architectures like
>> Sparc. Thus remove the QEMU_PACKED here and rather copy the struct
>> byte by byte when we do copy_sense_id_to_guest().
> Hm... would it look nicer if we chopped up {cu,dev}_type into a hi/lo
> byte and keep the QEMU_PACKED? (The ciws should be ok, I think.)

That will cause some ugly extra logic for the

  VMSTATE_UINT16(cu_type, SenseId)

in css.c instead. I'd like to avoid that, but if you insist, I can have
a try...


reply via email to

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