diff options
author | kib <kib@FreeBSD.org> | 2013-05-01 20:03:50 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-05-01 20:03:50 +0000 |
commit | f2ccbf32fb7a03af96b0eea6b63aebb4591a37ea (patch) | |
tree | 2dc06b9da2a2d45298331df9eaedf5db7fb175fa /sys/amd64 | |
parent | 3c0b1df0649273beed11cc1b6e32731432567ad7 (diff) | |
download | FreeBSD-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.c | 3 |
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); |