1/* 2 * Copyright (c) 2010, 2012-2013 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 --- 146 unchanged lines hidden (view full) --- 155 156Fault 157TableWalker::walk(RequestPtr _req, ThreadContext *_tc, uint16_t _asid, 158 uint8_t _vmid, bool _isHyp, TLB::Mode _mode, 159 TLB::Translation *_trans, bool _timing, bool _functional, 160 bool secure, TLB::ArmTranslationType tranType) 161{ 162 assert(!(_functional && _timing)); |
163 WalkerState *savedCurrState = NULL; |
164 |
165 if (!currState && !_functional) { |
166 // For atomic mode, a new WalkerState instance should be only created 167 // once per TLB. For timing mode, a new instance is generated for every 168 // TLB miss. 169 DPRINTF(TLBVerbose, "creating new instance of WalkerState\n"); 170 171 currState = new WalkerState(); 172 currState->tableWalker = this; |
173 } else if (_functional) { 174 // If we are mixing functional mode with timing (or even 175 // atomic), we need to to be careful and clean up after 176 // ourselves to not risk getting into an inconsistent state. 177 DPRINTF(TLBVerbose, "creating functional instance of WalkerState\n"); 178 savedCurrState = currState; 179 currState = new WalkerState(); 180 currState->tableWalker = this; |
181 } else if (_timing) { 182 // This is a translation that was completed and then faulted again 183 // because some underlying parameters that affect the translation 184 // changed out from under us (e.g. asid). It will either be a 185 // misprediction, in which case nothing will happen or we'll use 186 // this fault to re-execute the faulting instruction which should clean 187 // up everything. 188 if (currState->vaddr_tainted == _req->getVaddr()) { --- 79 unchanged lines hidden (view full) --- 268 currState->secureLookup = currState->isSecure; 269 currState->rwTable = true; 270 currState->userTable = true; 271 currState->xnTable = false; 272 currState->pxnTable = false; 273 } 274 275 if (!currState->timing) { |
276 Fault fault = NoFault; |
277 if (currState->aarch64) |
278 fault = processWalkAArch64(); |
279 else if (long_desc_format) |
280 fault = processWalkLPAE(); |
281 else |
282 fault = processWalk(); 283 284 // If this was a functional non-timing access restore state to 285 // how we found it. 286 if (currState->functional) { 287 delete currState; 288 currState = savedCurrState; 289 } 290 return fault; |
291 } 292 293 if (pending || pendingQueue.size()) { 294 pendingQueue.push_back(currState); 295 currState = NULL; 296 } else { 297 pending = true; 298 if (currState->aarch64) --- 1665 unchanged lines hidden --- |