[Intel-gfx] [PATCH 10/27] drm/i915/pxp: Enable ioctl action to reserve session slot

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" With this ioctl action, ring3 driver can reserve a specific session slot/id assigned by ring0 PXP, as the first step of PXP session establishment flow. Ring3 PXP stores the session info in the session list structure. Signed-off-by: Huang, Sean Z ---

[Intel-gfx] [PATCH 27/27] drm/i915/pxp: Add plane decryption support

2020-11-13 Thread Sean Z Huang
From: Anshuman Gupta Add support to enable/disable PLANE_SURF Decryption Request bit. It requires only to enable plane decryption support when following condition met. 1. PAVP session is enabled. 2. Buffer object is protected. v2: - Rebased to libva_cp-drm-tip_tgl_cp tree. - Used gen fb obj

[Intel-gfx] [PATCH 01/27] drm/i915/pxp: Introduce Intel PXP component

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" PXP (Protected Xe Path) is an i915 componment, that helps ring3 to establish the hardware protected session and manage the status of each alive software session, as well as the life cycle of each session. By design PXP will expose ioctl so allow ring3 to create, set, and

[Intel-gfx] [PATCH 08/27] drm/i915/pxp: Read register to check hardware session state

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Implement the functions to check the hardware protected session state via reading the hardware register session in play. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.h| 3 + drivers/gpu/drm/i915/pxp/intel_pxp_sm.c | 189

[Intel-gfx] [PATCH 14/27] drm/i915/pxp: Enable ioctl action to query PXP tag

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Enable the PXP ioctl action to allow ring3 PXP to query the PXP tag, which is a 32-bit bitwise value indicating the current session info, including protection type, session id, and whether the session is enabled. Signed-off-by: Huang, Sean Z ---

[Intel-gfx] [PATCH 18/27] drm/i915/pxp: Implement funcs to create the TEE channel

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Currently ring3 driver sends the TEE commands directly to TEE, but later, as our design, we would like to make ring3 sending the TEE commands via the ring0 PXP ioctl action instead of TEE ioctl, so we can centralize those protection operations at ring0 PXP.

[Intel-gfx] [PATCH 03/27] drm/i915/pxp: Add PXP context for logical hardware states.

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Add PXP context which represents combined view of driver and logical HW states. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 3 +- drivers/gpu/drm/i915/pxp/intel_pxp.c | 32 ++-- drivers/gpu/drm/i915/pxp/intel_pxp.h

[Intel-gfx] [PATCH 26/27] drm/i915/pavp: User interface for Protected buffer

2020-11-13 Thread Sean Z Huang
From: Bommu Krishnaiah This api allow user mode to create Protected buffer and context creation. Signed-off-by: Bommu Krishnaiah Cc: Telukuntla Sreedhar Cc: Kondapally Kalyan Cc: Gupta Anshuman Cc: Huang Sean Z --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 15 ++--

[Intel-gfx] [PATCH 09/27] drm/i915/pxp: Implement funcs to get/set PXP tag

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Implement the functions to get/set the PXP tag, which is 32-bit bitwise value containing the hardware session info, such as its session id, protection mode or whether it's enabled. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp_sm.c | 105

[Intel-gfx] [PATCH 13/27] drm/i915/pxp: Enable ioctl action to terminate the session

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Enable the PXP ioctl action to allow ring3 PXP to terminate the hardware session and cleanup its software session state. Ring0 PXP sends the session termination command to GPU once receves this ioctl action. Signed-off-by: Huang, Sean Z ---

[Intel-gfx] [PATCH 06/27] drm/i915: Rename the whitelist to allowlist

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Rename the whitelist to allowlist as suggested Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/intel_uncore.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c

[Intel-gfx] [PATCH 15/27] drm/i915/pxp: Destroy all type0 sessions upon teardown

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Teardown is triggered when the display topology changes and no long meets the secure playback requirement, and hardware trashes all the encryption keys for display. So as a result, ring0 PXP should handle such case and terminate all the type0 sessions. Signed-off-by:

[Intel-gfx] [PATCH 12/27] drm/i915/pxp: Func to send hardware session termination

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Implement the functions to allow ring0 PXP to send a GPU command in order to terminate the hardware session, so hardware can recycle this session slot for the next usage. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp_sm.c | 309

[Intel-gfx] [PATCH 16/27] drm/i915/pxp: Termiante the session upon app crash

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Ring0 PXP should terminate the hardware session and cleanup the software state gracefully when the application has established the protection session, but doesn't close the session correctly due to some cases like application crash. Signed-off-by: Huang, Sean Z ---

[Intel-gfx] [PATCH 25/27] drm/i915/uapi: introduce drm_i915_gem_create_ext for TGL

2020-11-13 Thread Sean Z Huang
From: Bommu Krishnaiah Same old gem_create but with now with extensions support. This is needed to support various upcoming usecases. For now we use the extensions mechanism to support PAVP. Signed-off-by: Bommu Krishnaiah Cc: Joonas Lahtinen joonas.lahti...@linux.intel.com Cc: Matthew Auld

[Intel-gfx] [PATCH 05/27] drm/i915/pxp: Enable ioctl action to set the ring3 context

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Enable one ioctl action to allow ring3 driver to set its ring3 context, so ring0 PXP can track the context id through this ring3 context list. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_drv.c | 1 + drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [PATCH 17/27] drm/i915/pxp: Enable PXP power management

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" During the power event S3+ sleep/resume, hardware will lose all the encryption keys for every hardware session, even though the software session state was marked as alive after resume. So to handle such case, ring0 PXP should terminate all the hardware sessions and cleanup

[Intel-gfx] [PATCH 19/27] drm/i915/pxp: Enable ioctl action to send TEE commands

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Enable the ioctl action to allow ring3 driver sends TEE commands via ring0 PXP ioctl, instead of TEE iotcl. So we can centralize those protection operations at ring0 PXP. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 15 ++

[Intel-gfx] [PATCH 23/27] mei: bus: enable pavp device.

2020-11-13 Thread Sean Z Huang
From: Tomas Winkler Enable protected audio video path client on mei client bus. Signed-off-by: Tomas Winkler --- drivers/misc/mei/bus-fixup.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c index 4e30fa98fe7d..042399b397c9

[Intel-gfx] [PATCH 04/27] drm/i915/pxp: set KCR reg init during the boot time

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Set the KCR init during the boot time, which is required by hardware, to allow us doing further protection operation such as sending commands to GPU or TEE Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile | 1 +

[Intel-gfx] [PATCH 22/27] drm/i915/pxp: Expose session state for display protection flip

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Implement the intel_pxp_gem_object_status() to allow ring0 i915 display querying the current PXP session state. In the design, ring0 display should not perform protection flip on the protected buffers if there is no PXP session alive. Signed-off-by: Huang, Sean Z ---

[Intel-gfx] [PATCH 11/27] drm/i915/pxp: Enable ioctl action to set session in play

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" With this ioctl action, ring3 driver can set the session in state "session in play", after ring3 reserved the session slot/id from ring3 PXP, and sent the TEE commands to activate the corresponding hardware session. Session state "session in play" means this session is

[Intel-gfx] [PATCH 07/27] drm/i915/pxp: Add PXP-related registers into allowlist

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Add several PXP-related reg into allowlist to allow ring3 driver to read the those register values. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_reg.h | 8 drivers/gpu/drm/i915/intel_uncore.c | 57 + 2 files changed, 50

[Intel-gfx] [PATCH 24/27] mei: pxp: export pavp client to me client bus

2020-11-13 Thread Sean Z Huang
From: Vitaly Lubart Export PAVP client to work with i915_cp driver, for binding it uses kernel component framework. Signed-off-by: Vitaly Lubart Signed-off-by: Tomas Winkler --- drivers/misc/mei/Kconfig | 2 + drivers/misc/mei/Makefile | 1 + drivers/misc/mei/pxp/Kconfig |

[Intel-gfx] [PATCH 21/27] drm/i915/pxp: Add i915 trace logs for PXP operations

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Add several i915 trace logs for PXP calls for debugging or performance measurement, including: (1) PXP ioctl (2) PXP teardown callbacks To trun on this feature, we need to set "CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS=y" in .config for compiling the Linux kernel.

[Intel-gfx] [PATCH 02/27] drm/i915/pxp: Enable PXP irq worker and callback stub

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Create the irq worker that serves as callback handler, those callback stubs should be called while the hardware key teardown occurs. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/gt/intel_gt_irq.c | 4 ++ drivers/gpu/drm/i915/i915_reg.h| 1 +

[Intel-gfx] [PATCH 20/27] drm/i915/pxp: Create the arbitrary session after boot

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Create the arbitrary session, with the fixed session id 0xf, after system boot, for the case that application allocates the protected buffer without establishing any protection session. Because the hardware requires at least one alive session for protected buffer creation.

[Intel-gfx] [PXP CLEAN PATCH v06 18/27] drm/i915/pxp: Implement funcs to create the TEE channel

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Currently ring3 driver sends the TEE commands directly to TEE, but later, as our design, we would like to make ring3 sending the TEE commands via the ring0 PXP ioctl action instead of TEE ioctl, so we can centralize those protection operations at ring0 PXP.

[Intel-gfx] [PXP CLEAN PATCH v06 22/27] drm/i915/pxp: Expose session state for display protection flip

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Implement the intel_pxp_gem_object_status() to allow ring0 i915 display querying the current PXP session state. In the design, ring0 display should not perform protection flip on the protected buffers if there is no PXP session alive. Signed-off-by: Huang, Sean Z ---

[Intel-gfx] [PXP CLEAN PATCH v06 11/27] drm/i915/pxp: Enable ioctl action to set session in play

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" With this ioctl action, ring3 driver can set the session in state "session in play", after ring3 reserved the session slot/id from ring3 PXP, and sent the TEE commands to activate the corresponding hardware session. Session state "session in play" means this session is

[Intel-gfx] [PXP CLEAN PATCH v06 23/27] mei: bus: enable pavp device.

2020-11-13 Thread Sean Z Huang
From: Tomas Winkler Enable protected audio video path client on mei client bus. Signed-off-by: Tomas Winkler --- drivers/misc/mei/bus-fixup.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c index 4e30fa98fe7d..042399b397c9

[Intel-gfx] [PXP CLEAN PATCH v06 25/27] drm/i915/uapi: introduce drm_i915_gem_create_ext for TGL

2020-11-13 Thread Sean Z Huang
From: Bommu Krishnaiah Same old gem_create but with now with extensions support. This is needed to support various upcoming usecases. For now we use the extensions mechanism to support PAVP. Signed-off-by: Bommu Krishnaiah Cc: Joonas Lahtinen joonas.lahti...@linux.intel.com Cc: Matthew Auld

[Intel-gfx] [PXP CLEAN PATCH v06 16/27] drm/i915/pxp: Termiante the session upon app crash

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Ring0 PXP should terminate the hardware session and cleanup the software state gracefully when the application has established the protection session, but doesn't close the session correctly due to some cases like application crash. Signed-off-by: Huang, Sean Z ---

[Intel-gfx] [PXP CLEAN PATCH v06 24/27] mei: pxp: export pavp client to me client bus

2020-11-13 Thread Sean Z Huang
From: Vitaly Lubart Export PAVP client to work with i915_cp driver, for binding it uses kernel component framework. Signed-off-by: Vitaly Lubart Signed-off-by: Tomas Winkler --- drivers/misc/mei/Kconfig | 2 + drivers/misc/mei/Makefile | 1 + drivers/misc/mei/pxp/Kconfig |

[Intel-gfx] [PXP CLEAN PATCH v06 27/27] drm/i915/pxp: Add plane decryption support

2020-11-13 Thread Sean Z Huang
From: Anshuman Gupta Add support to enable/disable PLANE_SURF Decryption Request bit. It requires only to enable plane decryption support when following condition met. 1. PAVP session is enabled. 2. Buffer object is protected. v2: - Rebased to libva_cp-drm-tip_tgl_cp tree. - Used gen fb obj

[Intel-gfx] [PXP CLEAN PATCH v06 17/27] drm/i915/pxp: Enable PXP power management

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" During the power event S3+ sleep/resume, hardware will lose all the encryption keys for every hardware session, even though the software session state was marked as alive after resume. So to handle such case, ring0 PXP should terminate all the hardware sessions and cleanup

[Intel-gfx] [PXP CLEAN PATCH v06 12/27] drm/i915/pxp: Func to send hardware session termination

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Implement the functions to allow ring0 PXP to send a GPU command in order to terminate the hardware session, so hardware can recycle this session slot for the next usage. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp_sm.c | 309

[Intel-gfx] [PXP CLEAN PATCH v06 01/27] drm/i915/pxp: Introduce Intel PXP component

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" PXP (Protected Xe Path) is an i915 componment, that helps ring3 to establish the hardware protected session and manage the status of each alive software session, as well as the life cycle of each session. By design PXP will expose ioctl so allow ring3 to create, set, and

[Intel-gfx] [PXP CLEAN PATCH v06 19/27] drm/i915/pxp: Enable ioctl action to send TEE commands

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Enable the ioctl action to allow ring3 driver sends TEE commands via ring0 PXP ioctl, instead of TEE iotcl. So we can centralize those protection operations at ring0 PXP. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 15 ++

[Intel-gfx] [PXP CLEAN PATCH v06 06/27] drm/i915: Rename the whitelist to allowlist

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Rename the whitelist to allowlist as suggested Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/intel_uncore.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c

[Intel-gfx] [PXP CLEAN PATCH v06 09/27] drm/i915/pxp: Implement funcs to get/set PXP tag

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Implement the functions to get/set the PXP tag, which is 32-bit bitwise value containing the hardware session info, such as its session id, protection mode or whether it's enabled. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp_sm.c | 105

[Intel-gfx] [PXP CLEAN PATCH v06 04/27] drm/i915/pxp: set KCR reg init during the boot time

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Set the KCR init during the boot time, which is required by hardware, to allow us doing further protection operation such as sending commands to GPU or TEE Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile | 1 +

[Intel-gfx] [PXP CLEAN PATCH v06 26/27] drm/i915/pavp: User interface for Protected buffer

2020-11-13 Thread Sean Z Huang
From: Bommu Krishnaiah This api allow user mode to create Protected buffer and context creation. Signed-off-by: Bommu Krishnaiah Cc: Telukuntla Sreedhar Cc: Kondapally Kalyan Cc: Gupta Anshuman Cc: Huang Sean Z --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 15 ++--

[Intel-gfx] [PXP CLEAN PATCH v06 02/27] drm/i915/pxp: Enable PXP irq worker and callback stub

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Create the irq worker that serves as callback handler, those callback stubs should be called while the hardware key teardown occurs. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/gt/intel_gt_irq.c | 4 ++ drivers/gpu/drm/i915/i915_reg.h| 1 +

[Intel-gfx] [PXP CLEAN PATCH v06 10/27] drm/i915/pxp: Enable ioctl action to reserve session slot

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" With this ioctl action, ring3 driver can reserve a specific session slot/id assigned by ring0 PXP, as the first step of PXP session establishment flow. Ring3 PXP stores the session info in the session list structure. Signed-off-by: Huang, Sean Z ---

[Intel-gfx] [PXP CLEAN PATCH v06 20/27] drm/i915/pxp: Create the arbitrary session after boot

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Create the arbitrary session, with the fixed session id 0xf, after system boot, for the case that application allocates the protected buffer without establishing any protection session. Because the hardware requires at least one alive session for protected buffer creation.

[Intel-gfx] [PXP CLEAN PATCH v06 03/27] drm/i915/pxp: Add PXP context for logical hardware states.

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Add PXP context which represents combined view of driver and logical HW states. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 3 +- drivers/gpu/drm/i915/pxp/intel_pxp.c | 32 ++-- drivers/gpu/drm/i915/pxp/intel_pxp.h

[Intel-gfx] [PXP CLEAN PATCH v06 05/27] drm/i915/pxp: Enable ioctl action to set the ring3 context

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Enable one ioctl action to allow ring3 driver to set its ring3 context, so ring0 PXP can track the context id through this ring3 context list. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_drv.c | 1 + drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [PXP CLEAN PATCH v06 07/27] drm/i915/pxp: Add PXP-related registers into allowlist

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Add several PXP-related reg into allowlist to allow ring3 driver to read the those register values. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_reg.h | 8 drivers/gpu/drm/i915/intel_uncore.c | 57 + 2 files changed, 50

[Intel-gfx] [PXP CLEAN PATCH v06 13/27] drm/i915/pxp: Enable ioctl action to terminate the session

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Enable the PXP ioctl action to allow ring3 PXP to terminate the hardware session and cleanup its software session state. Ring0 PXP sends the session termination command to GPU once receves this ioctl action. Signed-off-by: Huang, Sean Z ---

[Intel-gfx] [PXP CLEAN PATCH v06 08/27] drm/i915/pxp: Read register to check hardware session state

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Implement the functions to check the hardware protected session state via reading the hardware register session in play. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.h| 3 + drivers/gpu/drm/i915/pxp/intel_pxp_sm.c | 189

[Intel-gfx] [PXP CLEAN PATCH v06 14/27] drm/i915/pxp: Enable ioctl action to query PXP tag

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Enable the PXP ioctl action to allow ring3 PXP to query the PXP tag, which is a 32-bit bitwise value indicating the current session info, including protection type, session id, and whether the session is enabled. Signed-off-by: Huang, Sean Z ---

[Intel-gfx] [PXP CLEAN PATCH v06 21/27] drm/i915/pxp: Add i915 trace logs for PXP operations

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Add several i915 trace logs for PXP calls for debugging or performance measurement, including: (1) PXP ioctl (2) PXP teardown callbacks To trun on this feature, we need to set "CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS=y" in .config for compiling the Linux kernel.

[Intel-gfx] [PXP CLEAN PATCH v06 15/27] drm/i915/pxp: Destroy all type0 sessions upon teardown

2020-11-13 Thread Sean Z Huang
From: "Huang, Sean Z" Teardown is triggered when the display topology changes and no long meets the secure playback requirement, and hardware trashes all the encryption keys for display. So as a result, ring0 PXP should handle such case and terminate all the type0 sessions. Signed-off-by: