diff options
-rw-r--r-- | src/mem/multi_level_page_table_impl.hh | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mem/multi_level_page_table_impl.hh b/src/mem/multi_level_page_table_impl.hh index 063e097c5..3d8cbe75d 100644 --- a/src/mem/multi_level_page_table_impl.hh +++ b/src/mem/multi_level_page_table_impl.hh @@ -151,14 +151,13 @@ MultiLevelPageTable<ISAOps>::map(Addr vaddr, Addr paddr, if (walk(vaddr, true, PTE_addr)) { PageTableEntry PTE = p.read<PageTableEntry>(PTE_addr); Addr entry_paddr = pTableISAOps.getPnum(PTE); - if (!clobber && entry_paddr == 0) { - pTableISAOps.setPnum(PTE, paddr >> PageShift); - pTableISAOps.setPTEFields(PTE); - p.write<PageTableEntry>(PTE_addr, PTE); - DPRINTF(MMU, "New mapping: %#x-%#x\n", vaddr, paddr); - } else { + if (!clobber && entry_paddr != 0) { fatal("addr 0x%x already mapped to %x", vaddr, entry_paddr); } + pTableISAOps.setPnum(PTE, paddr >> PageShift); + pTableISAOps.setPTEFields(PTE); + p.write<PageTableEntry>(PTE_addr, PTE); + DPRINTF(MMU, "New mapping: %#x-%#x\n", vaddr, paddr); eraseCacheEntry(vaddr); updateCache(vaddr, TlbEntry(pid, vaddr, paddr)); |