summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/insts
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-05-28 23:27:56 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-05-28 23:27:56 -0700
commit7f50ea05ac848e22a70c9a9471904637aea2f907 (patch)
tree208fb8a40376ccb6b6fb90576c4506f34416930d /src/arch/x86/isa/insts
parent47877cf2dbd6ee2f1cf9b2c609d37b0589e876ca (diff)
downloadgem5-7f50ea05ac848e22a70c9a9471904637aea2f907.tar.xz
X86: Keep track of more descriptor state to accomodate KVM.
Diffstat (limited to 'src/arch/x86/isa/insts')
-rw-r--r--src/arch/x86/isa/insts/general_purpose/system_calls.py36
-rw-r--r--src/arch/x86/isa/insts/romutil.py2
2 files changed, 24 insertions, 14 deletions
diff --git a/src/arch/x86/isa/insts/general_purpose/system_calls.py b/src/arch/x86/isa/insts/general_purpose/system_calls.py
index fb282502d..9501116d9 100644
--- a/src/arch/x86/isa/insts/general_purpose/system_calls.py
+++ b/src/arch/x86/isa/insts/general_purpose/system_calls.py
@@ -77,8 +77,10 @@ def macroop SYSCALL_64
wrlimit cs, t1, dataSize=4
# Not writable, read/execute-able, not expandDown,
# dpl=0, defaultSize=0, long mode
- limm t4, ((0 << 0) | (1 << 1) | (0 << 2) | \
- (0 << 3) | (0 << 5) | (1 << 6)), dataSize=8
+ limm t4, ((0 << 0) | (0 << 2) | (0 << 3) | \
+ (1 << 4) | (0 << 5) | (1 << 6) | \
+ (1 << 7) | (10 << 8) | (0 << 12) | \
+ (1 << 13) | (0 << 14) | (1 << 15)), dataSize=8
wrattr cs, t4
# Set up SS.
@@ -88,8 +90,10 @@ def macroop SYSCALL_64
wrlimit ss, t1, dataSize=4
# Writable, readable, not expandDown,
# dpl=0, defaultSize=0, not long mode
- limm t4, ((1 << 0) | (1 << 1) | (0 << 2) | \
- (0 << 3) | (0 << 5) | (0 << 6)), dataSize=8
+ limm t4, ((0 << 0) | (0 << 2) | (1 << 3) | \
+ (0 << 4) | (0 << 5) | (1 << 6) | \
+ (1 << 7) | (2 << 8) | (1 << 12) | \
+ (1 << 13) | (0 << 14) | (1 << 15)), dataSize=8
wrattr ss, t4
# Set the new rip.
@@ -126,8 +130,10 @@ def macroop SYSCALL_COMPAT
wrlimit cs, t1, dataSize=4
# Not writable, read/execute-able, not expandDown,
# dpl=0, defaultSize=0, long mode
- limm t4, ((0 << 0) | (1 << 1) | (0 << 2) | \
- (0 << 3) | (0 << 5) | (1 << 6)), dataSize=8
+ limm t4, ((0 << 0) | (0 << 2) | (0 << 3) | \
+ (1 << 4) | (0 << 5) | (1 << 6) | \
+ (1 << 7) | (10 << 8) | (0 << 12) | \
+ (1 << 13) | (0 << 14) | (1 << 15)), dataSize=8
wrattr cs, t4
# Set up SS.
@@ -137,8 +143,10 @@ def macroop SYSCALL_COMPAT
wrlimit ss, t1, dataSize=4
# Writable, readable, not expandDown,
# dpl=0, defaultSize=0, not long mode
- limm t4, ((1 << 0) | (1 << 1) | (0 << 2) | \
- (0 << 3) | (0 << 5) | (0 << 6)), dataSize=8
+ limm t4, ((0 << 0) | (0 << 2) | (1 << 3) | \
+ (0 << 4) | (0 << 5) | (1 << 6) | \
+ (1 << 7) | (2 << 8) | (1 << 12) | \
+ (1 << 13) | (0 << 14) | (1 << 15)), dataSize=8
wrattr ss, t4
# Set the new rip.
@@ -178,8 +186,10 @@ def macroop SYSRET_TO_64
wrlimit cs, t1, dataSize=4
# Not writable, read/execute-able, not expandDown,
# dpl=3, defaultSize=0, long mode
- limm t4, ((0 << 0) | (1 << 1) | (0 << 2) | \
- (3 << 3) | (0 << 5) | (1 << 6)), dataSize=8
+ limm t4, ((3 << 0) | (0 << 2) | (0 << 3) | \
+ (1 << 4) | (0 << 5) | (1 << 6) | \
+ (1 << 7) | (10 << 8) | (0 << 12) | \
+ (1 << 13) | (0 << 14) | (1 << 15)), dataSize=8
wrattr cs, t4
# Only the selector is changed for SS.
@@ -210,8 +220,10 @@ def macroop SYSRET_TO_COMPAT
wrlimit cs, t1, dataSize=4
# Not writable, read/execute-able, not expandDown,
# dpl=3, defaultSize=1, not long mode
- limm t4, ((0 << 0) | (1 << 1) | (0 << 2) | \
- (3 << 3) | (1 << 5) | (0 << 6)), dataSize=8
+ limm t4, ((3 << 0) | (0 << 2) | (0 << 3) | \
+ (1 << 4) | (0 << 5) | (1 << 6) | \
+ (1 << 7) | (10 << 8) | (0 << 12) | \
+ (1 << 13) | (0 << 14) | (1 << 15)), dataSize=8
wrattr cs, t4
# Only the selector is changed for SS.
diff --git a/src/arch/x86/isa/insts/romutil.py b/src/arch/x86/isa/insts/romutil.py
index 2fcc56e8a..10653e1cc 100644
--- a/src/arch/x86/isa/insts/romutil.py
+++ b/src/arch/x86/isa/insts/romutil.py
@@ -76,10 +76,8 @@ def rom
# Check if we're changing privelege level. At this point we can assume
# we're going to a DPL that's less than or equal to the CPL.
rdattr t10, hs, dataSize=8
- srli t10, t10, 3, dataSize=8
andi t10, t10, 3, dataSize=8
rdattr t5, cs, dataSize=8
- srli t5, t5, 3, dataSize=8
andi t5, t5, 0x3, dataSize=8
sub t0, t5, t10, flags=(EZF,), dataSize=8
# We're going to change priviledge, so zero out the stack selector. We