[Intel-gfx] [PATCH 7/8] drm/i915/huc: Support HuC authentication

Srivatsa, Anusha anusha.srivatsa at intel.com
Fri Jan 13 17:36:06 UTC 2017



>-----Original Message-----
>From: Chris Wilson [mailto:chris at chris-wilson.co.uk]
>Sent: Friday, January 13, 2017 9:25 AM
>To: Srivatsa, Anusha <anusha.srivatsa at intel.com>
>Cc: intel-gfx at lists.freedesktop.org; Hiler, Arkadiusz <arkadiusz.hiler at intel.com>;
>Wajdeczko, Michal <Michal.Wajdeczko at intel.com>; Alex Dai
><yu.dai at intel.com>; Peter Antoine <peter.antoine at intel.com>
>Subject: Re: [PATCH 7/8] drm/i915/huc: Support HuC authentication
>
>On Fri, Jan 13, 2017 at 09:07:08AM -0800, Anusha Srivatsa wrote:
>> +/**
>> + * intel_guc_auth_huc() - authenticate ucode
>> + * @dev_priv: the drm_i915_device
>> + *
>> + * Triggers a HuC fw authentication request to the GuC via
>> +intel_guc_action_
>> + * authenticate_huc interface.
>> + */
>> +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];
>> +
>> +	vma = i915_gem_object_ggtt_pin(huc->fw.obj, NULL, 0, 0,
>> +				PIN_OFFSET_BIAS | GUC_WOPCM_TOP);
>> +	if (IS_ERR(vma)) {
>> +		DRM_ERROR("failed to pin huc fw object %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);
>> +
>> +	/* 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 %d\n", ret);
>> +		goto out;
>> +	}
>> +
>> +	/* Check authentication status, it should be done by now */
>> +	ret = intel_wait_for_register(dev_priv,
>> +				HUC_STATUS2,
>> +				HUC_FW_VERIFIED,
>> +				HUC_FW_VERIFIED,
>> +				50);
>> +
>> +	if (ret) {
>> +		DRM_ERROR("HuC: Authentication failed %d\n", ret);
>> +		goto out;
>> +	}
>> +
>> +	DRM_ERROR("HuC Authentication Successful!\n");
>
>Probably don't want to proclaim using the HuC as an error ;-) -Chris

Oh... I was actually thinking it is good if it proclaimed....
Wont it be useful message to know?

Anusha 
>--
>Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list