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.
This commit is contained in:
parent
6e062906a7
commit
bfb4a0a2c1
@ -467,10 +467,12 @@ IDTVEC(cpustop)
|
|||||||
pushl %ecx
|
pushl %ecx
|
||||||
pushl %edx
|
pushl %edx
|
||||||
pushl %ds /* save current data segment */
|
pushl %ds /* save current data segment */
|
||||||
|
pushl %es
|
||||||
pushl %fs
|
pushl %fs
|
||||||
|
|
||||||
movl $KDSEL, %eax
|
movl $KDSEL, %eax
|
||||||
mov %ax, %ds /* use KERNEL data segment */
|
mov %ax, %ds /* use KERNEL data segment */
|
||||||
|
mov %ax, %es
|
||||||
movl $KPSEL, %eax
|
movl $KPSEL, %eax
|
||||||
mov %ax, %fs
|
mov %ax, %fs
|
||||||
|
|
||||||
@ -507,6 +509,7 @@ IDTVEC(cpustop)
|
|||||||
call *%eax
|
call *%eax
|
||||||
2:
|
2:
|
||||||
popl %fs
|
popl %fs
|
||||||
|
popl %es
|
||||||
popl %ds /* restore previous data segment */
|
popl %ds /* restore previous data segment */
|
||||||
popl %edx
|
popl %edx
|
||||||
popl %ecx
|
popl %ecx
|
||||||
|
@ -467,10 +467,12 @@ IDTVEC(cpustop)
|
|||||||
pushl %ecx
|
pushl %ecx
|
||||||
pushl %edx
|
pushl %edx
|
||||||
pushl %ds /* save current data segment */
|
pushl %ds /* save current data segment */
|
||||||
|
pushl %es
|
||||||
pushl %fs
|
pushl %fs
|
||||||
|
|
||||||
movl $KDSEL, %eax
|
movl $KDSEL, %eax
|
||||||
mov %ax, %ds /* use KERNEL data segment */
|
mov %ax, %ds /* use KERNEL data segment */
|
||||||
|
mov %ax, %es
|
||||||
movl $KPSEL, %eax
|
movl $KPSEL, %eax
|
||||||
mov %ax, %fs
|
mov %ax, %fs
|
||||||
|
|
||||||
@ -507,6 +509,7 @@ IDTVEC(cpustop)
|
|||||||
call *%eax
|
call *%eax
|
||||||
2:
|
2:
|
||||||
popl %fs
|
popl %fs
|
||||||
|
popl %es
|
||||||
popl %ds /* restore previous data segment */
|
popl %ds /* restore previous data segment */
|
||||||
popl %edx
|
popl %edx
|
||||||
popl %ecx
|
popl %ecx
|
||||||
|
@ -467,10 +467,12 @@ IDTVEC(cpustop)
|
|||||||
pushl %ecx
|
pushl %ecx
|
||||||
pushl %edx
|
pushl %edx
|
||||||
pushl %ds /* save current data segment */
|
pushl %ds /* save current data segment */
|
||||||
|
pushl %es
|
||||||
pushl %fs
|
pushl %fs
|
||||||
|
|
||||||
movl $KDSEL, %eax
|
movl $KDSEL, %eax
|
||||||
mov %ax, %ds /* use KERNEL data segment */
|
mov %ax, %ds /* use KERNEL data segment */
|
||||||
|
mov %ax, %es
|
||||||
movl $KPSEL, %eax
|
movl $KPSEL, %eax
|
||||||
mov %ax, %fs
|
mov %ax, %fs
|
||||||
|
|
||||||
@ -507,6 +509,7 @@ IDTVEC(cpustop)
|
|||||||
call *%eax
|
call *%eax
|
||||||
2:
|
2:
|
||||||
popl %fs
|
popl %fs
|
||||||
|
popl %es
|
||||||
popl %ds /* restore previous data segment */
|
popl %ds /* restore previous data segment */
|
||||||
popl %edx
|
popl %edx
|
||||||
popl %ecx
|
popl %ecx
|
||||||
|
Loading…
Reference in New Issue
Block a user