RE: [patch 2.6.11] __copy_user breaks on unaligned src

From: Luck, Tony <>
Date: 2005-03-19 04:40:02
>That's a good thing to fix (it's definitely a performance bug).  However,
>lfetch.fault should be safe to use even on unmapped memory.  See this
>code in ia64_do_page_fault():
> /*
>  * This fault was due to a speculative load or lfetch.fault, set the "ed"
>  * bit in the psr to ensure forward progress.  (Target register will get a
>  * NaT for ld.s, lfetch will be canceled.)
>  */
>I don't see off-hand why this wouldn't work as intended.

That reminds me ... someone asked why we don't have the same test for
lfetch a few lines further down in ia64_do_page_fault() in the "no_context"
case (we only test for speculative access there).

The context for their question was using __copy_from_user_inatomic() after
calling inc_preempt_count().  On ia64 this just uses the standard code for
__copy_from_user().  If we happen to fault on the "lfetch", then we end up
in the "no_context" case because of the "if (in_atomic() || !mm)" test at the
top of ia64_do_page_fault.

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Fri Mar 18 12:40:27 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:37 EST