On Tue, 25 Sep 2018 18:43:22 +0200 Thomas Huth <th...@redhat.com> wrote:
> On 2018-09-25 18:14, Cornelia Huck wrote: > > On Tue, 25 Sep 2018 17:20:08 +0200 > > Thomas Huth <th...@redhat.com> 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... That's why I asked "would it look nicer?" :) If it doesn't (ugly vmstate stuff), just disregard my idea.