From: Christian Menard Date: Tue, 23 Apr 2013 05:03:04 +0000 (-0500) Subject: x86: increment the stack pointer in lret inst X-Git-Tag: stable_2013_10_14~133 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=25a6b1866e7c195c45c3d23f00937aa13bb2a2ff;p=gem5.git 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 --- diff --git a/src/arch/x86/isa/insts/general_purpose/control_transfer/xreturn.py b/src/arch/x86/isa/insts/general_purpose/control_transfer/xreturn.py index 6b21db851..7ebe22e78 100644 --- a/src/arch/x86/isa/insts/general_purpose/control_transfer/xreturn.py +++ b/src/arch/x86/isa/insts/general_purpose/control_transfer/xreturn.py @@ -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