table_walker.cc (9524:d6ffa982a68b) | table_walker.cc (9535:508aebb47ca6) |
---|---|
1/* 2 * Copyright (c) 2010 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 --- 172 unchanged lines hidden (view full) --- 181 182void 183TableWalker::processWalkWrapper() 184{ 185 assert(!currState); 186 assert(pendingQueue.size()); 187 currState = pendingQueue.front(); 188 | 1/* 2 * Copyright (c) 2010 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 --- 172 unchanged lines hidden (view full) --- 181 182void 183TableWalker::processWalkWrapper() 184{ 185 assert(!currState); 186 assert(pendingQueue.size()); 187 currState = pendingQueue.front(); 188 |
189 // Check if a previous walk filled this request already 190 TlbEntry* te = tlb->lookup(currState->vaddr, currState->contextId, true); |
|
189 | 191 |
190 if (!currState->transState->squashed()) { | 192 // Check if we still need to have a walk for this request. If the requesting 193 // instruction has been squashed, or a previous walk has filled the TLB with 194 // a match, we just want to get rid of the walk. The latter could happen 195 // when there are multiple outstanding misses to a single page and a 196 // previous request has been successfully translated. 197 if (!currState->transState->squashed() && !te) { |
191 // We've got a valid request, lets process it 192 pending = true; 193 pendingQueue.pop_front(); 194 processWalk(); 195 return; 196 } 197 198 199 // If the instruction that we were translating for has been 200 // squashed we shouldn't bother. 201 unsigned num_squashed = 0; 202 ThreadContext *tc = currState->tc; | 198 // We've got a valid request, lets process it 199 pending = true; 200 pendingQueue.pop_front(); 201 processWalk(); 202 return; 203 } 204 205 206 // If the instruction that we were translating for has been 207 // squashed we shouldn't bother. 208 unsigned num_squashed = 0; 209 ThreadContext *tc = currState->tc; |
203 assert(currState->transState->squashed()); | |
204 while ((num_squashed < numSquashable) && currState && | 210 while ((num_squashed < numSquashable) && currState && |
205 currState->transState->squashed()) { | 211 (currState->transState->squashed() || te)) { |
206 pendingQueue.pop_front(); 207 num_squashed++; 208 209 DPRINTF(TLB, "Squashing table walk for address %#x\n", currState->vaddr); 210 | 212 pendingQueue.pop_front(); 213 num_squashed++; 214 215 DPRINTF(TLB, "Squashing table walk for address %#x\n", currState->vaddr); 216 |
211 // finish the translation which will delete the translation object 212 currState->transState->finish(new UnimpFault("Squashed Inst"), 213 currState->req, currState->tc, currState->mode); | 217 if (currState->transState->squashed()) { 218 // finish the translation which will delete the translation object 219 currState->transState->finish(new UnimpFault("Squashed Inst"), 220 currState->req, currState->tc, currState->mode); 221 } else { 222 // translate the request now that we know it will work 223 currState->fault = tlb->translateTiming(currState->req, currState->tc, 224 currState->transState, currState->mode); 225 } |
214 215 // delete the current request 216 delete currState; 217 218 // peak at the next one | 226 227 // delete the current request 228 delete currState; 229 230 // peak at the next one |
219 if (pendingQueue.size()) | 231 if (pendingQueue.size()) { |
220 currState = pendingQueue.front(); | 232 currState = pendingQueue.front(); |
221 else | 233 te = tlb->lookup(currState->vaddr, currState->contextId, true); 234 } else { 235 // Terminate the loop, nothing more to do |
222 currState = NULL; | 236 currState = NULL; |
237 } |
|
223 } 224 225 // if we've still got pending translations schedule more work 226 nextWalk(tc); 227 currState = NULL; 228 completeDrain(); 229} 230 --- 581 unchanged lines hidden --- | 238 } 239 240 // if we've still got pending translations schedule more work 241 nextWalk(tc); 242 currState = NULL; 243 completeDrain(); 244} 245 --- 581 unchanged lines hidden --- |