Hey, On Wed, Nov 18, 2015 at 04:03:16PM +0300, Anton D. Kachalov wrote: > Hello. > > consume_* in parse_msgc_display_init() > > and a number of: > > spice_marshaller_add_int32 > spice_marshaller_add_uint16 > spice_marshaller_add_uint64 > spice_marshaller_add_uint32 > Ah right, these would cause issues. I don't know why, I was sure I saw alignment-safe functions when I looked at these. Replacing write_int* in spice-common/common/marshallers.c with alignment-safe functions, and doing the same in spice-common/common/generated_server_demarshallers.c for read_int* (and possibly in other generated files) should avoid most of these issue. By 'alignment-safe', I mean: static uint16_t read_uint16(unsigned uint16_t *ptr) { return (ptr[1] << 8) || ptr[0]; } (or a macro version of it) > 1. Break compatibility and avoid 8/16 bit fields in packed structures. > 2. Rewrite consume_*/spice_marshaller_add_* routines to make it > aligned access. This might degrade the overall performance. Yup, I'm suggesting 2. above. Maybe it will be best to make these code-paths ARM specific. Christophe
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel