[Spice-devel] [PATCH] demarshall: Add safe method for unaligned byte access.

Frediano Ziglio fziglio at redhat.com
Thu Dec 10 12:30:38 PST 2015


> 
> Hello, Frediano.
> 
> Option "-mno-unaligned-access" doesn't help. Got a lot of "Alignment trap".
> No additional code such as __aeabi_uread4() has added by the compiler. No
> runtime checks. Looks like it just ignored. GCC 4.8.2.
> 
>    http://sourceforge.net/p/tianocore/edk2/ci/68085d37f88aaaaad97f071e2d0e60b276592cc5/
> 
> Like stated here:
> 
>    http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15414.html
> 
> Would globally enabled aligned reads decrease an overall performance?
> 

Hi,
  sorry, I looked more carefully at generated code and the current code is not
enough to make the -mno-unaligned-access option works as expected.
It does not globally enable aligned read access but only when not aligned (or
better when alignment is not expected).

I'll post a patch to solve this issue.

Frediano


> 27.11.2015, 16:56, "Frediano Ziglio" <fziglio at redhat.com>:
> >>
> >>  Anton, which architecture it's your machine. Could be that using some
> >>  gcc options would make the compiler generate only aligned access
> >>  instructions.
> >
> > Can you try to add -mno-unaligned-access option to your CFLAGS ?
> >
> > Frediano
> 
> --
> Anton D. Kachalov
> 
> ITO, System Architect
> Tel: 7 (495) 739-70-00 ext.7613
> 


More information about the Spice-devel mailing list