1/* 2 * Copyright (c) 2010-2013, 2016-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 --- 1254 unchanged lines hidden (view full) --- 1263 1264 DPRINTF(TLBVerbose, "TLB variables changed!\n"); 1265 cpsr = tc->readMiscReg(MISCREG_CPSR); 1266 1267 // Dependencies: SCR/SCR_EL3, CPSR 1268 isSecure = inSecureState(tc) && 1269 !(tranType & HypMode) && !(tranType & S1S2NsTran); 1270 |
1271 aarch64EL = tranTypeEL(cpsr, tranType); 1272 aarch64 = isStage2 ? 1273 ELIs64(tc, EL2) : 1274 ELIs64(tc, aarch64EL == EL0 ? EL1 : aarch64EL); |
1275 1276 if (aarch64) { // AArch64 1277 // determine EL we need to translate in |
1278 switch (aarch64EL) { 1279 case EL0: 1280 case EL1: 1281 { 1282 sctlr = tc->readMiscReg(MISCREG_SCTLR_EL1); 1283 ttbcr = tc->readMiscReg(MISCREG_TCR_EL1); 1284 uint64_t ttbr_asid = ttbcr.a1 ? 1285 tc->readMiscReg(MISCREG_TTBR1_EL1) : --- 83 unchanged lines hidden (view full) --- 1369 directToStage2 = false; 1370 } 1371 } 1372 miscRegValid = true; 1373 miscRegContext = tc->contextId(); 1374 curTranType = tranType; 1375} 1376 |
1377ExceptionLevel 1378TLB::tranTypeEL(CPSR cpsr, ArmTranslationType type) 1379{ 1380 switch (type) { 1381 case S1E0Tran: 1382 case S12E0Tran: 1383 return EL0; 1384 1385 case S1E1Tran: 1386 case S12E1Tran: 1387 return EL1; 1388 1389 case S1E2Tran: 1390 return EL2; 1391 1392 case S1E3Tran: 1393 return EL3; 1394 1395 case NormalTran: 1396 case S1CTran: 1397 case S1S2NsTran: 1398 case HypMode: 1399 return opModeToEL((OperatingMode)(uint8_t)cpsr.mode); 1400 1401 default: 1402 panic("Unknown translation mode!\n"); 1403 } 1404} 1405 |
1406Fault 1407TLB::getTE(TlbEntry **te, RequestPtr req, ThreadContext *tc, Mode mode, 1408 Translation *translation, bool timing, bool functional, 1409 bool is_secure, TLB::ArmTranslationType tranType) 1410{ 1411 bool is_fetch = (mode == Execute); 1412 bool is_write = (mode == Write); 1413 --- 166 unchanged lines hidden --- |