--- /n/sources/plan9/sys/src/9/pc/trap.c Tue Mar 11 17:39:49 2025 +++ /sys/src/9/pc/trap.c Tue Aug 4 00:00:00 2026 @@ -871,6 +871,7 @@ if(0) print("%s %lud: notify %.8lux %.8lux %.8lux %s\n", void noted(Ureg* ureg, ulong arg0) { + int s; Ureg *nureg; ulong oureg, sp; @@ -884,9 +885,17 @@ noted(Ureg* ureg, ulong arg0) nureg = up->ureg; /* pointer to user returned Ureg struct */ + /* + * The fpu and fpstate must change together. This runs with + * interrupts enabled, and a preemption in between leaves the + * note state active with the fpu off, which faults in the + * fpsave of procsave. + */ + s = splhi(); if((up->fpstate>>FPnoteshift) == FPactive) fpoff(); up->fpstate &= ~FPnotemask; + splx(s); /* sanity clause */ oureg = (ulong)nureg;