Re: [PATCH 23/27] x86/fpu: Defer FPU state load until return to userspace

From: Borislav Petkov
Date: Fri Apr 12 2019 - 12:48:39 EST


On Fri, Apr 12, 2019 at 06:37:41PM +0200, Sebastian Andrzej Siewior wrote:
> (as you mentioned) so we would always record both trace points.
> Therefore I would suggest to remove it.

Remove which one?

Recording both TPs seems to make sense unless it doesn't make a whole
lotta sense to have:

fpregs_mark_activate
|-> trace_x86_fpu_activate_state <-- TP1
|-> fpregs_activate
|-> trace_x86_fpu_regs_activated <-- TP2


Yeah, looks like the two are too much and too close for no good
reason. There's nothing particularly spectacular in-between in
fpregs_activate().

> Maybe we could add a new one to __fpregs_load_activate() one in case we
> avoid loading registers because of fpregs_state_valid(). This might make
> sense.

But that's only the switch_fpu_return() path. Is fpregs_mark_activate()
is going to use only the trace_x86_fpu_regs_activated() one? Note the
"d" at the end.

[ Btw, those two names need adjusting too: who came up with such close,
confusing names?!
]

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.