summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-04-20 15:19:30 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-04-20 15:19:30 +0200
commitb865fe917090293dc6035c26788c4ccd13bb8d38 (patch)
treec2e7b411f6401d0ac503a9bec0ffcb823c766c4b
parent2e03784967a89b36942e498820db7b3639d74548 (diff)
fpu_get_state: Fail if requested xfloat state while we have saved 387 state
Userland will fall back to 387 support, which is what it should.
-rw-r--r--i386/i386/fpu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
index 93762086..71c6cdd8 100644
--- a/i386/i386/fpu.c
+++ b/i386/i386/fpu.c
@@ -533,6 +533,8 @@ fpu_get_state(const thread_t thread, void *state, int flavor)
ASSERT_IPL(SPL0);
if (fp_kind == FP_NO)
return KERN_FAILURE;
+ if (flavor != i386_FLOAT_STATE && fp_save_kind == FP_FNSAVE)
+ return KERN_FAILURE;
simple_lock(&pcb->lock);
ifps = pcb->ims.ifps;