x86: increment the stack pointer in lret inst
The 'lret' instruction reloads instruction pointer and code segment from the stack and then pops them. But the popping part is missing from the current implementation. This caused incorrect behavior in some code related to the Fiasco OS. Microops are being added to rectify the behavior of the instruction. Committed by: Nilay Vaish <nilay@cs.wisc.edu>
This commit is contained in:
@@ -69,6 +69,11 @@ def macroop RET_FAR {
|
||||
# Get the return CS
|
||||
ld t2, ss, [1, t0, rsp], ssz
|
||||
|
||||
# increment the stack pointer to pop the instruction pointer
|
||||
# and the code segment from the stack.
|
||||
addi rsp, rsp, dsz
|
||||
addi rsp, rsp, dsz
|
||||
|
||||
# Get the rpl
|
||||
andi t3, t2, 0x3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user