diff -r 24b06cbf2d67 -r 78597062cf81 src/arch/x86/tlb.cc --- a/src/arch/x86/tlb.cc Sun Apr 22 05:20:44 2012 -0700 +++ b/src/arch/x86/tlb.cc Sun Apr 22 05:21:06 2012 -0700 @@ -103,6 +103,14 @@ TlbEntry *newEntry = NULL; if (freeList.empty()) evictLRU(); + + // If somebody beat us to it, just use that existing entry. + newEntry = trie.lookup(vpn); + if (newEntry) { + assert(newEntry->vaddr = vpn); + return newEntry; + } + newEntry = freeList.front(); freeList.pop_front(); @@ -110,7 +118,7 @@ newEntry->lruSeq = nextSeq(); newEntry->vaddr = vpn; newEntry->trieHandle = - trie.insert(vpn, TlbEntryTrie::MaxBits - entry.logBytes, newEntry); + trie.insert(vpn, TlbEntryTrie::MaxBits - entry.logBytes, newEntry); return newEntry; }