Re: [PATCH 24/27] x86/fpu: Add a fastpath to __fpu__restore_sig()

From: Sebastian Andrzej Siewior
Date: Fri Apr 12 2019 - 13:27:36 EST


On 2019-04-12 19:17:59 [+0200], Borislav Petkov wrote:
> > @@ -327,7 +327,19 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
> > if (ret)
> > goto err_out;
> > envp = &env;
> > + } else {
>
> I've added here:

I would suggest to add it in the last patch once we have the complete
fast path. The other one extended (in case you want to add a comment
there, too).

> + /*
/**

> + * Attempt to restore the FPU registers directly from user
> + * memory. For that to succeed, the user accesses cannot cause

I would say "user access" because it is always a single instruction.

> + * page faults. If they do, fall back to the slow path below,
> + * going through the kernel buffer.

"with the enabled page fault handler".

> + */
>
> so that it is clear what's happening.
>
> This function is doing gazillion things again ;-\

It is the old code with disabled page fault handler. But I understand.

Sebastian