drm/i915/pxp: Invalidate all PXP fw sessions during teardown
authorAlan Previn <alan.previn.teres.alexis@intel.com>
Wed, 25 Jan 2023 08:26:35 +0000 (00:26 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Fri, 27 Jan 2023 20:22:24 +0000 (15:22 -0500)
commitd374c047b38e9f1130308aae207dc44045cd5cac
tree56511a2fd2f50cc5a1aca368d97c1853f251d0f2
parentf17ef47b0442c284b71178a12e2865a85b895287
drm/i915/pxp: Invalidate all PXP fw sessions during teardown

A gap was recently discovered where if an application did not
invalidate all of the stream keys (intentionally or not), and the
driver did a full PXP global teardown on the GT subsystem, we
find that future session creation would fail on the security
firmware's side of the equation. i915 is the entity that needs
ensure the sessions' state across both iGT and security firmware
are at a known clean point when performing a full global teardown.

Architecturally speaking, i915 should inspect all active sessions
and submit the invalidate-stream-key PXP command to the security
firmware for each of them. However, for the upstream i915 driver
we only support the arbitration session that can be created
so that will be the only session we will cleanup.

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: Juston Li <justonli@chromium.org>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230125082637.118970-5-alan.previn.teres.alexis@intel.com
drivers/gpu/drm/i915/pxp/intel_pxp.h
drivers/gpu/drm/i915/pxp/intel_pxp_cmd_interface_42.h
drivers/gpu/drm/i915/pxp/intel_pxp_cmd_interface_cmn.h
drivers/gpu/drm/i915/pxp/intel_pxp_session.c
drivers/gpu/drm/i915/pxp/intel_pxp_tee.c