"sfence in user mode or TVM enabled",
machInst);
}
- xc->tcBase()->getITBPtr()->demapPage(Rs1, Rs2);
- xc->tcBase()->getDTBPtr()->demapPage(Rs1, Rs2);
+ xc->tcBase()->getMMUPtr()->demapPage(Rs1, Rs2);
}}, IsNonSpeculative, IsSerializeAfter, No_OpClass);
0x18: mret({{
if (xc->readMiscReg(MISCREG_PRV) != PRV_M) {
#include "arch/riscv/decoder.hh"
#include "arch/riscv/faults.hh"
-#include "arch/riscv/tlb.hh"
+#include "arch/riscv/mmu.hh"
#include "base/cprintf.hh"
#include "base/loader/symtab.hh"
#include "cpu/thread_context.hh"
#include "arch/generic/memhelpers.hh"
#include "arch/riscv/faults.hh"
+#include "arch/riscv/mmu.hh"
#include "arch/riscv/registers.hh"
#include "arch/riscv/utility.hh"
#include "base/condcodes.hh"
#define __ARCH_RISCV_MMU_HH__
#include "arch/generic/mmu.hh"
+#include "arch/riscv/isa.hh"
+#include "arch/riscv/tlb.hh"
#include "params/RiscvMMU.hh"
MMU(const RiscvMMUParams &p)
: BaseMMU(p)
{}
+
+ PrivilegeMode
+ getMemPriv(ThreadContext *tc, BaseTLB::Mode mode)
+ {
+ return static_cast<TLB*>(dtb)->getMemPriv(tc, mode);
+ }
+
+ Walker *
+ getDataWalker()
+ {
+ return static_cast<TLB*>(dtb)->getWalker();
+ }
};
} // namespace RiscvISA
#include <string>
+#include "arch/riscv/mmu.hh"
#include "arch/riscv/pagetable_walker.hh"
#include "arch/riscv/registers.hh"
-#include "arch/riscv/tlb.hh"
#include "cpu/thread_state.hh"
#include "debug/GDBAcc.hh"
#include "mem/page_table.hh"
{
if (FullSystem)
{
- TLB *tlb = dynamic_cast<TLB *>(context()->getDTBPtr());
+ MMU *mmu = static_cast<MMU *>(context()->getMMUPtr());
unsigned logBytes;
Addr paddr = va;
- PrivilegeMode pmode = tlb->getMemPriv(context(), BaseTLB::Read);
+ PrivilegeMode pmode = mmu->getMemPriv(context(), BaseTLB::Read);
SATP satp = context()->readMiscReg(MISCREG_SATP);
if (pmode != PrivilegeMode::PRV_M &&
satp.mode != AddrXlateMode::BARE) {
- Walker *walker = tlb->getWalker();
+ Walker *walker = mmu->getDataWalker();
Fault fault = walker->startFunctional(
context(), paddr, logBytes, BaseTLB::Read);
if (fault != NoFault)
#include "arch/riscv/faults.hh"
#include "arch/riscv/fs_workload.hh"
+#include "arch/riscv/mmu.hh"
#include "arch/riscv/pagetable.hh"
#include "arch/riscv/pagetable_walker.hh"
#include "arch/riscv/pra_constants.hh"
Addr paddr = vaddr;
if (FullSystem) {
- TLB *tlb = dynamic_cast<TLB *>(tc->getDTBPtr());
+ MMU *mmu = static_cast<MMU *>(tc->getMMUPtr());
- PrivilegeMode pmode = tlb->getMemPriv(tc, mode);
+ PrivilegeMode pmode = mmu->getMemPriv(tc, mode);
SATP satp = tc->readMiscReg(MISCREG_SATP);
if (pmode != PrivilegeMode::PRV_M &&
satp.mode != AddrXlateMode::BARE) {
- Walker *walker = tlb->getWalker();
+ Walker *walker = mmu->getDataWalker();
unsigned logBytes;
Fault fault = walker->startFunctional(
tc, paddr, logBytes, mode);