Re: [PATCH v8 04/27] x86/fpu/xstate: Introduce XSAVES system states

2019-08-16 Thread Yu-cheng Yu
On Fri, 2019-08-16 at 21:56 +0200, Thomas Gleixner wrote: > On Tue, 13 Aug 2019, Yu-cheng Yu wrote: > > +/* > > + * On context switches, XSAVE states are not restored until returning > > + * to user-mode. FPU registers need to be restored before any changes, > > + * and protected by fpregs_lock()/

Re: [PATCH v8 04/27] x86/fpu/xstate: Introduce XSAVES system states

2019-08-16 Thread Thomas Gleixner
On Tue, 13 Aug 2019, Yu-cheng Yu wrote: > +/* > + * On context switches, XSAVE states are not restored until returning > + * to user-mode. FPU registers need to be restored before any changes, > + * and protected by fpregs_lock()/fpregs_unlock(). I really had to read this comment twice to figure

[PATCH v8 04/27] x86/fpu/xstate: Introduce XSAVES system states

2019-08-13 Thread Yu-cheng Yu
Control-flow Enforcement (CET) MSR contents are XSAVES system states. To support CET, introduce XSAVES system states first. Signed-off-by: Yu-cheng Yu --- arch/x86/include/asm/fpu/internal.h | 23 +++- arch/x86/include/asm/fpu/xstate.h | 4 +- arch/x86/kernel/fpu/core.c | 26