projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a838431
)
X86: In non 64bit mode, throw a fault when a NULL segment is accessed.
author
Gabe Black
<gblack@eecs.umich.edu>
Thu, 12 Jun 2008 04:51:50 +0000
(
00:51
-0400)
committer
Gabe Black
<gblack@eecs.umich.edu>
Thu, 12 Jun 2008 04:51:50 +0000
(
00:51
-0400)
src/arch/x86/tlb.cc
patch
|
blob
|
history
diff --git
a/src/arch/x86/tlb.cc
b/src/arch/x86/tlb.cc
index f5e214a88f2576dd575a3c0275c38df4dca15447..5d101a5ae05945115c8b31affeb03b71e01fa959 100644
(file)
--- a/
src/arch/x86/tlb.cc
+++ b/
src/arch/x86/tlb.cc
@@
-571,6
+571,9
@@
TLB::translate(RequestPtr &req, ThreadContext *tc, bool write, bool execute)
// If we're not in 64-bit mode, do protection/limit checks
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)))
+ return new GeneralProtection(0);
SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg));
if (!attr.writable && write)
return new GeneralProtection(0);