All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Srivatsa, Anusha" <anusha.srivatsa@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: "intel-gfx@lists.freedesktop.org"
	<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: Tue, 3 Jan 2017 19:55:34 +0000	[thread overview]
Message-ID: <83F5C7385F545743AD4FB2A62F75B07301960255@ORSMSX108.amr.corp.intel.com> (raw)
In-Reply-To: <20161222233014.GG11865@nuc-i3427.alporthouse.com>



>-----Original Message-----
>From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
>Sent: Thursday, December 22, 2016 3:30 PM
>To: Srivatsa, Anusha <anusha.srivatsa@intel.com>
>Cc: intel-gfx@lists.freedesktop.org; Alex Dai <yu.dai@intel.com>; Peter Antoine
><peter.antoine@intel.com>
>Subject: Re: [Intel-gfx] [PATCH 7/8] drm/i915/huc: Support HuC authentication
>
>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.
So, basically beautify the code such that the GTT routines do not pop out in non GTT parts of code. Correct? 
>
>> +	/* 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.

Thankyou for bringing this to my notice. 

Anusha

>-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:[~2017-01-03 19:55 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
2017-01-03 19:55     ` Srivatsa, Anusha [this message]
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=83F5C7385F545743AD4FB2A62F75B07301960255@ORSMSX108.amr.corp.intel.com \
    --to=anusha.srivatsa@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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.