summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/apic_vector.S
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2003-10-16 10:44:24 +0000
committerbde <bde@FreeBSD.org>2003-10-16 10:44:24 +0000
commitbfb4a0a2c1962c877828d6cae42a55c809643f56 (patch)
tree8735e685fac1d1adbbf00b41e947b23a38e86c41 /sys/amd64/amd64/apic_vector.S
parent6e062906a756066856acc04a9b5a4ab0ab08a4d1 (diff)
downloadFreeBSD-src-bfb4a0a2c1962c877828d6cae42a55c809643f56.zip
FreeBSD-src-bfb4a0a2c1962c877828d6cae42a55c809643f56.tar.gz
Don't forget to load %es with the kernel data segment selector in
Xcpustop(). %es is used in at least the call to savectx() when savectx() calls bcopy(), so not loading it was fatal if a stop IPI interrupts user mode. This reduces bugs starting and stopping CPUs for debuggers. CPUs are stopped mainly in kdb_trap() and cpu_reset(). At reset time there is a good chance that all the CPUs are in the kernel, so the bug was probably harmless then.
Diffstat (limited to 'sys/amd64/amd64/apic_vector.S')
-rw-r--r--sys/amd64/amd64/apic_vector.S3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/amd64/amd64/apic_vector.S b/sys/amd64/amd64/apic_vector.S
index bb0055f..fb6464e 100644
--- a/sys/amd64/amd64/apic_vector.S
+++ b/sys/amd64/amd64/apic_vector.S
@@ -467,10 +467,12 @@ IDTVEC(cpustop)
pushl %ecx
pushl %edx
pushl %ds /* save current data segment */
+ pushl %es
pushl %fs
movl $KDSEL, %eax
mov %ax, %ds /* use KERNEL data segment */
+ mov %ax, %es
movl $KPSEL, %eax
mov %ax, %fs
@@ -507,6 +509,7 @@ IDTVEC(cpustop)
call *%eax
2:
popl %fs
+ popl %es
popl %ds /* restore previous data segment */
popl %edx
popl %ecx
OpenPOWER on IntegriCloud