Re: [PATCH glibc/hurd] Handling of pending signals could result in corruption of FPU state

2026-02-01 Thread Michael Kelly

On 29/01/2026 18:04, Michael Kelly wrote:

On 29/01/2026 17:14, Mike Kelly wrote:
Here is a patch for review to address the xmm register value 
corruption occurring in user code that is heavily bombarded by signals.


It's a small patch to address what I found to be a very difficult 
problem. The xstate_size of the interrupted thread's xstate is not 
saved in any structure. I therefore had to implement the assumption 
that xstate_size returns the same value for all calls to 
__i386_get_xstate_size() which is indeed currently the case. There is 
no actual issue here but it seemed wrong to me to do so. Comments 
welcome.


Also note that this patch has been tested successfully on hurd-i386 
and hurd-amd64 using the test case 'sigtest_xmm0.c' attached to 
message https://lists.gnu.org/archive/html/bug-hurd/2026-01/msg00241.html 


There is a limitation with this patch in the case where the xstate is 
not supported by the system and managed state should default to the 
basic sc_i386_float_state. I will rework the patch accordingly and also 
attempt to address the issue of the xstate_size mentioned above.


Regards,

Mike.




Re: [PATCH glibc/hurd] Handling of pending signals could result in corruption of FPU state

2026-01-29 Thread Michael Kelly

On 29/01/2026 17:14, Mike Kelly wrote:

Here is a patch for review to address the xmm register value corruption 
occurring in user code that is heavily bombarded by signals.

It's a small patch to address what I found to be a very difficult problem. The 
xstate_size of the interrupted thread's xstate is not saved in any structure. I 
therefore had to implement the assumption that xstate_size returns the same 
value for all calls to __i386_get_xstate_size() which is indeed currently the 
case. There is no actual issue here but it seemed wrong to me to do so. 
Comments welcome.


Also note that this patch has been tested successfully on hurd-i386 and 
hurd-amd64 using the test case 'sigtest_xmm0.c' attached to message 
https://lists.gnu.org/archive/html/bug-hurd/2026-01/msg00241.html


Mike.