diff options
author | bde <bde@FreeBSD.org> | 2003-10-16 10:44:24 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2003-10-16 10:44:24 +0000 |
commit | bfb4a0a2c1962c877828d6cae42a55c809643f56 (patch) | |
tree | 8735e685fac1d1adbbf00b41e947b23a38e86c41 /sys/i386 | |
parent | 6e062906a756066856acc04a9b5a4ab0ab08a4d1 (diff) | |
download | FreeBSD-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/i386')
-rw-r--r-- | sys/i386/i386/apic_vector.s | 3 | ||||
-rw-r--r-- | sys/i386/isa/apic_vector.s | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/i386/i386/apic_vector.s b/sys/i386/i386/apic_vector.s index bb0055f..fb6464e 100644 --- a/sys/i386/i386/apic_vector.s +++ b/sys/i386/i386/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 diff --git a/sys/i386/isa/apic_vector.s b/sys/i386/isa/apic_vector.s index bb0055f..fb6464e 100644 --- a/sys/i386/isa/apic_vector.s +++ b/sys/i386/isa/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 |