smmu_v3.cc (14116:3868b8bdb52b) smmu_v3.cc (14132:d6093eeca3af)
1/*
2 * Copyright (c) 2013, 2018-2019 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

--- 381 unchanged lines hidden (view full) ---

390
391 case CMD_PRF_ADDR:
392 DPRINTF(SMMUv3, "CMD_PREFETCH_ADDR - ignored\n");
393 break;
394
395 case CMD_CFGI_STE: {
396 DPRINTF(SMMUv3, "CMD_CFGI_STE sid=%#x\n", cmd.dw0.sid);
397 configCache.invalidateSID(cmd.dw0.sid);
1/*
2 * Copyright (c) 2013, 2018-2019 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

--- 381 unchanged lines hidden (view full) ---

390
391 case CMD_PRF_ADDR:
392 DPRINTF(SMMUv3, "CMD_PREFETCH_ADDR - ignored\n");
393 break;
394
395 case CMD_CFGI_STE: {
396 DPRINTF(SMMUv3, "CMD_CFGI_STE sid=%#x\n", cmd.dw0.sid);
397 configCache.invalidateSID(cmd.dw0.sid);
398
399 for (auto slave_interface : slaveInterfaces) {
400 slave_interface->microTLB->invalidateSID(cmd.dw0.sid);
401 slave_interface->mainTLB->invalidateSID(cmd.dw0.sid);
402 }
398 break;
399 }
400
401 case CMD_CFGI_STE_RANGE: {
402 const auto range = cmd.dw1.range;
403 if (range == 31) {
404 // CMD_CFGI_ALL is an alias of CMD_CFGI_STE_RANGE with
405 // range = 31
406 DPRINTF(SMMUv3, "CMD_CFGI_ALL\n");
407 configCache.invalidateAll();
403 break;
404 }
405
406 case CMD_CFGI_STE_RANGE: {
407 const auto range = cmd.dw1.range;
408 if (range == 31) {
409 // CMD_CFGI_ALL is an alias of CMD_CFGI_STE_RANGE with
410 // range = 31
411 DPRINTF(SMMUv3, "CMD_CFGI_ALL\n");
412 configCache.invalidateAll();
413
414 for (auto slave_interface : slaveInterfaces) {
415 slave_interface->microTLB->invalidateAll();
416 slave_interface->mainTLB->invalidateAll();
417 }
408 } else {
409 DPRINTF(SMMUv3, "CMD_CFGI_STE_RANGE\n");
410 const auto start_sid = cmd.dw0.sid & ~((1 << (range + 1)) - 1);
411 const auto end_sid = start_sid + (1 << (range + 1)) - 1;
418 } else {
419 DPRINTF(SMMUv3, "CMD_CFGI_STE_RANGE\n");
420 const auto start_sid = cmd.dw0.sid & ~((1 << (range + 1)) - 1);
421 const auto end_sid = start_sid + (1 << (range + 1)) - 1;
412 for (auto sid = start_sid; sid <= end_sid; sid++)
422 for (auto sid = start_sid; sid <= end_sid; sid++) {
413 configCache.invalidateSID(sid);
423 configCache.invalidateSID(sid);
424
425 for (auto slave_interface : slaveInterfaces) {
426 slave_interface->microTLB->invalidateSID(sid);
427 slave_interface->mainTLB->invalidateSID(sid);
428 }
429 }
414 }
415 break;
416 }
417
418 case CMD_CFGI_CD: {
419 DPRINTF(SMMUv3, "CMD_CFGI_CD sid=%#x ssid=%#x\n",
420 cmd.dw0.sid, cmd.dw0.ssid);
421 configCache.invalidateSSID(cmd.dw0.sid, cmd.dw0.ssid);
430 }
431 break;
432 }
433
434 case CMD_CFGI_CD: {
435 DPRINTF(SMMUv3, "CMD_CFGI_CD sid=%#x ssid=%#x\n",
436 cmd.dw0.sid, cmd.dw0.ssid);
437 configCache.invalidateSSID(cmd.dw0.sid, cmd.dw0.ssid);
438
439 for (auto slave_interface : slaveInterfaces) {
440 slave_interface->microTLB->invalidateSSID(
441 cmd.dw0.sid, cmd.dw0.ssid);
442 slave_interface->mainTLB->invalidateSSID(
443 cmd.dw0.sid, cmd.dw0.ssid);
444 }
422 break;
423 }
424
425 case CMD_CFGI_CD_ALL: {
426 DPRINTF(SMMUv3, "CMD_CFGI_CD_ALL sid=%#x\n", cmd.dw0.sid);
427 configCache.invalidateSID(cmd.dw0.sid);
445 break;
446 }
447
448 case CMD_CFGI_CD_ALL: {
449 DPRINTF(SMMUv3, "CMD_CFGI_CD_ALL sid=%#x\n", cmd.dw0.sid);
450 configCache.invalidateSID(cmd.dw0.sid);
451
452 for (auto slave_interface : slaveInterfaces) {
453 slave_interface->microTLB->invalidateSID(cmd.dw0.sid);
454 slave_interface->mainTLB->invalidateSID(cmd.dw0.sid);
455 }
428 break;
429 }
430
431 case CMD_TLBI_NH_ALL: {
432 DPRINTF(SMMUv3, "CMD_TLBI_NH_ALL vmid=%#x\n", cmd.dw0.vmid);
433 for (auto slave_interface : slaveInterfaces) {
434 slave_interface->microTLB->invalidateVMID(cmd.dw0.vmid);
435 slave_interface->mainTLB->invalidateVMID(cmd.dw0.vmid);

--- 373 unchanged lines hidden ---
456 break;
457 }
458
459 case CMD_TLBI_NH_ALL: {
460 DPRINTF(SMMUv3, "CMD_TLBI_NH_ALL vmid=%#x\n", cmd.dw0.vmid);
461 for (auto slave_interface : slaveInterfaces) {
462 slave_interface->microTLB->invalidateVMID(cmd.dw0.vmid);
463 slave_interface->mainTLB->invalidateVMID(cmd.dw0.vmid);

--- 373 unchanged lines hidden ---