1/* 2 * Copyright (c) 2010, 2012-2018 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 --- 1522 unchanged lines hidden (view full) --- 1531 1532 return; 1533 } 1534 default: 1535 panic("A new type in a 2 bit field?\n"); 1536 } 1537} 1538 |
1539Fault 1540TableWalker::generateLongDescFault(ArmFault::FaultSource src) 1541{ 1542 if (currState->isFetch) { 1543 return std::make_shared<PrefetchAbort>( 1544 currState->vaddr_tainted, 1545 src + currState->longDesc.lookupLevel, 1546 isStage2, 1547 ArmFault::LpaeTran); 1548 } else { 1549 return std::make_shared<DataAbort>( 1550 currState->vaddr_tainted, 1551 TlbEntry::DomainType::NoAccess, 1552 currState->isWrite, 1553 src + currState->longDesc.lookupLevel, 1554 isStage2, 1555 ArmFault::LpaeTran); 1556 } 1557} 1558 |
1559void 1560TableWalker::doLongDescriptor() 1561{ 1562 if (currState->fault != NoFault) { 1563 return; 1564 } 1565 1566 currState->longDesc.data = htog(currState->longDesc.data, --- 29 unchanged lines hidden (view full) --- 1596 if (!currState->timing) { 1597 currState->tc = NULL; 1598 currState->req = NULL; 1599 } 1600 1601 DPRINTF(TLB, "L%d descriptor Invalid, causing fault type %d\n", 1602 currState->longDesc.lookupLevel, 1603 ArmFault::TranslationLL + currState->longDesc.lookupLevel); |
1604 1605 currState->fault = generateLongDescFault(ArmFault::TranslationLL); |
1606 return; |
1607 |
1608 case LongDescriptor::Block: 1609 case LongDescriptor::Page: 1610 { |
1611 auto fault_source = ArmFault::FaultSourceInvalid; |
1612 // Check for address size fault 1613 if (checkAddrSizeFaultAArch64( 1614 mbits(currState->longDesc.data, MaxPhysAddrRange - 1, 1615 currState->longDesc.offsetBits()), 1616 currState->physAddrRange)) { |
1617 |
1618 DPRINTF(TLB, "L%d descriptor causing Address Size Fault\n", 1619 currState->longDesc.lookupLevel); |
1620 fault_source = ArmFault::AddressSizeLL; 1621 |
1622 // Check for access fault 1623 } else if (currState->longDesc.af() == 0) { |
1624 |
1625 DPRINTF(TLB, "L%d descriptor causing Access Fault\n", 1626 currState->longDesc.lookupLevel); |
1627 fault_source = ArmFault::AccessFlagLL; |
1628 } |
1629 1630 if (fault_source != ArmFault::FaultSourceInvalid) { 1631 currState->fault = generateLongDescFault(fault_source); |
1632 } else { 1633 insertTableEntry(currState->longDesc, true); 1634 } 1635 } 1636 return; 1637 case LongDescriptor::Table: 1638 { 1639 // Set hierarchical permission flags --- 18 unchanged lines hidden (view full) --- 1658 next_desc_addr, 1659 currState->secureLookup ? "s" : "ns"); 1660 1661 // Check for address size fault 1662 if (currState->aarch64 && checkAddrSizeFaultAArch64( 1663 next_desc_addr, currState->physAddrRange)) { 1664 DPRINTF(TLB, "L%d descriptor causing Address Size Fault\n", 1665 currState->longDesc.lookupLevel); |
1666 1667 currState->fault = generateLongDescFault( 1668 ArmFault::AddressSizeLL); |
1669 return; 1670 } 1671 1672 // Trickbox address check 1673 currState->fault = testWalk( 1674 next_desc_addr, sizeof(uint64_t), TlbEntry::DomainType::Client, 1675 toLookupLevel(currState->longDesc.lookupLevel +1)); 1676 --- 599 unchanged lines hidden --- |