[lkml]   [2005]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC] [PATCH] cache pollution aware __copy_from_user_ll()
On Wed, 17 Aug 2005 14:10:34 +0900
Hiro Yoshioka <> mentioned:
> On 8/17/05, Akira Tsukamoto <> wrote:
> > Anyway, going back to copy_user topic,
> > big remaining issues are
> > 1)store/restore floating point register (80/64bytes) twice every time by
> > surrounding with kernel_fpu_begin()/kernel_fpu_end() is big penalty
> I don't know. If nobody uses MMX/XMM, then there is no need
> to save and restore.

I think you are misunderstanding between
1)lazy fpu save handling for user space task
2)kernel_fpu_begin()/kernel_fpu_end() inside the kernel

> > 2)after pagefault not always come back to copy function and corrupts fp register
> I'm trying to understand this mechanism but I don't
> understand very well.

My explanation was a bit ambiguous, see the code below.
Where the fp register saved? It saves fp register *inside* task_struct,

static inline void kernel_fpu_begin(void)
+ if (tsk->flags & PF_USEDFPU) {
+ asm volatile("rex64 ; fxsave %0 ; fnclex"
+ : "=m" (tsk->thread.i387.fxsave));
static inline void save_init_fpu( struct task_struct *tsk )
+ if ( cpu_has_fxsr ) {
+ asm volatile( "fxrstor %0"
+ : : "m" (tsk->thread.i387.fxsave) );
What happens, during your copy function, if memory is not allocated and
generates pagefualt and goto reclaim memories and go into task switch
and change to other task.

Akira Tsukamoto

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-08-17 16:26    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean