From patchwork Fri Feb 10 01:28:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniele Ceraolo Spurio X-Patchwork-Id: 13135335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5234AC61DA4 for ; Fri, 10 Feb 2023 01:21:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1363A10EC21; Fri, 10 Feb 2023 01:21:32 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 590AD10EC17; Fri, 10 Feb 2023 01:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675992089; x=1707528089; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ciSXvpWlgnOs/L5NpH9BRu5QQR07nXf7EQ6ovOWBZvo=; b=PLeKFZXuZansVpS9mGgEPD4jkVrjAcpMYEgvA8yqhuOeNQ7F8LoKPwsM Nx+GeS3f/w0B/P8gLMLZIax+LjlGcmPffwg5gDjt+CRSZoyyM+T8mz6b5 q8m2ny6jc0odAgq7B0DNgzrWa8dV26iONMHV7s19lZdK0YfmHZNFXRDa+ +VbHflacNZHx8a338lrQ8QiMj6YEcyZM9/88iwi5fTy/3cB4tws0bnl2e JNPGr8krJ8EeaI4psKeX1/73oQpw2EO2n6GZgkDlpRe7qGVB8QES+BpnT 1siM8/t4YgNSQLNxKvCJCTvkZMVLKWdsn/Vna5a8z0LK2mExtG6un5g9g A==; X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="327997493" X-IronPort-AV: E=Sophos;i="5.97,285,1669104000"; d="scan'208";a="327997493" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2023 17:21:28 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="810615756" X-IronPort-AV: E=Sophos;i="5.97,285,1669104000"; d="scan'208";a="810615756" Received: from valcore-skull-1.fm.intel.com ([10.1.27.19]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2023 17:21:28 -0800 From: Daniele Ceraolo Spurio To: intel-gfx@lists.freedesktop.org Date: Thu, 9 Feb 2023 17:28:04 -0800 Message-Id: <20230210012804.2223978-1-daniele.ceraolospurio@intel.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Subject: [Intel-gfx] [RFC] drm/i915/uapi/huc: two levels of HuC authentication X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alan Previn , Ankit Jain , dri-devel@lists.freedesktop.org, Carl Zhang Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Starting on DG2, the owner of HuC authentication is the GSC FW. On MTL, with the GSC moving into the media GT and being loaded by i915, this can result in a significant delay in HuC readiness on init/resume. To reduce the impact, the HuC load & authentication has been split in 2 parts: 1) The HuC is loaded via DMA and authenticated by the GuC, like on older platforms. However, this is now considered a partial authentication and only allows clear-media workloads. 2) After the GSC FW is loaded, the HuC is re-authenticated with a PXP command. This is a full authentication and allows all workloads. This way, only the protected content operations are impacted by the GSC-introduced delay, which is not an issue because GSC is required for those anyway. To report the different steps to userspace, a new value is introduced for the HuC status ioctl. RFC: I'm asking for comments ahead of the implementation to make sure there are no concerns with the proposed interface change. I've kept value '1' as the "full authentication" mode because that is what it represents on older platforms. The media driver currently checks for value != 0, which will keep working for clear-media and allow it to start submitting without waiting for the GSC auth, while the protected content side of things will have to adapt to explicitly check for value == 1 (which will work on existing platforms as well). Signed-off-by: Daniele Ceraolo Spurio Cc: John Harrison Cc: Alan Previn Cc: Ankit Jain Cc: Tony Ye Cc: Carl Zhang --- include/uapi/drm/i915_drm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 8df261c5ab9b..8a69014f3fd9 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -659,7 +659,8 @@ typedef struct drm_i915_irq_wait { * If the IOCTL is successful, the returned parameter will be set to one of the * following values: * * 0 if HuC firmware load is not complete, - * * 1 if HuC firmware is authenticated and running. + * * 1 if HuC firmware is loaded and fully authenticated, + * * 2 if HuC firmware is loaded and authenticated for clear media only */ #define I915_PARAM_HUC_STATUS 42