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
b72f347bdb
commit
ed86674a3d
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user