summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:41 -0400
committerKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:41 -0400
commit5ef0b7a9db3c6ec4ca191c2e9381719e1e694873 (patch)
tree718fdaf81b288b91bbac7eb2a8bae285d2dc39ac /src
parent716e447da8424386f2c3448c17891927aeb49f67 (diff)
downloadgem5-5ef0b7a9db3c6ec4ca191c2e9381719e1e694873.tar.xz
inorder/dtb: make sure DTB translate correct address
The DTB expects the correct PC in the ThreadContext but how if the memory accesses are speculative? Shouldn't we send along the requestor's PC to the translate functions?
Diffstat (limited to 'src')
-rw-r--r--src/arch/alpha/tlb.cc2
-rw-r--r--src/cpu/inorder/resources/cache_unit.cc11
2 files changed, 10 insertions, 3 deletions
diff --git a/src/arch/alpha/tlb.cc b/src/arch/alpha/tlb.cc
index 2c7e6732a..fbe188973 100644
--- a/src/arch/alpha/tlb.cc
+++ b/src/arch/alpha/tlb.cc
@@ -457,7 +457,7 @@ TLB::translateData(RequestPtr req, ThreadContext *tc, bool write)
return new DtbAlignmentFault(req->getVaddr(), req->getFlags(), flags);
}
- if (PcPAL(tc->pcState().pc())) {
+ if (PcPAL(req->getPC())) {
mode = (req->getFlags() & Request::ALTMODE) ?
(mode_type)ALT_MODE_AM(
tc->readMiscRegNoEffect(IPR_ALT_MODE))
diff --git a/src/cpu/inorder/resources/cache_unit.cc b/src/cpu/inorder/resources/cache_unit.cc
index 7a24348fc..39afd296e 100644
--- a/src/cpu/inorder/resources/cache_unit.cc
+++ b/src/cpu/inorder/resources/cache_unit.cc
@@ -426,9 +426,16 @@ CacheUnit::doTLBAccess(DynInstPtr inst, CacheReqPtr cache_req, int acc_size,
ThreadID tid = inst->readTid();
setupMemRequest(inst, cache_req, acc_size, flags);
+
+ //@todo: HACK: the DTB expects the correct PC in the ThreadContext
+ // but how if the memory accesses are speculative? Shouldn't
+ // we send along the requestor's PC to the translate functions?
+ ThreadContext *tc = cpu->thread[tid]->getTC();
+ PCState old_pc = tc->pcState();
+ tc->pcState() = inst->pcState();
inst->fault =
- _tlb->translateAtomic(cache_req->memReq,
- cpu->thread[tid]->getTC(), tlb_mode);
+ _tlb->translateAtomic(cache_req->memReq, tc, tlb_mode);
+ tc->pcState() = old_pc;
if (inst->fault != NoFault) {
DPRINTF(InOrderTLB, "[tid:%i]: %s encountered while translating "