summaryrefslogtreecommitdiff
path: root/src/arch/x86/tlb.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-04-19 03:41:10 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-04-19 03:41:10 -0700
commit3b1b21cb159c0368d50aa0dedd39a8874d91e735 (patch)
tree78d9d537e6f0c47469a77501df72cc4668f76a59 /src/arch/x86/tlb.cc
parenta0cc081997759399a124e47e637006d0b4fc15ac (diff)
downloadgem5-3b1b21cb159c0368d50aa0dedd39a8874d91e735.tar.xz
X86: Some segment selectors can be used when "NULL".
Diffstat (limited to 'src/arch/x86/tlb.cc')
-rw-r--r--src/arch/x86/tlb.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc
index 62d694225..330a8682b 100644
--- a/src/arch/x86/tlb.cc
+++ b/src/arch/x86/tlb.cc
@@ -571,7 +571,10 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation,
if (!efer.lma || !csAttr.longMode) {
DPRINTF(TLB, "Not in long mode. Checking segment protection.\n");
// Check for a NULL segment selector.
- if (!tc->readMiscRegNoEffect(MISCREG_SEG_SEL(seg)))
+ if (!(seg == SEGMENT_REG_TSG || seg == SYS_SEGMENT_REG_IDTR ||
+ seg == SEGMENT_REG_HS || seg == SEGMENT_REG_LS ||
+ seg == SEGMENT_REG_MS)
+ && !tc->readMiscRegNoEffect(MISCREG_SEG_SEL(seg)))
return new GeneralProtection(0);
bool expandDown = false;
SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg));