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:
Christian Menard
2013-04-23 00:03:04 -05:00
parent aa86800e7a
commit 25a6b1866e

View File

@@ -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