diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2009-02-25 10:17:27 -0800 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2009-02-25 10:17:27 -0800 |
commit | e4ede69b2f97206d836719839221531f3e01149e (patch) | |
tree | c1e10de4a74d8edc29021b2b6aeedc3912ad9260 /src | |
parent | 99aa121fca8c893fb9f5b83b2568893033818ae3 (diff) | |
download | gem5-e4ede69b2f97206d836719839221531f3e01149e.tar.xz |
X86: Add a trace flag for the page table walker.
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/x86/SConscript | 2 | ||||
-rw-r--r-- | src/arch/x86/pagetable_walker.cc | 21 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/arch/x86/SConscript b/src/arch/x86/SConscript index a57e388ea..8c1aec7a7 100644 --- a/src/arch/x86/SConscript +++ b/src/arch/x86/SConscript @@ -111,6 +111,8 @@ if env['TARGET_ISA'] == 'x86': if env['FULL_SYSTEM']: TraceFlag('LocalApic', "Local APIC debugging") + TraceFlag('PageTableWalker', \ + "Page table walker state machine debugging") SimObject('X86LocalApic.py') SimObject('X86System.py') diff --git a/src/arch/x86/pagetable_walker.cc b/src/arch/x86/pagetable_walker.cc index 87f00dcbe..f625cf4bd 100644 --- a/src/arch/x86/pagetable_walker.cc +++ b/src/arch/x86/pagetable_walker.cc @@ -101,6 +101,8 @@ Walker::doNext(PacketPtr &write) bool badNX = pte.nx && (!tlb->allowNX() || !enableNX); switch(state) { case LongPML4: + DPRINTF(PageTableWalker, + "Got long mode PML4 entry %#016x.\n", (uint64_t)pte); nextRead = ((uint64_t)pte & (mask(40) << 12)) + vaddr.longl3 * size; doWrite = !pte.a; pte.a = 1; @@ -114,6 +116,8 @@ Walker::doNext(PacketPtr &write) nextState = LongPDP; break; case LongPDP: + DPRINTF(PageTableWalker, + "Got long mode PDP entry %#016x.\n", (uint64_t)pte); nextRead = ((uint64_t)pte & (mask(40) << 12)) + vaddr.longl2 * size; doWrite = !pte.a; pte.a = 1; @@ -126,6 +130,8 @@ Walker::doNext(PacketPtr &write) nextState = LongPD; break; case LongPD: + DPRINTF(PageTableWalker, + "Got long mode PD entry %#016x.\n", (uint64_t)pte); doWrite = !pte.a; pte.a = 1; entry.writable = entry.writable && pte.w; @@ -154,6 +160,8 @@ Walker::doNext(PacketPtr &write) return NoFault; } case LongPTE: + DPRINTF(PageTableWalker, + "Got long mode PTE entry %#016x.\n", (uint64_t)pte); doWrite = !pte.a; pte.a = 1; entry.writable = entry.writable && pte.w; @@ -171,6 +179,8 @@ Walker::doNext(PacketPtr &write) stop(); return NoFault; case PAEPDP: + DPRINTF(PageTableWalker, + "Got legacy mode PAE PDP entry %#08x.\n", (uint32_t)pte); nextRead = ((uint64_t)pte & (mask(40) << 12)) + vaddr.pael2 * size; if (!pte.p) { stop(); @@ -179,6 +189,8 @@ Walker::doNext(PacketPtr &write) nextState = PAEPD; break; case PAEPD: + DPRINTF(PageTableWalker, + "Got legacy mode PAE PD entry %#08x.\n", (uint32_t)pte); doWrite = !pte.a; pte.a = 1; entry.writable = pte.w; @@ -206,6 +218,8 @@ Walker::doNext(PacketPtr &write) return NoFault; } case PAEPTE: + DPRINTF(PageTableWalker, + "Got legacy mode PAE PTE entry %#08x.\n", (uint32_t)pte); doWrite = !pte.a; pte.a = 1; entry.writable = entry.writable && pte.w; @@ -223,6 +237,8 @@ Walker::doNext(PacketPtr &write) stop(); return NoFault; case PSEPD: + DPRINTF(PageTableWalker, + "Got legacy mode PSE PD entry %#08x.\n", (uint32_t)pte); doWrite = !pte.a; pte.a = 1; entry.writable = pte.w; @@ -251,6 +267,8 @@ Walker::doNext(PacketPtr &write) return NoFault; } case PD: + DPRINTF(PageTableWalker, + "Got legacy mode PD entry %#08x.\n", (uint32_t)pte); doWrite = !pte.a; pte.a = 1; entry.writable = pte.w; @@ -265,6 +283,8 @@ Walker::doNext(PacketPtr &write) nextState = PTE; break; case PTE: + DPRINTF(PageTableWalker, + "Got legacy mode PTE entry %#08x.\n", (uint32_t)pte); doWrite = !pte.a; pte.a = 1; entry.writable = pte.w; @@ -541,6 +561,7 @@ Walker::getPort(const std::string &if_name, int idx) Fault Walker::pageFault(bool present) { + DPRINTF(PageTableWalker, "Raising page fault.\n"); HandyM5Reg m5reg = tc->readMiscRegNoEffect(MISCREG_M5_REG); return new PageFault(entry.vaddr, present, write, m5reg.cpl == 3, false, execute && enableNX); |