From 60579e8d74cecea5737a4502599ccf77e9e6a35e Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Sun, 10 Jul 2011 12:56:08 -0500 Subject: O3: Make sure fetch doesn't go off into the weeds during speculation. --- src/cpu/o3/fetch_impl.hh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/cpu/o3/fetch_impl.hh') diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh index 8b1797f11..118f132ca 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -633,6 +633,18 @@ DefaultFetch::finishTranslation(Fault fault, RequestPtr mem_req) // If translation was successful, attempt to read the icache block. if (fault == NoFault) { + // Check that we're not going off into random memory + // If we have, just wait around for commit to squash something and put + // us on the right track + if (!cpu->system->isMemory(mem_req->getPaddr())) { + warn("Address %#x is outside of physical memory, stopping fetch\n", + mem_req->getPaddr()); + fetchStatus[tid] = NoGoodAddr; + delete mem_req; + memReq[tid] = NULL; + return; + } + // Build packet here. PacketPtr data_pkt = new Packet(mem_req, MemCmd::ReadReq, Packet::Broadcast); @@ -1162,9 +1174,13 @@ DefaultFetch::fetch(bool &status_change) } else if (fetchStatus[tid] == TrapPending) { DPRINTF(Fetch, "[tid:%i]: Fetch is waiting for a pending trap\n", tid); + } else if (fetchStatus[tid] == NoGoodAddr) { + DPRINTF(Fetch, "[tid:%i]: Fetch predicted non-executable address\n", + tid); } + // Status is Idle, Squashing, Blocked, ItlbWait or IcacheWaitResponse // so fetch should do nothing. return; -- cgit v1.2.3