From a4e722725c90677d555675eca616c9d0990393f1 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 8 Jan 2018 23:37:57 -0800 Subject: tarch, mem: Abstract the data stored in the SE page tables. Rather than store the actual TLB entry that corresponds to a mapping, we can just store some abstracted information (address, a few flags) and then let the caller turn that into the appropriate entry. There could potentially be some small amount of overhead from creating entries vs. storing them and just installing them, but it's likely pretty minimal since that only happens on a TLB miss (ideally rare), and, if it is problematic, there could be some preallocated TLB entries which are just minimally filled in as necessary. This has the nice effect of finally making the page tables ISA agnostic. Change-Id: I11e630f60682f0a0029b0683eb8ff0135fbd4317 Reviewed-on: https://gem5-review.googlesource.com/7350 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/arch/alpha/faults.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/arch/alpha') diff --git a/src/arch/alpha/faults.cc b/src/arch/alpha/faults.cc index 89b0ecea8..3433844c1 100644 --- a/src/arch/alpha/faults.cc +++ b/src/arch/alpha/faults.cc @@ -196,11 +196,14 @@ ItbPageFault::invoke(ThreadContext *tc, const StaticInstPtr &inst) } Process *p = tc->getProcessPtr(); - TlbEntry *entry = p->pTable->lookup(pc); - panic_if(!entry, "Tried to execute unmapped address %#x.\n", pc); + const EmulationPageTable::Entry *pte = p->pTable->lookup(pc); + panic_if(!pte, "Tried to execute unmapped address %#x.\n", pc); VAddr vaddr(pc); - dynamic_cast(tc->getITBPtr())->insert(vaddr.page(), *entry); + TlbEntry entry(p->pTable->pid(), vaddr.page(), pte->paddr, + pte->flags & EmulationPageTable::Uncacheable, + pte->flags & EmulationPageTable::ReadOnly); + dynamic_cast(tc->getITBPtr())->insert(vaddr.page(), entry); } void @@ -212,11 +215,14 @@ NDtbMissFault::invoke(ThreadContext *tc, const StaticInstPtr &inst) } Process *p = tc->getProcessPtr(); - TlbEntry *entry = p->pTable->lookup(vaddr); - if (!entry && p->fixupStackFault(vaddr)) - entry = p->pTable->lookup(vaddr); - panic_if(!entry, "Tried to access unmapped address %#x.\n", (Addr)vaddr); - dynamic_cast(tc->getDTBPtr())->insert(vaddr.page(), *entry); + const EmulationPageTable::Entry *pte = p->pTable->lookup(vaddr); + if (!pte && p->fixupStackFault(vaddr)) + pte = p->pTable->lookup(vaddr); + panic_if(!pte, "Tried to access unmapped address %#x.\n", (Addr)vaddr); + TlbEntry entry(p->pTable->pid(), vaddr.page(), pte->paddr, + pte->flags & EmulationPageTable::Uncacheable, + pte->flags & EmulationPageTable::ReadOnly); + dynamic_cast(tc->getDTBPtr())->insert(vaddr.page(), entry); } } // namespace AlphaISA -- cgit v1.2.3