aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/userboot
diff options
context:
space:
mode:
authorR. Christian McDonald <rcm@FreeBSD.org>2026-11-30 00:51:15 +0000
committerR. Christian McDonald <rcm@FreeBSD.org>2026-11-30 00:51:15 +0000
commit8a8a527296ca5a7245b7cb2093e813aeca0e0ef8 (patch)
tree1a7d855e8b147d16baed5f5b2b23e75cfc89f086 /sys/boot/userboot
parentb75ceca567d4914e2de71783ae749bd9860008d4 (diff)
amd64: Avoid redundant CR0 writes on switches to kernel threadsHEADmain
fpu_activate_sw() sets CR0.TS whenever it switches to a kernel thread, or to a thread inside fpu_kern_enter(). The bit is clear only while a thread owns the FPU, and at a context switch the only possible owner is the old thread. When fpcurthread is NULL the bit is already set and the write to CR0, which is serializing, changes nothing. That is the common case for switches between kernel threads, such as the idle thread and interrupt threads on a router. Write CR0 only when fpcurthread was set, as cpu_switch() did before the eager FPU switch became the default in d1a07e31e5cc, and assert that TS is set otherwise. Reviewed by: kib MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D62206
Diffstat (limited to 'sys/boot/userboot')
0 files changed, 0 insertions, 0 deletions