• Suresh Siddha's avatar
    x86: xsave: set FP, SSE bits in the xsave header in the user sigcontext · 04944b79
    Suresh Siddha authored
    If a processor implementation discern that a processor state component is in
    its initialized state, it may modify the corresponding bit in the
    xsave header.xstate_bv as '0'. State in the memory layout setup by 'xsave'
    will be consistent with the bit values in the header.
    
    During signal handling, legacy applications may change the FP/SSE bits
    in the sigcontext memory layout without touching the FP/SSE header bits
    in the xsave header. So always set FP/SSE bits in the xsave header
    while saving the sigcontext state to the user space. During signal return,
    this will enable the kernel to capture any changes to the FP/SSE bits by the
    legacy applications which don't touch xsave headers.
    
    xsave aware apps can change the xstate_bv in the xsave header aswell
    as change any contents in the memory layout. xrestor as part of sigreturn
    will capture all the changes.
    Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
    Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
    04944b79
i387.c 15.7 KB