Source-Changes archive

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

CVS commit: src/sys/arch/m68k/fpe



Module Name:    src
Committed By:   thorpej
Date:           Sun Nov  1 12:40:48 UTC 2026

Modified Files:
        src/sys/arch/m68k/fpe: fpu_emulate.c fpu_log.c fpu_rem.c

Log Message:
Allocate state for the FPU emulator on the kernel stack rather than as
static globals.  Normally we wouldn't want to allocate this much on the
stack, but the emulator is only for user-space code, so the kernel stack
will have been idle when the F-line trap occurred; the only things on
the stack at this point are the trap frame and the small number of call
frames required to get us here.

This prevents concurrent FPU emuations from colliding with each other.
This is something that could happen when e.g. two FP-using programs are
running concurrently on a system under memory pressure and one of them
blocks during an emulation to service a page fault.

The alternatives are less than ideal: we either have to dynamically
allocate memory or wrap the emulator in a mutex.

Similarly, change __fpu_logn() and __fpu_modrem() to place their
temporaries on the stack, as well.

Problem reported by Romain Dolbeau on port-m68k.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/m68k/fpe/fpu_emulate.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/m68k/fpe/fpu_log.c \
    src/sys/arch/m68k/fpe/fpu_rem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index