X86: Make the TLB fault instead of panic when something is unmapped in SE mode.
The fault object, if invoked, would then panic. This is a bit less direct, but it means speculative execution won't panic the simulator.
This commit is contained in:
parent
172e45fc97
commit
f6182f948b
|
@ -267,6 +267,22 @@ namespace X86ISA
|
||||||
tc->setNextPC(tc->readPC() + sizeof(MachInst));
|
tc->setNextPC(tc->readPC() + sizeof(MachInst));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
void
|
||||||
|
PageFault::invoke(ThreadContext * tc)
|
||||||
|
{
|
||||||
|
PageFaultErrorCode code = errorCode;
|
||||||
|
const char *modeStr = "";
|
||||||
|
if (code.fetch)
|
||||||
|
modeStr = "execute";
|
||||||
|
else if (code.write)
|
||||||
|
modeStr = "write";
|
||||||
|
else
|
||||||
|
modeStr = "read";
|
||||||
|
panic("Tried to %s unmapped address %#x.\n", modeStr, addr);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
} // namespace X86ISA
|
} // namespace X86ISA
|
||||||
|
|
||||||
|
|
|
@ -327,9 +327,9 @@ namespace X86ISA
|
||||||
errorCode = code;
|
errorCode = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FULL_SYSTEM
|
|
||||||
void invoke(ThreadContext * tc);
|
void invoke(ThreadContext * tc);
|
||||||
|
|
||||||
|
#if FULL_SYSTEM
|
||||||
virtual std::string describe() const;
|
virtual std::string describe() const;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -619,21 +619,7 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation,
|
||||||
success = p->pTable->lookup(vaddr, newEntry);
|
success = p->pTable->lookup(vaddr, newEntry);
|
||||||
}
|
}
|
||||||
if (!success) {
|
if (!success) {
|
||||||
if (req->isPrefetch()) {
|
return new PageFault(vaddr, true, mode, true, false);
|
||||||
return new PageFault(vaddr, true, mode, true, false);
|
|
||||||
} else {
|
|
||||||
const char *modeStr = "";
|
|
||||||
if (mode == Execute)
|
|
||||||
modeStr = "execute";
|
|
||||||
else if (mode == Read)
|
|
||||||
modeStr = "read";
|
|
||||||
else if (mode == Write)
|
|
||||||
modeStr = "write";
|
|
||||||
else
|
|
||||||
modeStr = "?";
|
|
||||||
panic("Tried to %s unmapped address %#x.\n",
|
|
||||||
modeStr, vaddr);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Addr alignedVaddr = p->pTable->pageAlign(vaddr);
|
Addr alignedVaddr = p->pTable->pageAlign(vaddr);
|
||||||
DPRINTF(TLB, "Mapping %#x to %#x\n", alignedVaddr,
|
DPRINTF(TLB, "Mapping %#x to %#x\n", alignedVaddr,
|
||||||
|
|
Loading…
Reference in a new issue