summaryrefslogtreecommitdiff
path: root/src/arch/x86/system.cc
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/system.cc
parent47877cf2dbd6ee2f1cf9b2c609d37b0589e876ca (diff)
downloadgem5-7f50ea05ac848e22a70c9a9471904637aea2f907.tar.xz
X86: Keep track of more descriptor state to accomodate KVM.
Diffstat (limited to 'src/arch/x86/system.cc')
-rw-r--r--src/arch/x86/system.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/arch/x86/system.cc b/src/arch/x86/system.cc
index 66bee70e8..1594cc375 100644
--- a/src/arch/x86/system.cc
+++ b/src/arch/x86/system.cc
@@ -93,24 +93,33 @@ installSegDesc(ThreadContext *tc, SegmentRegIndex seg,
uint64_t limit = desc.limitLow | (desc.limitHigh << 16);
SegAttr attr = 0;
+
+ attr.dpl = desc.dpl;
+ attr.unusable = 0;
+ attr.defaultSize = desc.d;
+ attr.longMode = desc.l;
+ attr.avl = desc.avl;
+ attr.granularity = desc.g;
+ attr.present = desc.p;
+ attr.system = desc.s;
+ attr.type = desc.type;
if (desc.s) {
if (desc.type.codeOrData) {
// Code segment
+ attr.expandDown = 0;
attr.readable = desc.type.r;
+ attr.writable = 0;
} else {
// Data segment
+ attr.expandDown = desc.type.e;
attr.readable = 1;
attr.writable = desc.type.w;
- attr.expandDown = desc.type.e;
}
} else {
- attr.writable = 1;
attr.readable = 1;
+ attr.writable = 1;
attr.expandDown = 0;
}
- attr.longMode = desc.l;
- attr.dpl = desc.dpl;
- attr.defaultSize = desc.d;
tc->setMiscReg(MISCREG_SEG_BASE(seg), base);
tc->setMiscReg(MISCREG_SEG_EFF_BASE(seg), honorBase ? base : 0);