Re: [RFC PATCH v1 1/2] x86/fpu: detect AVX task

2018-11-07 Thread Li, Aubrey
On 2018/11/8 1:41, Tim Chen wrote: > On 11/06/2018 10:23 AM, Aubrey Li wrote: > >> +static inline void update_avx_state(struct avx_state *avx) >> +{ >> +/* >> + * Check if XGETBV with ECX = 1 supported. XGETBV with ECX = 1 >> + * returns the logical-AND of XCR0 and XINUSE. XINUSE is a

Re: [RFC PATCH v1 1/2] x86/fpu: detect AVX task

2018-11-07 Thread Tim Chen
On 11/06/2018 10:23 AM, Aubrey Li wrote: > +static inline void update_avx_state(struct avx_state *avx) > +{ > + /* > + * Check if XGETBV with ECX = 1 supported. XGETBV with ECX = 1 > + * returns the logical-AND of XCR0 and XINUSE. XINUSE is a bitmap > + * by which the processor

[RFC PATCH v1 1/2] x86/fpu: detect AVX task

2018-11-06 Thread Aubrey Li
XSAVES and its variants use init optimization to reduce the amount of data that they save to memory during context switch. Init optimization uses the state component bitmap to denote if a component is in its init configuration. We use this information to detect if a task contains AVX instructions.