aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/controller/ohci.c
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2026-09-21 12:48:06 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2026-10-05 13:37:46 +0000
commit1f1043d550ea2b8282e692019f17a88896212a76 (patch)
treed0edcbece56a954ba58acbb38384d4afcbfddd64 /sys/dev/usb/controller/ohci.c
parent80af0a32e48bff6ad97e768b16d2dbc01ac8d1c3 (diff)
powerpc: keep FP, VMX and VSX ownership changes atomic with preemptionHEADmain
trap() and set_mcontext() change the FP/VMX/VSX ownership state in several steps with preemption enabled. A context switch in between leaves the thread computing with another thread's register contents: - enable_fpu()/enable_vec() set PCB_FPU/PCB_VEC before loading the registers, so a switch mid-load saves a half-loaded unit over the PCB. - set_mcontext() clears the frame's MSR bits and then the PCB flags; a switch in between re-enables the unit, and the thread returns to user space with it enabled but not owned, so it is neither saved nor restored until the next signal. Both paths run after every sigreturn(2), setcontext(2) and swapcontext(3). A POWER9 test that keeps f14-f31 live across a signal, with other threads using the FPU on the same CPU, saw 283 corrupted round trips out of 882000; none after this change. Hold a critical section around both, as amd64 and arm64 do. Reviewed by: jhibbits MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D60054
Diffstat (limited to 'sys/dev/usb/controller/ohci.c')
0 files changed, 0 insertions, 0 deletions