FP handling in signal.c and traps.c (was Re: FP Emulator Patch)

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

 



I attach a diff relative to the current OSS repository for a proposed
patch to fix the signal holes discussed over the past few days.
This *exact* patch has not been tested, since the sources are too
new to be compatible with any kernel that will read my accursed
hard drive, so you are taking your life in your hands with it, but
it is substantially similar to the version I posted yesterday that
worked perfectly - but had the conceptual hole if a signal
handler that acquired the FPU got switched out.   I've got
a plane to catch in the morning and can't spend any more
time on it, but it should at least give people something to
talk about - and something similar to it really should be
(IMHO) the correct approach.  It will slow down the signal
dispatch, without a doubt, but we should stop losing FP
state altogether.  I also fixed what looked to be a bug
in the handling of Hi and Lo in the sigcontext restore.
The code as written would certainly have worked in
big-endian code, but I believe that in little endian it could
have trashed both registers.

A note to Jun Sun about clearing the used_math flag
before launching a signal handler: consider what happens
to ptrace if the signal handler hits a breakpoint without
executing any FP instructions.  My code saves and
restores it with the sigcontext.  If the signal handler
acquires the FPU, but the application has not otherwise
used FP, it will be cleared as part of that restore.

I pass the torch, and hope for the best...

            Regards,

            Kevin K.

cvsdiff


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux