All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Anusha Srivatsa <anusha.srivatsa@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Alex Dai <yu.dai@intel.com>,
	Peter Antoine <peter.antoine@intel.com>
Subject: Re: [PATCH 7/8] drm/i915/huc: Support HuC authentication
Date: Thu, 22 Dec 2016 23:30:14 +0000	[thread overview]
Message-ID: <20161222233014.GG11865@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <1482448344-6505-8-git-send-email-anusha.srivatsa@intel.com>

On Thu, Dec 22, 2016 at 03:12:23PM -0800, Anusha Srivatsa wrote:
> +void intel_guc_auth_huc(struct drm_i915_private *dev_priv)
> +{
> +	struct intel_guc *guc = &dev_priv->guc;
> +	struct intel_huc *huc = &dev_priv->huc;
> +	struct i915_vma *vma;
> +	int ret;
> +	u32 data[2];
> +
> +	/* Bypass the case where there is no HuC firmware */
> +	if (huc->fw.fetch_status == INTEL_UC_FIRMWARE_NONE ||
> +		huc->fw.load_status == INTEL_UC_FIRMWARE_NONE)
> +		return;
> +
> +	if (guc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS) {
> +		DRM_ERROR("HuC: GuC fw wasn't loaded. Can't authenticate\n");
> +		return;
> +	}
> +
> +	if (huc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS) {
> +		DRM_ERROR("HuC: fw wasn't loaded. Nothing to authenticate\n");
> +		return;
> +	}
> +
> +	vma = i915_gem_object_ggtt_pin(huc->fw.uc_fw_obj, NULL, 0, 0, 0);
> +	if (IS_ERR(vma)) {
> +		DRM_DEBUG_DRIVER("pin failed %d\n", (int)PTR_ERR(vma));
> +		return;
> +	}
> +
> +
> +	/* Invalidate GuC TLB to let GuC take the latest updates to GTT. */
> +	I915_WRITE(GEN8_GTCR, GEN8_GTCR_INVALIDATE);

Still working on stopping this from frequently popping up in code
outside of the GTT routines.

> +	/* Specify auth action and where public signature is. */
> +	data[0] = INTEL_GUC_ACTION_AUTHENTICATE_HUC;
> +	data[1] = i915_ggtt_offset(vma) + huc->fw.rsa_offset;
> +
> +	ret = intel_guc_send(guc, data, ARRAY_SIZE(data));
> +	if (ret) {
> +		DRM_ERROR("HuC: GuC did not ack Auth request\n");
> +		goto out;
> +	}
> +
> +	/* Check authentication status, it should be done by now */
> +	ret = wait_for((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) > 0, 50);

ret = intel_wait_for_register(dev_priv,
			      HUC_STATUS2,
			      HUC_FW_VERIFIED,
			      HUC_FW_VERIFIED,
			      50);

wait_for() is a rather large macro, and intel_wait_for_register()
employs the spin then sleep optimisation for quick responses.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-12-22 23:30 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22 23:12 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2016-12-22 23:12 ` [PATCH 1/8] drm/i915/guc: Make the GuC fw loading helper functions general Anusha Srivatsa
2016-12-23 14:15   ` Arkadiusz Hiler
2016-12-27 17:28   ` Michal Wajdeczko
2017-01-03  0:07     ` Srivatsa, Anusha
2017-01-03 14:15       ` Michal Wajdeczko
2017-01-03 17:43         ` Srivatsa, Anusha
2016-12-22 23:12 ` [PATCH 2/8] drm/i915/huc: Unified css_header struct for GuC and HuC Anusha Srivatsa
2016-12-23 14:21   ` Arkadiusz Hiler
2016-12-23 17:32     ` Srivatsa, Anusha
2016-12-22 23:12 ` [PATCH 3/8] drm/i915/huc: Add HuC fw loading support Anusha Srivatsa
2016-12-27 12:37   ` Arkadiusz Hiler
2016-12-27 17:50   ` Michal Wajdeczko
2017-01-03  0:08     ` Srivatsa, Anusha
2017-01-03 18:59       ` Srivatsa, Anusha
2017-01-04 15:15         ` Arkadiusz Hiler
2016-12-22 23:12 ` [PATCH 4/8] drm/i915/huc: Add BXT HuC Loading Support Anusha Srivatsa
2016-12-23 14:43   ` Arkadiusz Hiler
2016-12-22 23:12 ` [PATCH 5/8] drm/i915/HuC: Add KBL huC loading Support Anusha Srivatsa
2016-12-23 14:43   ` Arkadiusz Hiler
2016-12-22 23:12 ` [PATCH 6/8] drm/i915/huc: Add debugfs for HuC loading status check Anusha Srivatsa
2016-12-22 23:12 ` [PATCH 7/8] drm/i915/huc: Support HuC authentication Anusha Srivatsa
2016-12-22 23:30   ` Chris Wilson [this message]
2017-01-03 19:55     ` Srivatsa, Anusha
2016-12-22 23:12 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2016-12-23 14:33   ` Arkadiusz Hiler
2016-12-22 23:53 ` ✓ Fi.CI.BAT: success for HuC Loading Patches Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2017-01-14  1:17 [PATCH 0/8] " Anusha Srivatsa
2017-01-14  1:17 ` [PATCH 7/8] drm/i915/huc: Support HuC authentication Anusha Srivatsa
2017-01-13 18:08 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2017-01-13 18:08 ` [PATCH 7/8] drm/i915/huc: Support HuC authentication Anusha Srivatsa
2017-01-13 18:18   ` Michal Wajdeczko
2017-01-13 18:19     ` Srivatsa, Anusha
2017-01-13 18:47       ` Chris Wilson
2017-01-13 17:07 Anusha Srivatsa
2017-01-13 17:24 ` Chris Wilson
2017-01-13 17:36   ` Srivatsa, Anusha
2017-01-04 14:55 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2017-01-04 14:55 ` [PATCH 7/8] drm/i915/huc: Support HuC authentication Anusha Srivatsa
2017-01-05 12:14   ` Arkadiusz Hiler
2017-01-05 12:18   ` Arkadiusz Hiler
2017-01-05 13:52   ` Michal Wajdeczko
2017-01-04 13:27 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2017-01-04 13:27 ` [PATCH 7/8] drm/i915/huc: Support HuC authentication Anusha Srivatsa
2016-12-15 22:29 [PATCH 0/8] HuC Loading Patches anushasr
2016-12-15 22:29 ` [PATCH 7/8] drm/i915/huc: Support HuC authentication anushasr
2016-12-16 16:17   ` Arkadiusz Hiler
2016-12-08 23:02 [PATCH 0/8]HuC Loading Patches anushasr
2016-12-08 23:02 ` [PATCH 7/8] drm/i915/huc: Support HuC authentication anushasr
2016-12-09 10:22   ` Arkadiusz Hiler
2016-12-09 12:36   ` Michal Wajdeczko
2016-12-11  0:03     ` Srivatsa, Anusha
2016-11-30 23:31 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2016-11-30 23:31 ` [PATCH 7/8] drm/i915/huc: Support HuC authentication Anusha Srivatsa
2016-12-01 13:05   ` Arkadiusz Hiler
2016-11-23 22:27 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2016-11-23 22:27 ` [PATCH 7/8] drm/i915/huc: Support HuC authentication Anusha Srivatsa
2016-11-11  0:15 [PATCH v4 0/8] HuC Loading Patches Anusha Srivatsa
2016-11-11  0:15 ` [PATCH 7/8] drm/i915/huc: Support HuC authentication Anusha Srivatsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161222233014.GG11865@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=anusha.srivatsa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=peter.antoine@intel.com \
    --cc=yu.dai@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.