table_walker.cc (12735:e3da526a0654) | table_walker.cc (12738:1ac09a70644f) |
---|---|
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 --- 118 unchanged lines hidden (view full) --- 127 return MemObject::getMasterPort(if_name, idx); 128} 129 130TableWalker::WalkerState::WalkerState() : 131 tc(nullptr), aarch64(false), el(EL0), physAddrRange(0), req(nullptr), 132 asid(0), vmid(0), isHyp(false), transState(nullptr), 133 vaddr(0), vaddr_tainted(0), isWrite(false), isFetch(false), isSecure(false), 134 secureLookup(false), rwTable(false), userTable(false), xnTable(false), | 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 --- 118 unchanged lines hidden (view full) --- 127 return MemObject::getMasterPort(if_name, idx); 128} 129 130TableWalker::WalkerState::WalkerState() : 131 tc(nullptr), aarch64(false), el(EL0), physAddrRange(0), req(nullptr), 132 asid(0), vmid(0), isHyp(false), transState(nullptr), 133 vaddr(0), vaddr_tainted(0), isWrite(false), isFetch(false), isSecure(false), 134 secureLookup(false), rwTable(false), userTable(false), xnTable(false), |
135 pxnTable(false), stage2Req(false), doingStage2(false), | 135 pxnTable(false), stage2Req(false), |
136 stage2Tran(nullptr), timing(false), functional(false), 137 mode(BaseTLB::Read), tranType(TLB::NormalTran), l2Desc(l1Desc), 138 delayed(false), tableWalker(nullptr) 139{ 140} 141 142void 143TableWalker::completeDrain() --- 153 unchanged lines hidden (view full) --- 297 } 298 sctlr = currState->sctlr; 299 300 currState->isFetch = (currState->mode == TLB::Execute); 301 currState->isWrite = (currState->mode == TLB::Write); 302 303 statRequestOrigin[REQUESTED][currState->isFetch]++; 304 | 136 stage2Tran(nullptr), timing(false), functional(false), 137 mode(BaseTLB::Read), tranType(TLB::NormalTran), l2Desc(l1Desc), 138 delayed(false), tableWalker(nullptr) 139{ 140} 141 142void 143TableWalker::completeDrain() --- 153 unchanged lines hidden (view full) --- 297 } 298 sctlr = currState->sctlr; 299 300 currState->isFetch = (currState->mode == TLB::Execute); 301 currState->isWrite = (currState->mode == TLB::Write); 302 303 statRequestOrigin[REQUESTED][currState->isFetch]++; 304 |
305 // We only do a second stage of translation if we're not secure, or in 306 // hyp mode, the second stage MMU is enabled, and this table walker 307 // instance is the first stage. 308 // TODO: fix setting of doingStage2 for timing mode 309 currState->doingStage2 = false; | |
310 currState->stage2Req = _stage2Req && !isStage2; 311 312 bool long_desc_format = currState->aarch64 || _isHyp || isStage2 || 313 longDescFormatInUse(currState->tc); 314 315 if (long_desc_format) { 316 // Helper variables used for hierarchical permissions 317 currState->secureLookup = currState->isSecure; --- 1494 unchanged lines hidden (view full) --- 1812 currState->req = NULL; 1813 currState->tc = NULL; 1814 currState->delayed = false; 1815 delete currState; 1816 } 1817 else if (!currState->delayed) { 1818 // delay is not set so there is no L2 to do 1819 // Don't finish the translation if a stage 2 look up is underway | 305 currState->stage2Req = _stage2Req && !isStage2; 306 307 bool long_desc_format = currState->aarch64 || _isHyp || isStage2 || 308 longDescFormatInUse(currState->tc); 309 310 if (long_desc_format) { 311 // Helper variables used for hierarchical permissions 312 currState->secureLookup = currState->isSecure; --- 1494 unchanged lines hidden (view full) --- 1807 currState->req = NULL; 1808 currState->tc = NULL; 1809 currState->delayed = false; 1810 delete currState; 1811 } 1812 else if (!currState->delayed) { 1813 // delay is not set so there is no L2 to do 1814 // Don't finish the translation if a stage 2 look up is underway |
1820 if (!currState->doingStage2) { 1821 statWalkServiceTime.sample(curTick() - currState->startTime); 1822 DPRINTF(TLBVerbose, "calling translateTiming again\n"); 1823 tlb->translateTiming(currState->req, currState->tc, 1824 currState->transState, currState->mode); 1825 statWalksShortTerminatedAtLevel[0]++; 1826 } | 1815 statWalkServiceTime.sample(curTick() - currState->startTime); 1816 DPRINTF(TLBVerbose, "calling translateTiming again\n"); 1817 tlb->translateTiming(currState->req, currState->tc, 1818 currState->transState, currState->mode); 1819 statWalksShortTerminatedAtLevel[0]++; |
1827 1828 pending = false; 1829 nextWalk(currState->tc); 1830 1831 currState->req = NULL; 1832 currState->tc = NULL; 1833 currState->delayed = false; 1834 delete currState; --- 19 unchanged lines hidden (view full) --- 1854 currState->vaddr_tainted); 1855 doL2Descriptor(); 1856 1857 // Check if fault was generated 1858 if (currState->fault != NoFault) { 1859 currState->transState->finish(currState->fault, currState->req, 1860 currState->tc, currState->mode); 1861 statWalksShortTerminatedAtLevel[1]++; | 1820 1821 pending = false; 1822 nextWalk(currState->tc); 1823 1824 currState->req = NULL; 1825 currState->tc = NULL; 1826 currState->delayed = false; 1827 delete currState; --- 19 unchanged lines hidden (view full) --- 1847 currState->vaddr_tainted); 1848 doL2Descriptor(); 1849 1850 // Check if fault was generated 1851 if (currState->fault != NoFault) { 1852 currState->transState->finish(currState->fault, currState->req, 1853 currState->tc, currState->mode); 1854 statWalksShortTerminatedAtLevel[1]++; |
1855 } else { 1856 statWalkServiceTime.sample(curTick() - currState->startTime); 1857 DPRINTF(TLBVerbose, "calling translateTiming again\n"); 1858 tlb->translateTiming(currState->req, currState->tc, 1859 currState->transState, currState->mode); 1860 statWalksShortTerminatedAtLevel[1]++; |
|
1862 } | 1861 } |
1863 else { 1864 // Don't finish the translation if a stage 2 look up is underway 1865 if (!currState->doingStage2) { 1866 statWalkServiceTime.sample(curTick() - currState->startTime); 1867 DPRINTF(TLBVerbose, "calling translateTiming again\n"); 1868 tlb->translateTiming(currState->req, currState->tc, 1869 currState->transState, currState->mode); 1870 statWalksShortTerminatedAtLevel[1]++; 1871 } 1872 } | |
1873 1874 1875 stateQueues[L2].pop_front(); 1876 pending = false; 1877 nextWalk(currState->tc); 1878 1879 currState->req = NULL; 1880 currState->tc = NULL; --- 55 unchanged lines hidden (view full) --- 1936 nextWalk(currState->tc); 1937 1938 currState->req = NULL; 1939 currState->tc = NULL; 1940 currState->delayed = false; 1941 delete currState; 1942 } else if (!currState->delayed) { 1943 // No additional lookups required | 1862 1863 1864 stateQueues[L2].pop_front(); 1865 pending = false; 1866 nextWalk(currState->tc); 1867 1868 currState->req = NULL; 1869 currState->tc = NULL; --- 55 unchanged lines hidden (view full) --- 1925 nextWalk(currState->tc); 1926 1927 currState->req = NULL; 1928 currState->tc = NULL; 1929 currState->delayed = false; 1930 delete currState; 1931 } else if (!currState->delayed) { 1932 // No additional lookups required |
1944 // Don't finish the translation if a stage 2 look up is underway 1945 if (!currState->doingStage2) { 1946 DPRINTF(TLBVerbose, "calling translateTiming again\n"); 1947 statWalkServiceTime.sample(curTick() - currState->startTime); 1948 tlb->translateTiming(currState->req, currState->tc, 1949 currState->transState, currState->mode); 1950 statWalksLongTerminatedAtLevel[(unsigned) curr_lookup_level]++; 1951 } | 1933 DPRINTF(TLBVerbose, "calling translateTiming again\n"); 1934 statWalkServiceTime.sample(curTick() - currState->startTime); 1935 tlb->translateTiming(currState->req, currState->tc, 1936 currState->transState, currState->mode); 1937 statWalksLongTerminatedAtLevel[(unsigned) curr_lookup_level]++; |
1952 1953 pending = false; 1954 nextWalk(currState->tc); 1955 1956 currState->req = NULL; 1957 currState->tc = NULL; 1958 currState->delayed = false; 1959 delete currState; --- 338 unchanged lines hidden --- | 1938 1939 pending = false; 1940 nextWalk(currState->tc); 1941 1942 currState->req = NULL; 1943 currState->tc = NULL; 1944 currState->delayed = false; 1945 delete currState; --- 338 unchanged lines hidden --- |