summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-05-01 20:03:50 +0000
committerkib <kib@FreeBSD.org>2013-05-01 20:03:50 +0000
commitf2ccbf32fb7a03af96b0eea6b63aebb4591a37ea (patch)
tree2dc06b9da2a2d45298331df9eaedf5db7fb175fa /sys/amd64
parent3c0b1df0649273beed11cc1b6e32731432567ad7 (diff)
downloadFreeBSD-src-f2ccbf32fb7a03af96b0eea6b63aebb4591a37ea.zip
FreeBSD-src-f2ccbf32fb7a03af96b0eea6b63aebb4591a37ea.tar.gz
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
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/fpu.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c
index 18130b5..7bc0a6f 100644
--- a/sys/amd64/amd64/fpu.c
+++ b/sys/amd64/amd64/fpu.c
@@ -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);
OpenPOWER on IntegriCloud