bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 gnumach] fpu: Fix for cpus that have no fxsave instruction


From: Damien Zammit
Subject: [PATCH v2 gnumach] fpu: Fix for cpus that have no fxsave instruction
Date: Thu, 05 Dec 2024 07:49:41 +0000

Fallthrough was incorrectly using fxsave() instead of
xsave() or xsaveopt().

TESTED: on AMD fam15h: no longer throws "No coprocessor" exception.
---
 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;
 }
 
 /*
-- 
2.45.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]