summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2009-04-18 10:42:29 -0400
committerKorey Sewell <ksewell@umich.edu>2009-04-18 10:42:29 -0400
commitd8a34a9745d652b6e4484cf227754e7f23e48879 (patch)
tree71bec11e752db03d7a547b770ed915a25dff1e74 /src
parente501e1af54904fee4abc64df4888d24976fa6bef (diff)
downloadgem5-d8a34a9745d652b6e4484cf227754e7f23e48879.tar.xz
mips-tlb-fix: check for alignment faults.\nMIPS was never updated to use TLBS correcty in SE mode. The error was forwarding translations directly to pageTable. The TLB should check for alignment faults at bare minimum here but in the long run we should be using TLBs in SE mode for MIPS.
Diffstat (limited to 'src')
-rw-r--r--src/arch/mips/tlb.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/arch/mips/tlb.cc b/src/arch/mips/tlb.cc
index 9fc3e20ee..001dc2cb7 100644
--- a/src/arch/mips/tlb.cc
+++ b/src/arch/mips/tlb.cc
@@ -427,6 +427,18 @@ Fault
TLB::translateData(RequestPtr req, ThreadContext *tc, bool write)
{
#if !FULL_SYSTEM
+ //@TODO: This should actually use TLB instead of going directly
+ // to the page table in syscall mode.
+ /**
+ * Check for alignment faults
+ */
+ if (req->getVaddr() & (req->getSize() - 1)) {
+ DPRINTF(TLB, "Alignment Fault on %#x, size = %d", req->getVaddr(),
+ req->getSize());
+ return new AlignmentFault();
+ }
+
+
Process * p = tc->getProcessPtr();
Fault fault = p->pTable->translate(req);