qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 01/13] linux-user: Use memcpy in get_user/put_us


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 01/13] linux-user: Use memcpy in get_user/put_user.
Date: Mon, 17 Sep 2012 17:06:23 +0100

On 17 September 2012 16:28, Richard Henderson <address@hidden> 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 <address@hidden>

As far as the code is concerned:
Reviewed-by: Peter Maydell <address@hidden>

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



reply via email to

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