summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/cpu_switch.S
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-07-09 09:34:11 +0000
committerkib <kib@FreeBSD.org>2009-07-09 09:34:11 +0000
commit1596f53aae0639b74921f046885b0fe1b57766b4 (patch)
tree72e1f854630487c503e885bb3cc1df1eeb575521 /sys/amd64/amd64/cpu_switch.S
parent2706e21f2c2e081ec96cde8bfe4e71021535961e (diff)
downloadFreeBSD-src-1596f53aae0639b74921f046885b0fe1b57766b4.zip
FreeBSD-src-1596f53aae0639b74921f046885b0fe1b57766b4.tar.gz
Restore the segment registers and segment base MSRs for amd64 syscall
return path only when neither thread was context switched while executing syscall code nor syscall explicitely modified LDT or MSRs. Save segment registers in trap handlers before interrupts are enabled, to not allow context switches to happen before registers are saved. Use separated byte in pcb for indication of fast/full return, since pcb_flags are not synchronized with context switches. The change puts back syscall microbenchmark numbers that were slowed down after commit of the support for LDT on amd64. Reviewed by: jeff Tested (and tested, and tested ...) by: pho Approved by: re (kensmith)
Diffstat (limited to 'sys/amd64/amd64/cpu_switch.S')
-rw-r--r--sys/amd64/amd64/cpu_switch.S1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S
index 6fc8290..364875e 100644
--- a/sys/amd64/amd64/cpu_switch.S
+++ b/sys/amd64/amd64/cpu_switch.S
@@ -97,6 +97,7 @@ END(cpu_throw)
ENTRY(cpu_switch)
/* Switch to new thread. First, save context. */
movq TD_PCB(%rdi),%r8
+ movb $1,PCB_FULL_IRET(%r8)
movq (%rsp),%rax /* Hardware registers */
movq %r15,PCB_R15(%r8)
OpenPOWER on IntegriCloud