diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-03-21 15:54:58 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-03-21 15:54:58 +0000 |
commit | 8d8e926b04702e891553198bed99ef55f018d160 (patch) | |
tree | 634e7b854e4d07b2d1865017c767f66ef9260973 /src/arch/arm/table_walker.cc | |
parent | 1ab75c3ee2b330713a09d79709723ab2256d2c0b (diff) | |
download | gem5-8d8e926b04702e891553198bed99ef55f018d160.tar.xz |
arm: Refactor the TLB test interface
Refactor the TLB and page table walker test interface to use a dynamic
registration mechanism. Instead of patching a couple of empty methods
to wire up a TLB tester, this change allows such testers to register
themselves using the setTestInterface() method.
Diffstat (limited to 'src/arch/arm/table_walker.cc')
-rw-r--r-- | src/arch/arm/table_walker.cc | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/arch/arm/table_walker.cc b/src/arch/arm/table_walker.cc index fd8645e97..e1e00442d 100644 --- a/src/arch/arm/table_walker.cc +++ b/src/arch/arm/table_walker.cc @@ -502,9 +502,8 @@ TableWalker::processWalk() // Trickbox address check Fault f; - f = tlb->walkTrickBoxCheck(l1desc_addr, currState->isSecure, - currState->vaddr, sizeof(uint32_t), currState->isFetch, - currState->isWrite, TlbEntry::DomainType::NoAccess, L1); + f = testWalk(l1desc_addr, sizeof(uint32_t), + TlbEntry::DomainType::NoAccess, L1); if (f) { DPRINTF(TLB, "Trickbox check caused fault on %#x\n", currState->vaddr_tainted); if (currState->timing) { @@ -668,10 +667,8 @@ TableWalker::processWalkLPAE() } // Trickbox address check - Fault f = tlb->walkTrickBoxCheck(desc_addr, currState->isSecure, - currState->vaddr, sizeof(uint64_t), currState->isFetch, - currState->isWrite, TlbEntry::DomainType::NoAccess, - start_lookup_level); + Fault f = testWalk(desc_addr, sizeof(uint64_t), + TlbEntry::DomainType::NoAccess, start_lookup_level); if (f) { DPRINTF(TLB, "Trickbox check caused fault on %#x\n", currState->vaddr_tainted); if (currState->timing) { @@ -913,10 +910,8 @@ TableWalker::processWalkAArch64() stride * (3 - start_lookup_level) + tg) << 3); // Trickbox address check - Fault f = tlb->walkTrickBoxCheck(desc_addr, currState->isSecure, - currState->vaddr, sizeof(uint64_t), currState->isFetch, - currState->isWrite, TlbEntry::DomainType::NoAccess, - start_lookup_level); + Fault f = testWalk(desc_addr, sizeof(uint64_t), + TlbEntry::DomainType::NoAccess, start_lookup_level); if (f) { DPRINTF(TLB, "Trickbox check caused fault on %#x\n", currState->vaddr_tainted); if (currState->timing) { @@ -1437,10 +1432,8 @@ TableWalker::doL1Descriptor() l2desc_addr, currState->isSecure ? "s" : "ns"); // Trickbox address check - currState->fault = tlb->walkTrickBoxCheck( - l2desc_addr, currState->isSecure, currState->vaddr, - sizeof(uint32_t), currState->isFetch, currState->isWrite, - currState->l1Desc.domain(), L2); + currState->fault = testWalk(l2desc_addr, sizeof(uint32_t), + currState->l1Desc.domain(), L2); if (currState->fault) { if (!currState->timing) { @@ -1616,12 +1609,9 @@ TableWalker::doLongDescriptor() } // Trickbox address check - currState->fault = tlb->walkTrickBoxCheck( - next_desc_addr, currState->vaddr, - currState->vaddr, sizeof(uint64_t), - currState->isFetch, currState->isWrite, - TlbEntry::DomainType::Client, - toLookupLevel(currState->longDesc.lookupLevel +1)); + currState->fault = testWalk( + next_desc_addr, sizeof(uint64_t), TlbEntry::DomainType::Client, + toLookupLevel(currState->longDesc.lookupLevel +1)); if (currState->fault) { if (!currState->timing) { @@ -2096,6 +2086,15 @@ TableWalker::pendingChange() } } +Fault +TableWalker::testWalk(Addr pa, Addr size, TlbEntry::DomainType domain, + LookupLevel lookup_level) +{ + return tlb->testWalk(pa, size, currState->vaddr, currState->isSecure, + currState->mode, domain, lookup_level); +} + + uint8_t TableWalker::pageSizeNtoStatBin(uint8_t N) { |