table_walker.cc (11181:4daf60db14d7) table_walker.cc (11395:032bc62120eb)
1/*
2 * Copyright (c) 2010, 2012-2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 488 unchanged lines hidden (view full) ---

497
498 Addr l1desc_addr = mbits(ttbr, 31, 14 - currState->ttbcr.n) |
499 (bits(currState->vaddr, 31 - currState->ttbcr.n, 20) << 2);
500 DPRINTF(TLB, " - Descriptor at address %#x (%s)\n", l1desc_addr,
501 currState->isSecure ? "s" : "ns");
502
503 // Trickbox address check
504 Fault f;
1/*
2 * Copyright (c) 2010, 2012-2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 488 unchanged lines hidden (view full) ---

497
498 Addr l1desc_addr = mbits(ttbr, 31, 14 - currState->ttbcr.n) |
499 (bits(currState->vaddr, 31 - currState->ttbcr.n, 20) << 2);
500 DPRINTF(TLB, " - Descriptor at address %#x (%s)\n", l1desc_addr,
501 currState->isSecure ? "s" : "ns");
502
503 // Trickbox address check
504 Fault f;
505 f = tlb->walkTrickBoxCheck(l1desc_addr, currState->isSecure,
506 currState->vaddr, sizeof(uint32_t), currState->isFetch,
507 currState->isWrite, TlbEntry::DomainType::NoAccess, L1);
505 f = testWalk(l1desc_addr, sizeof(uint32_t),
506 TlbEntry::DomainType::NoAccess, L1);
508 if (f) {
509 DPRINTF(TLB, "Trickbox check caused fault on %#x\n", currState->vaddr_tainted);
510 if (currState->timing) {
511 pending = false;
512 nextWalk(currState->tc);
513 currState = NULL;
514 } else {
515 currState->tc = NULL;

--- 147 unchanged lines hidden (view full) ---

663 n = (tsz >= 2 ? 14 - tsz : 12);
664 desc_addr = mbits(ttbr, 39, n) |
665 (bits(currState->vaddr, n + 17, 21) << 3);
666 DPRINTF(TLB, " - Descriptor at address %#x (%s) (long-desc.)\n",
667 desc_addr, currState->isSecure ? "s" : "ns");
668 }
669
670 // Trickbox address check
507 if (f) {
508 DPRINTF(TLB, "Trickbox check caused fault on %#x\n", currState->vaddr_tainted);
509 if (currState->timing) {
510 pending = false;
511 nextWalk(currState->tc);
512 currState = NULL;
513 } else {
514 currState->tc = NULL;

--- 147 unchanged lines hidden (view full) ---

662 n = (tsz >= 2 ? 14 - tsz : 12);
663 desc_addr = mbits(ttbr, 39, n) |
664 (bits(currState->vaddr, n + 17, 21) << 3);
665 DPRINTF(TLB, " - Descriptor at address %#x (%s) (long-desc.)\n",
666 desc_addr, currState->isSecure ? "s" : "ns");
667 }
668
669 // Trickbox address check
671 Fault f = tlb->walkTrickBoxCheck(desc_addr, currState->isSecure,
672 currState->vaddr, sizeof(uint64_t), currState->isFetch,
673 currState->isWrite, TlbEntry::DomainType::NoAccess,
674 start_lookup_level);
670 Fault f = testWalk(desc_addr, sizeof(uint64_t),
671 TlbEntry::DomainType::NoAccess, start_lookup_level);
675 if (f) {
676 DPRINTF(TLB, "Trickbox check caused fault on %#x\n", currState->vaddr_tainted);
677 if (currState->timing) {
678 pending = false;
679 nextWalk(currState->tc);
680 currState = NULL;
681 } else {
682 currState->tc = NULL;

--- 225 unchanged lines hidden (view full) ---

908 }
909
910 // Determine descriptor address
911 Addr desc_addr = base_addr |
912 (bits(currState->vaddr, tsz - 1,
913 stride * (3 - start_lookup_level) + tg) << 3);
914
915 // Trickbox address check
672 if (f) {
673 DPRINTF(TLB, "Trickbox check caused fault on %#x\n", currState->vaddr_tainted);
674 if (currState->timing) {
675 pending = false;
676 nextWalk(currState->tc);
677 currState = NULL;
678 } else {
679 currState->tc = NULL;

--- 225 unchanged lines hidden (view full) ---

905 }
906
907 // Determine descriptor address
908 Addr desc_addr = base_addr |
909 (bits(currState->vaddr, tsz - 1,
910 stride * (3 - start_lookup_level) + tg) << 3);
911
912 // Trickbox address check
916 Fault f = tlb->walkTrickBoxCheck(desc_addr, currState->isSecure,
917 currState->vaddr, sizeof(uint64_t), currState->isFetch,
918 currState->isWrite, TlbEntry::DomainType::NoAccess,
919 start_lookup_level);
913 Fault f = testWalk(desc_addr, sizeof(uint64_t),
914 TlbEntry::DomainType::NoAccess, start_lookup_level);
920 if (f) {
921 DPRINTF(TLB, "Trickbox check caused fault on %#x\n", currState->vaddr_tainted);
922 if (currState->timing) {
923 pending = false;
924 nextWalk(currState->tc);
925 currState = NULL;
926 } else {
927 currState->tc = NULL;

--- 504 unchanged lines hidden (view full) ---

1432 {
1433 Addr l2desc_addr;
1434 l2desc_addr = currState->l1Desc.l2Addr() |
1435 (bits(currState->vaddr, 19, 12) << 2);
1436 DPRINTF(TLB, "L1 descriptor points to page table at: %#x (%s)\n",
1437 l2desc_addr, currState->isSecure ? "s" : "ns");
1438
1439 // Trickbox address check
915 if (f) {
916 DPRINTF(TLB, "Trickbox check caused fault on %#x\n", currState->vaddr_tainted);
917 if (currState->timing) {
918 pending = false;
919 nextWalk(currState->tc);
920 currState = NULL;
921 } else {
922 currState->tc = NULL;

--- 504 unchanged lines hidden (view full) ---

1427 {
1428 Addr l2desc_addr;
1429 l2desc_addr = currState->l1Desc.l2Addr() |
1430 (bits(currState->vaddr, 19, 12) << 2);
1431 DPRINTF(TLB, "L1 descriptor points to page table at: %#x (%s)\n",
1432 l2desc_addr, currState->isSecure ? "s" : "ns");
1433
1434 // Trickbox address check
1440 currState->fault = tlb->walkTrickBoxCheck(
1441 l2desc_addr, currState->isSecure, currState->vaddr,
1442 sizeof(uint32_t), currState->isFetch, currState->isWrite,
1443 currState->l1Desc.domain(), L2);
1435 currState->fault = testWalk(l2desc_addr, sizeof(uint32_t),
1436 currState->l1Desc.domain(), L2);
1444
1445 if (currState->fault) {
1446 if (!currState->timing) {
1447 currState->tc = NULL;
1448 currState->req = NULL;
1449 }
1450 return;
1451 }

--- 159 unchanged lines hidden (view full) ---

1611 ArmFault::AddressSizeLL
1612 + currState->longDesc.lookupLevel,
1613 isStage2,
1614 ArmFault::LpaeTran);
1615 return;
1616 }
1617
1618 // Trickbox address check
1437
1438 if (currState->fault) {
1439 if (!currState->timing) {
1440 currState->tc = NULL;
1441 currState->req = NULL;
1442 }
1443 return;
1444 }

--- 159 unchanged lines hidden (view full) ---

1604 ArmFault::AddressSizeLL
1605 + currState->longDesc.lookupLevel,
1606 isStage2,
1607 ArmFault::LpaeTran);
1608 return;
1609 }
1610
1611 // Trickbox address check
1619 currState->fault = tlb->walkTrickBoxCheck(
1620 next_desc_addr, currState->vaddr,
1621 currState->vaddr, sizeof(uint64_t),
1622 currState->isFetch, currState->isWrite,
1623 TlbEntry::DomainType::Client,
1624 toLookupLevel(currState->longDesc.lookupLevel +1));
1612 currState->fault = testWalk(
1613 next_desc_addr, sizeof(uint64_t), TlbEntry::DomainType::Client,
1614 toLookupLevel(currState->longDesc.lookupLevel +1));
1625
1626 if (currState->fault) {
1627 if (!currState->timing) {
1628 currState->tc = NULL;
1629 currState->req = NULL;
1630 }
1631 return;
1632 }

--- 458 unchanged lines hidden (view full) ---

2091 if (n != pendingReqs) {
2092 Tick now = curTick();
2093 statPendingWalks.sample(pendingReqs, now - pendingChangeTick);
2094 pendingReqs = n;
2095 pendingChangeTick = now;
2096 }
2097}
2098
1615
1616 if (currState->fault) {
1617 if (!currState->timing) {
1618 currState->tc = NULL;
1619 currState->req = NULL;
1620 }
1621 return;
1622 }

--- 458 unchanged lines hidden (view full) ---

2081 if (n != pendingReqs) {
2082 Tick now = curTick();
2083 statPendingWalks.sample(pendingReqs, now - pendingChangeTick);
2084 pendingReqs = n;
2085 pendingChangeTick = now;
2086 }
2087}
2088
2089Fault
2090TableWalker::testWalk(Addr pa, Addr size, TlbEntry::DomainType domain,
2091 LookupLevel lookup_level)
2092{
2093 return tlb->testWalk(pa, size, currState->vaddr, currState->isSecure,
2094 currState->mode, domain, lookup_level);
2095}
2096
2097
2099uint8_t
2100TableWalker::pageSizeNtoStatBin(uint8_t N)
2101{
2102 /* for statPageSizes */
2103 switch(N) {
2104 case 12: return 0; // 4K
2105 case 14: return 1; // 16K (using 16K granule in v8-64)
2106 case 16: return 2; // 64K

--- 114 unchanged lines hidden ---
2098uint8_t
2099TableWalker::pageSizeNtoStatBin(uint8_t N)
2100{
2101 /* for statPageSizes */
2102 switch(N) {
2103 case 12: return 0; // 4K
2104 case 14: return 1; // 16K (using 16K granule in v8-64)
2105 case 16: return 2; // 64K

--- 114 unchanged lines hidden ---