On 17 September 2012 16:28, Richard Henderson <r...@twiddle.net> wrote: > Not sure whether this is a gcc bug, but on sparc we wind up > trying to use std to an unaligned address. The patch does > work around the problem. > > Signed-off-by: Richard Henderson <r...@twiddle.net>
As far as the code is concerned: Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> but please rewrite the commit message to be more sure of itself :-) Specifically, this is required because the guest's alignment requirements may be laxer than those of the host, so we can't take a hptr for a 16/32/64 bit type (which only has the alignment restrictions of the guest) and do a gcc pointer dereference on it (which may assume the alignment restrictions of the host). Does anybody know the semantics of the kernel's copy_from_user()? Does it fail on misaligned userspace structs or does it allow them? -- PMM