diff mbox series

[2/3] drm/i915/uc: Prepare for different firmware key sizes

Message ID 20211209005610.1499729-3-daniele.ceraolospurio@intel.com (mailing list archive)
State New, archived
Headers show
Series Support bigger GuC RSA keys | expand

Commit Message

Daniele Ceraolo Spurio Dec. 9, 2021, 12:56 a.m. UTC
From: Michal Wajdeczko <michal.wajdeczko@intel.com>

Future GuC/HuC firmwares might be signed with different key sizes.
Don't assume that it must be always 2048 bits long.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Matthew Brost Dec. 9, 2021, 6:57 p.m. UTC | #1
On Wed, Dec 08, 2021 at 04:56:09PM -0800, Daniele Ceraolo Spurio wrote:
> From: Michal Wajdeczko <michal.wajdeczko@intel.com>
> 
> Future GuC/HuC firmwares might be signed with different key sizes.
> Don't assume that it must be always 2048 bits long.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

You need SOB here since your posting this even though this is Michal's
patch.

With that fixed:
Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> ---
>  drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
> index b7fa51aefdff..01683f5f95bd 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
> @@ -322,13 +322,6 @@ int intel_uc_fw_fetch(struct intel_uc_fw *uc_fw)
>  	uc_fw->ucode_size = (css->size_dw - css->header_size_dw) * sizeof(u32);
>  
>  	/* now RSA */
> -	if (unlikely(css->key_size_dw != UOS_RSA_SCRATCH_COUNT)) {
> -		drm_warn(&i915->drm, "%s firmware %s: unexpected key size: %u != %u\n",
> -			 intel_uc_fw_type_repr(uc_fw->type), uc_fw->path,
> -			 css->key_size_dw, UOS_RSA_SCRATCH_COUNT);
> -		err = -EPROTO;
> -		goto fail;
> -	}
>  	uc_fw->rsa_size = css->key_size_dw * sizeof(u32);
>  
>  	/* At least, it should have header, uCode and RSA. Size of all three. */
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
index b7fa51aefdff..01683f5f95bd 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
@@ -322,13 +322,6 @@  int intel_uc_fw_fetch(struct intel_uc_fw *uc_fw)
 	uc_fw->ucode_size = (css->size_dw - css->header_size_dw) * sizeof(u32);
 
 	/* now RSA */
-	if (unlikely(css->key_size_dw != UOS_RSA_SCRATCH_COUNT)) {
-		drm_warn(&i915->drm, "%s firmware %s: unexpected key size: %u != %u\n",
-			 intel_uc_fw_type_repr(uc_fw->type), uc_fw->path,
-			 css->key_size_dw, UOS_RSA_SCRATCH_COUNT);
-		err = -EPROTO;
-		goto fail;
-	}
 	uc_fw->rsa_size = css->key_size_dw * sizeof(u32);
 
 	/* At least, it should have header, uCode and RSA. Size of all three. */