commit b865fe917090293dc6035c26788c4ccd13bb8d38
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Apr 20 15:19:30 2025 +0200

    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.

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;
