qemu-s390x
[Top][All Lists]
Advanced

[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: Cornelia Huck
Subject: Re: [qemu-s390x] [PATCH 2/3] hw/s390x/css: Remove QEMU_PACKED from struct SenseId
Date: Tue, 25 Sep 2018 18:48:20 +0200

On Tue, 25 Sep 2018 18:43:22 +0200
Thomas Huth <address@hidden> wrote:

> 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...

That's why I asked "would it look nicer?" :) If it doesn't (ugly
vmstate stuff), just disregard my idea.



reply via email to

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