Re: [PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-24 Thread Samuel Thibault
Luca Dariz, le sam. 24 août 2024 21:09:35 +0200, a ecrit: > Il 22/08/24 23:44, Samuel Thibault ha scritto: > > Luca Dariz, le mer. 21 août 2024 18:36:14 +0200, a ecrit: > > > diff --git a/i386/include/mach/i386/mach_i386.defs > > > b/i386/include/mach/i386/mach_i386.defs > > > index 965d5c3b..61fe

Re: [PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-24 Thread Luca Dariz
Il 22/08/24 23:26, Samuel Thibault ha scritto: Hello, Thanks for the improved version! Luca Dariz, le mer. 21 août 2024 18:36:14 +0200, a ecrit: @@ -495,10 +534,11 @@ ASSERT_IPL(SPL0); * concurrent fpu_set_state or fpu_get_state. */ kern_return_t -fpu_get_state(const thread_t thread, -

Re: [PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-24 Thread Luca Dariz
Il 22/08/24 23:51, Samuel Thibault ha scritto: Luca Dariz, le mer. 21 août 2024 18:36:14 +0200, a ecrit: + } else if (flavor == i386_XFLOAT_STATE) { + int i; + struct i386_xfp_save *user_fp_state = (struct i386_xfp_save *) &xfstate->hw_state[0]; We should

Re: [PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-24 Thread Luca Dariz
Il 22/08/24 23:44, Samuel Thibault ha scritto: Luca Dariz, le mer. 21 août 2024 18:36:14 +0200, a ecrit: diff --git a/i386/include/mach/i386/mach_i386.defs b/i386/include/mach/i386/mach_i386.defs index 965d5c3b..61fed222 100644 --- a/i386/include/mach/i386/mach_i386.defs +++ b/i386/include/mach

Re: [PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-22 Thread Samuel Thibault
Luca Dariz, le mer. 21 août 2024 18:36:14 +0200, a ecrit: > + } else if (flavor == i386_XFLOAT_STATE) { > + int i; > + struct i386_xfp_save *user_fp_state = (struct i386_xfp_save *) > &xfstate->hw_state[0]; We should also check that user_fp_state->fp_save_kind == f

Re: [PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-22 Thread Samuel Thibault
Luca Dariz, le mer. 21 août 2024 18:36:14 +0200, a ecrit: > diff --git a/i386/include/mach/i386/mach_i386.defs > b/i386/include/mach/i386/mach_i386.defs > index 965d5c3b..61fed222 100644 > --- a/i386/include/mach/i386/mach_i386.defs > +++ b/i386/include/mach/i386/mach_i386.defs > @@ -111,3 +111,9

Re: [PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-22 Thread Samuel Thibault
Hello, Thanks for the improved version! Luca Dariz, le mer. 21 août 2024 18:36:14 +0200, a ecrit: > @@ -495,10 +534,11 @@ ASSERT_IPL(SPL0); > * concurrent fpu_set_state or fpu_get_state. > */ > kern_return_t > -fpu_get_state(const thread_t thread, > - struct i386_float_state *state

[PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-21 Thread Luca Dariz
* i386/i386/fpu.c: extend current getter and setter to support the extended state; move the struct casting here to reuse the locking and allocation logic for the thread state; make sure the new state is set as valid, otherwise it won't be applied; add i386_get_xstate_size() to dynamically r