The check to ensure that xstate_bv always has XFEATURE_ENABLED_X87 and
XFEATURE_ENABLED_SSE bits set is not needed. CPU correctly handles any bitmask which is subset of the enabled bits in %XCR0. More, CPU instructions XSAVE and XSAVEOPT could write the mask without e.g. XFEATURE_ENABLED_SSE, after the VZEROALL. The check prevents the restoration of the otherwise valid FPU save area. In collaboration with: jhb MFC after: 1 week
This commit is contained in:
parent
3c0b1df064
commit
f2ccbf32fb
@ -743,9 +743,6 @@ fpusetxstate(struct thread *td, char *xfpustate, size_t xfpustate_size)
|
||||
*/
|
||||
if (bv & ~xsave_mask)
|
||||
return (EINVAL);
|
||||
if ((bv & (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) !=
|
||||
(XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE))
|
||||
return (EINVAL);
|
||||
|
||||
hdr = (struct xstate_hdr *)(get_pcb_user_save_td(td) + 1);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user