bug-hurd
[Top][All Lists]
Advanced

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

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


From: Damien Zammit
Subject: [PATCH gnumach] fpu: Fix for cpus that have no fxsave instruction
Date: Thu, 05 Dec 2024 04:32:51 +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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
index 3d146f71..203de993 100644
--- a/i386/i386/fpu.c
+++ b/i386/i386/fpu.c
@@ -285,7 +285,11 @@ fpu_module_init(void)
                fp_default_state->xfp_save_state.header.xcomp_bv = 
XSAVE_XCOMP_BV_COMPACT;
                /* Fallthrough */
            case FP_XSAVE:
+               xsave(&fp_default_state->xfp_save_state);
+               break;
            case FP_XSAVEOPT:
+               xsaveopt(&fp_default_state->xfp_save_state);
+               break;
            case FP_FXSAVE:
                fxsave(&fp_default_state->xfp_save_state);
                break;
-- 
2.45.2





reply via email to

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