All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/huc: Mark firmware as failed on auth failure
@ 2018-02-20 22:52 Michal Wajdeczko
  2018-02-20 23:16 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michal Wajdeczko @ 2018-02-20 22:52 UTC (permalink / raw)
  To: intel-gfx; +Cc: Rodrigo Vivi

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

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
---
 drivers/gpu/drm/i915/intel_huc.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_huc.c b/drivers/gpu/drm/i915/intel_huc.c
index ef9a05d..c7ba6e1 100644
--- a/drivers/gpu/drm/i915/intel_huc.c
+++ b/drivers/gpu/drm/i915/intel_huc.c
@@ -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;
 }
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/huc: Mark firmware as failed on auth failure
  2018-02-20 22:52 [PATCH] drm/i915/huc: Mark firmware as failed on auth failure Michal Wajdeczko
@ 2018-02-20 23:16 ` Patchwork
  2018-02-21  7:15 ` ✗ Fi.CI.IGT: failure " Patchwork
  2018-02-21  8:30 ` [PATCH] " Chris Wilson
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-02-20 23:16 UTC (permalink / raw)
  To: Michal Wajdeczko; +Cc: intel-gfx

== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* ✗ Fi.CI.IGT: failure for drm/i915/huc: Mark firmware as failed on auth failure
  2018-02-20 22:52 [PATCH] drm/i915/huc: Mark firmware as failed on auth failure Michal Wajdeczko
  2018-02-20 23:16 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-02-21  7:15 ` Patchwork
  2018-02-21  8:30 ` [PATCH] " Chris Wilson
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-02-21  7:15 UTC (permalink / raw)
  To: Michal Wajdeczko; +Cc: intel-gfx

== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915/huc: Mark firmware as failed on auth failure
  2018-02-20 22:52 [PATCH] drm/i915/huc: Mark firmware as failed on auth failure Michal Wajdeczko
  2018-02-20 23:16 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-02-21  7:15 ` ✗ Fi.CI.IGT: failure " Patchwork
@ 2018-02-21  8:30 ` Chris Wilson
  2 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2018-02-21  8:30 UTC (permalink / raw)
  To: Michal Wajdeczko, intel-gfx; +Cc: Rodrigo Vivi

Quoting Michal Wajdeczko (2018-02-20 22:52:55)
> If we fail to authenticate HuC firmware, we should change
> its load status to FAIL. While around, print HUC_STATUS
> on firmware verification failure.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_huc.c | 28 ++++++++++++++++++----------
>  1 file changed, 18 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_huc.c b/drivers/gpu/drm/i915/intel_huc.c
> index ef9a05d..c7ba6e1 100644
> --- a/drivers/gpu/drm/i915/intel_huc.c
> +++ b/drivers/gpu/drm/i915/intel_huc.c
> @@ -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.

>  
>         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);

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

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-21  8:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-20 22:52 [PATCH] drm/i915/huc: Mark firmware as failed on auth failure Michal Wajdeczko
2018-02-20 23:16 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-02-21  7:15 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-02-21  8:30 ` [PATCH] " Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.