Skip to contentSkip to conversation

drm/amdgpu: Fine-grained TMZ support

PATCH In review Luben Tuikov 2 participants 2 messages Mar 4, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Fine-grained TMZ support

Add fine-grained per-ASIC TMZ support.

At the moment TMZ support is experimental for all
ASICs which support it.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 30 ++++++++++++++++---------
 1 file changed, 20 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +20 -10
index 61a743368302..4f8fd067d150 100644
@@ -383,18 +383,28 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev)
  */
 void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
 {
-	if (!amdgpu_tmz)
-		return;
-
-	if (adev->asic_type < CHIP_RAVEN ||
-	    adev->asic_type == CHIP_ARCTURUS) {
+	switch (adev->asic_type) {
+	case CHIP_RAVEN:
+	case CHIP_RENOIR:
+	case CHIP_NAVI10:
+	case CHIP_NAVI14:
+	case CHIP_NAVI12:
+		/* Don't enable it by default yet.
+		 */
+		if (amdgpu_tmz < 1) {
+			adev->gmc.tmz_enabled = false;
+			dev_info(adev->dev,
+				 "Trusted Memory Zone (TMZ) feature disabled as experimental (default)\n");
+		} else {
+			adev->gmc.tmz_enabled = true;
+			dev_info(adev->dev,
+				 "Trusted Memory Zone (TMZ) feature enabled as experimental (cmd line)\n");
+		}
+		break;
+	default:
 		adev->gmc.tmz_enabled = false;
 		dev_warn(adev->dev,
 			 "Trusted Memory Zone (TMZ) feature not supported\n");
-	} else {
-
-		adev->gmc.tmz_enabled = true;
-		dev_info(adev->dev,
-			 "Trusted Memory Zone (TMZ) feature supported and enabled\n");
+		break;
 	}
 }
Signature · 6 lines
2.25.1.362.g51ebf55b93

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

Am 04.03.20 um 16:17 schrieb Luben Tuikov:

Quoted 7 lines

Add fine-grained per-ASIC TMZ support.

At the moment TMZ support is experimental for all
ASICs which support it.

I've pushed the fixes for TMZ buffer moves this morning, so I think we should be clear to even enable it by default for at least Raven.

But either way this patch is: Reviewed-by: Christian König <[email protected]>

Quoted 37 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 30 ++++++++++++++++---------
  1 file changed, 20 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +19 -5
index 61a743368302..4f8fd067d150 100644
@@ -383,18 +383,28 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev)
   */
  void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
  {
-	if (!amdgpu_tmz)
-		return;
-
-	if (adev->asic_type < CHIP_RAVEN ||
-	    adev->asic_type == CHIP_ARCTURUS) {
+	switch (adev->asic_type) {
+	case CHIP_RAVEN:
+	case CHIP_RENOIR:
+	case CHIP_NAVI10:
+	case CHIP_NAVI14:
+	case CHIP_NAVI12:
+		/* Don't enable it by default yet.
+		 */
+		if (amdgpu_tmz < 1) {
+			adev->gmc.tmz_enabled = false;
+			dev_info(adev->dev,
+				 "Trusted Memory Zone (TMZ) feature disabled as experimental (default)\n");
+		} else {
+			adev->gmc.tmz_enabled = true;
+			dev_info(adev->dev,
+				 "Trusted Memory Zone (TMZ) feature enabled as experimental (cmd line)\n");
+		}
+		break;
+	default:
  		adev->gmc.tmz_enabled = false;

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev) · line 410

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -5
  		dev_warn(adev->dev,
  			 "Trusted Memory Zone (TMZ) feature not supported\n");
-	} else {
-
-		adev->gmc.tmz_enabled = true;
-		dev_info(adev->dev,
-			 "Trusted Memory Zone (TMZ) feature supported and enabled\n");
+		break;
  	}
  }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx