summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorChristian Menard <Christian.Menard@tu-dresden.de>2013-04-23 00:03:04 -0500
committerChristian Menard <Christian.Menard@tu-dresden.de>2013-04-23 00:03:04 -0500
commit25a6b1866e7c195c45c3d23f00937aa13bb2a2ff (patch)
treed3e3c0d841ddb304c6ed5301fcd30ab0a4902caf /src/arch
parentaa86800e7a142f41a8fe957c367c133dea8d61bf (diff)
downloadgem5-25a6b1866e7c195c45c3d23f00937aa13bb2a2ff.tar.xz
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>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/isa/insts/general_purpose/control_transfer/xreturn.py5
1 files changed, 5 insertions, 0 deletions
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