Skip to contentSkip to conversation

drm/i915/huc: Mark firmware as failed on auth failure

PATCH Superseded Michal Wajdeczko 3 participants 4 messages Feb 20, 2018 – Feb 21, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/huc: Mark firmware as failed on auth failure

If we fail to authenticate HuC firmware, we should change its load status to FAIL. While around, print HUC_STATUS on firmware verification failure.

Cc Rodrigo Vivi <[email protected]>
Cc Anusha Srivatsa <[email protected]>
---
 drivers/gpu/drm/i915/intel_huc.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_huc.c +18 -10
index ef9a05d..c7ba6e1 100644
@@ -201,6 +201,7 @@ int intel_huc_auth(struct intel_huc *huc)
 	struct intel_guc *guc = &i915->guc;
 	struct i915_vma *vma;
 	int ret;
+	u32 status;
 
 	if (huc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
 		return -ENOEXEC;
@@ -210,28 +211,35 @@ int intel_huc_auth(struct intel_huc *huc)
 	if (IS_ERR(vma)) {
 		ret = PTR_ERR(vma);
 		DRM_ERROR("HuC: Failed to pin huc fw object %d\n", ret);
-		return ret;
+		goto fail;
 	}
 
 	ret = intel_guc_auth_huc(guc,
 				 guc_ggtt_offset(vma) + huc->fw.rsa_offset);
 	if (ret) {
 		DRM_ERROR("HuC: GuC did not ack Auth request %d\n", ret);
-		goto out;
+		goto fail_unpin;
 	}
 
 	/* Check authentication status, it should be done by now */
-	ret = intel_wait_for_register(i915,
-				      HUC_STATUS2,
-				      HUC_FW_VERIFIED,
-				      HUC_FW_VERIFIED,
-				      50);
+	ret = __intel_wait_for_register(i915,
+					HUC_STATUS2,
+					HUC_FW_VERIFIED,
+					HUC_FW_VERIFIED,
+					2, 50, &status);
 	if (ret) {
-		DRM_ERROR("HuC: Authentication failed %d\n", ret);
-		goto out;
+		DRM_ERROR("HuC: Firmware not verified %#x\n", status);
+		goto fail_unpin;
 	}
 
-out:
 	i915_vma_unpin(vma);
+	return 0;
+
+fail_unpin:
+	i915_vma_unpin(vma);
+fail:
+	huc->fw.load_status = INTEL_UC_FIRMWARE_FAIL;
+
+	DRM_ERROR("HuC: Authentication failed %d\n", ret);
 	return ret;
 }
Signature · 6 lines
1.9.1

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

✓ Fi.CI.BAT: success for drm/i915/huc: Mark firmware as failed on auth failure

== Series Details ==

== Series Details ==

Series: drm/i915/huc: Mark firmware as failed on auth failure
URL : https://patchwork.freedesktop.org/series/38639/
State : success

== Summary ==

Series 38639v1 drm/i915/huc: Mark firmware as failed on auth failure
https://patchwork.freedesktop.org/api/1.0/series/38639/revisions/1/mbox/

Test debugfs_test:

        Subgroup read_all_entries:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                pass       -> FAIL       (fi-gdg-551) fdo#102575

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:417s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:421s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:369s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:477s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:285s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:475s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:479s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:466s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:452s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:563s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:413s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:283s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:505s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:385s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:406s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:450s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:411s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:449s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:487s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:450s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:492s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:586s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:426s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:500s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:522s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:482s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:483s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:404s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:425s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:391s

f727568c3b37c1349f635efcc67d64ac3cf77108 drm-tip: 2018y-02m-20d-20h-39m-03s UTC integration manifest f5ebfb2c2a5c drm/i915/huc: Mark firmware as failed on auth failure

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8090/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.IGT: failure for drm/i915/huc: Mark firmware as failed on auth failure

In reply to Michal Wajdeczko
== Series Details ==

== Series Details ==

Series: drm/i915/huc: Mark firmware as failed on auth failure
URL : https://patchwork.freedesktop.org/series/38639/
State : failure

== Summary ==

Test kms_chv_cursor_fail:

        Subgroup pipe-b-256x256-left-edge:
                pass       -> DMESG-WARN (shard-snb) fdo#105185
        Subgroup pipe-c-64x64-right-edge:
                pass       -> FAIL       (shard-apl)
Test kms_cursor_crc:
        Subgroup cursor-256x256-suspend:
                incomplete -> PASS       (shard-hsw) fdo#103375
Test kms_vblank:
        Subgroup pipe-c-wait-idle:
                dmesg-warn -> PASS       (shard-hsw) fdo#102614

fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614

shard-apl        total:3367 pass:1764 dwarn:1   dfail:0   fail:9   skip:1592 time:11991s
shard-hsw        total:3429 pass:1760 dwarn:1   dfail:0   fail:2   skip:1665 time:11671s
shard-snb        total:3429 pass:1349 dwarn:2   dfail:0   fail:2   skip:2076 time:6590s

Blacklisted hosts:
shard-kbl total:3429 pass:1920 dwarn:8 dfail:0 fail:9 skip:1492 time:9475s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8090/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#3 lore raw
In reply to Michal Wajdeczko

Quoting Michal Wajdeczko (2018-02-20 22:52:55)

Quoted 16 lines

If we fail to authenticate HuC firmware, we should change its load status to FAIL. While around, print HUC_STATUS on firmware verification failure.

Cc Rodrigo Vivi <[email protected]>
Cc Anusha Srivatsa <[email protected]>
---
 drivers/gpu/drm/i915/intel_huc.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_huc.c +0 -0
index ef9a05d..c7ba6e1 100644

drivers/gpu/drm/i915/intel_huc.c int intel_huc_auth(struct intel_huc *huc) · line 204

Quoted 4 lines
drivers/gpu/drm/i915/intel_huc.c +1 -0
@@ -201,6 +201,7 @@ int intel_huc_auth(struct intel_huc *huc)
        struct intel_guc *guc = &i915->guc;
        struct i915_vma *vma;
        int ret;
+       u32 status;

Try to keep the variables sorted by length, unless for a good reason.

Quoted 20 lines
drivers/gpu/drm/i915/intel_huc.c +2 -2
        if (huc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
                return -ENOEXEC;
@@ -210,28 +211,35 @@ int intel_huc_auth(struct intel_huc *huc)
        if (IS_ERR(vma)) {
                ret = PTR_ERR(vma);
                DRM_ERROR("HuC: Failed to pin huc fw object %d\n", ret);
-               return ret;
+               goto fail;
        }
 
        ret = intel_guc_auth_huc(guc,
                                 guc_ggtt_offset(vma) + huc->fw.rsa_offset);
        if (ret) {
                DRM_ERROR("HuC: GuC did not ack Auth request %d\n", ret);
-               goto out;
+               goto fail_unpin;
        }
 
        /* Check authentication status, it should be done by now */

drivers/gpu/drm/i915/intel_huc.c int intel_huc_auth(struct intel_huc *huc) · line 229

Quoted 10 lines
drivers/gpu/drm/i915/intel_huc.c +5 -5
-       ret = intel_wait_for_register(i915,
-                                     HUC_STATUS2,
-                                     HUC_FW_VERIFIED,
-                                     HUC_FW_VERIFIED,
-                                     50);
+       ret = __intel_wait_for_register(i915,
+                                       HUC_STATUS2,
+                                       HUC_FW_VERIFIED,
+                                       HUC_FW_VERIFIED,
+                                       2, 50, &status);

We need to wait for a backmerge before we can apply.

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