mirror of
https://github.com/opnsense/src.git
synced 2026-04-26 00:27:08 -04:00
Fix brokenness introduced with the PAGING conditional variable. The value
of %cr0 wasn't reloaded into %eax before being modified to turn protected mode off if PAGING was not defined. The result was that the processor did not exit protected mode, so when it tried to jump to segment 0x0 in the next instruction to clear the prefetch cache like one should when leaving protected mode, it actually tried to jump to a null selector, causing a GPF.
This commit is contained in:
parent
d3e00c127b
commit
c299f41fd9
2 changed files with 6 additions and 2 deletions
|
|
@ -249,11 +249,11 @@ init.9: pushb $0x0 # general
|
|||
#
|
||||
exit: cli # Disable interrupts
|
||||
movl $MEM_ESP0,%esp # Clear stack
|
||||
ifdef(`PAGING',`
|
||||
#
|
||||
# Turn off paging.
|
||||
#
|
||||
movl %cr0,%eax # Get CR0
|
||||
ifdef(`PAGING',`
|
||||
andl $~0x80000000,%eax # Disable
|
||||
movl %eax,%cr0 # paging
|
||||
')
|
||||
|
|
@ -800,11 +800,13 @@ intx30: cmpl $SYS_EXEC,%eax # Exec system call?
|
|||
movl $MEM_USR,%eax # User base address
|
||||
addl 0xc(%esp,1),%eax # Change to user
|
||||
leal 0x4(%eax),%esp # stack
|
||||
ifdef(`PAGING',`
|
||||
movl %cr0,%eax # Turn
|
||||
andl $~0x80000000,%eax # off
|
||||
movl %eax,%cr0 # paging
|
||||
xorl %eax,%eax # Flush
|
||||
movl %eax,%cr3 # TLB
|
||||
')
|
||||
popl %eax # Call
|
||||
call *%eax # program
|
||||
intx30.1: incb %ss:btx_hdr+0x7 # Flag reboot
|
||||
|
|
|
|||
|
|
@ -249,11 +249,11 @@ init.9: pushb $0x0 # general
|
|||
#
|
||||
exit: cli # Disable interrupts
|
||||
movl $MEM_ESP0,%esp # Clear stack
|
||||
ifdef(`PAGING',`
|
||||
#
|
||||
# Turn off paging.
|
||||
#
|
||||
movl %cr0,%eax # Get CR0
|
||||
ifdef(`PAGING',`
|
||||
andl $~0x80000000,%eax # Disable
|
||||
movl %eax,%cr0 # paging
|
||||
')
|
||||
|
|
@ -800,11 +800,13 @@ intx30: cmpl $SYS_EXEC,%eax # Exec system call?
|
|||
movl $MEM_USR,%eax # User base address
|
||||
addl 0xc(%esp,1),%eax # Change to user
|
||||
leal 0x4(%eax),%esp # stack
|
||||
ifdef(`PAGING',`
|
||||
movl %cr0,%eax # Turn
|
||||
andl $~0x80000000,%eax # off
|
||||
movl %eax,%cr0 # paging
|
||||
xorl %eax,%eax # Flush
|
||||
movl %eax,%cr3 # TLB
|
||||
')
|
||||
popl %eax # Call
|
||||
call *%eax # program
|
||||
intx30.1: incb %ss:btx_hdr+0x7 # Flag reboot
|
||||
|
|
|
|||
Loading…
Reference in a new issue