Re: [PATCH 2/2] x86/fpu: copy MXCSR & MXCSR_FLAGS with SSE/YMM state

From: Dave Hansen
Date: Thu Jan 26 2017 - 10:03:55 EST

On 01/25/2017 05:57 PM, riel@xxxxxxxxxx wrote:
> /*
> + * Restoring SSE/YMM state requires that MXCSR & MXCSR_MASK are saved.
> + * Those fields are part of the legacy FP state, and only get saved
> + * above if XFEATURES_MASK_FP is set.
> + *
> + * Copy out those fields if we have SSE/YMM but no FP register data.
> + */

Patch looks functionally good to me. One nit on the comment, though:
Usually XSAVE "state" refers to the state in the CPU while the "area"
refers to the buffer in memory. Probably best to talk about the "legacy
FP area", not state.

Maybe something like this for the first paragraph:

MXCSR and MXCSR_MASK are part of the SSE and YMM states and are
saved/restored along with those states. However, they are
located in the legacy FP *area* of the XSAVE buffer.