On Wed, Feb 21, 2007 at 01:04:51PM -0800, Davide Libenzi wrote:

> > Oh, we can. "put_user()" and "get_user()" already have to work on totally 
> > unaligned data. If some architecture has problems with that, they have 
> > bigger issues, methinks.
> > 
> > We can't trust user pointers, and that includes not trusting them being 
> > aligned. 
> 
> Don't we get EFAULT in case of exception (access or alignment) in there?
> For "dealing with", here we'd need them to do the correct thing 
> (split-load?) in case of mis-aligned access.

On an architecture which doesn't transparently handle missalignment the
best approach is to have the unalignment exception handler fix things
such that the 99.999% common case of properly aligned get_user/put_user
doesn't have to care.  A few nasty architectures (Afair old ARM and the
b0rked R5900 in the Playstation 2 for 128-bit integer loads) however
don't throw exceptions so __get_user / __put_user have to handle the
problem manually which of course adds considerable overhead to the common
case.

  Ralf
-
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to