From fa27b31ec185999826894496faac629bd1716b8d Mon Sep 17 00:00:00 2001 From: Damien Zammit via Bug reports for the GNU Hurd Date: Thu, 5 Dec 2024 07:49:41 +0000 Subject: fpu: Fix for cpus that have no fxsave instruction Fallthrough was incorrectly using fxsave() instead of xsave() or xsaveopt(). TESTED: on AMD fam15h: no longer throws "No coprocessor" exception. Message-ID: <20241205074929.704111-1-damien@zamaudio.com> --- i386/i386/fpu.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c index 3d146f71..5bbad541 100644 --- a/i386/i386/fpu.c +++ b/i386/i386/fpu.c @@ -278,24 +278,8 @@ fpu_module_init(void) /* Get default state from CPU. */ clear_ts(); fninit(); - switch (fp_save_kind) { - case FP_XSAVEC: - case FP_XSAVES: - /* XRSTORS requires compact format, a bit faster anyway */ - fp_default_state->xfp_save_state.header.xcomp_bv = XSAVE_XCOMP_BV_COMPACT; - /* Fallthrough */ - case FP_XSAVE: - case FP_XSAVEOPT: - case FP_FXSAVE: - fxsave(&fp_default_state->xfp_save_state); - break; - case FP_FNSAVE: - fnsave(&fp_default_state->fp_save_state); - break; - } + fpu_save(fp_default_state); set_ts(); - - fp_default_state->fp_valid = TRUE; } /* -- cgit v1.2.3