[Intel-gfx] [RFC-v4 02/21] drm/i915/pxp: set KCR reg init during the boot time

2020-12-09 Thread 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/pxp/intel_pxp.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers

[Intel-gfx] [RFC-v4 04/21] drm/i915/pxp: Create the arbitrary session after boot

2020-12-09 Thread Huang, Sean Z
needs to be re-created after teardown or power event because hardware encryption key won't be valid after such cases. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 1 + drivers/gpu/drm/i915/pxp/intel_pxp.c | 1 + drivers/gpu/drm/i915/pxp/intel_

[Intel-gfx] [RFC-v4 06/21] drm/i915/pxp: Enable PXP irq worker and callback stub

2020-12-09 Thread 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 | 3 +- drivers/gpu/drm/i915

[Intel-gfx] [RFC-v4 01/21] drm/i915/pxp: Introduce Intel PXP component

2020-12-09 Thread Huang, Sean Z
(a.k.a default session or arbitrary session). So Mesa can allocate the protected buffer, which is encrypted with the leverage of the arbitrary hardware session. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Kconfig | 19 + drivers/gpu/drm/i915/Makefile

[Intel-gfx] [RFC-v4 00/21] Introduce Intel PXP component - Mesa single session

2020-12-09 Thread Huang, Sean Z
/i915/uapi: introduce drm_i915_gem_create_ext drm/i915/pxp: User interface for Protected buffer Huang, Sean Z (17): drm/i915/pxp: Introduce Intel PXP component drm/i915/pxp: set KCR reg init during the boot time drm/i915/pxp: Implement funcs to create the TEE channel drm/i915/pxp: Create

[Intel-gfx] [RFC-v4 15/21] drm/i915/pxp: Implement ioctl action to set session in play

2020-12-09 Thread Huang, Sean Z
is ready for secure playback. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c| 11 +- drivers/gpu/drm/i915/pxp/intel_pxp_sm.c | 51 + drivers/gpu/drm/i915/pxp/intel_pxp_sm.h | 2 + 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/

[Intel-gfx] [RFC-v4 09/21] drm/i915/pxp: Expose session state for display protection flip

2020-12-09 Thread Huang, Sean Z
Implement the intel_pxp_gem_object_status() to allow i915 display querying the current PXP session state. In the design, display should not perform protection flip on the protected buffers if there is no PXP session alive. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [RFC-v4 20/21] drm/i915/pxp: Add PXP-related registers into allowlist

2020-12-09 Thread Huang, Sean Z
Add several PXP-related reg into allowlist to allow user space driver to read the those register values. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_reg.h | 6 drivers/gpu/drm/i915/intel_uncore.c | 50 - 2 files changed, 41 insertions(+), 15

[Intel-gfx] [RFC-v4 05/21] drm/i915/pxp: Func to send hardware session termination

2020-12-09 Thread Huang, Sean Z
Implement the functions to allow 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/Makefile| 1 + drivers/gpu/drm/i915/pxp/intel_pxp_cmd.c | 156

[Intel-gfx] [RFC-v4 03/21] drm/i915/pxp: Implement funcs to create the TEE channel

2020-12-09 Thread Huang, Sean Z
Implement the funcs to create the TEE channel, so kernel can send the TEE commands directly to TEE for creating the arbitrary (defualt) session. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 3 +- drivers/gpu/drm/i915/i915_drv.c | 1 + drivers/gpu/drm

[Intel-gfx] [RFC-v4 16/21] drm/i915/pxp: Implement ioctl action to terminate the session

2020-12-09 Thread Huang, Sean Z
Implement the PXP ioctl action to allow userspace driver to terminate the hardware session and cleanup its software session state. PXP sends the session termination command to GPU once receves this ioctl action. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 10

[Intel-gfx] [RFC-v4 12/21] drm/i915/pxp: User interface for Protected buffer

2020-12-09 Thread Huang, Sean Z
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 ++-- drivers

[Intel-gfx] [RFC-v4 13/21] drm/i915/pxp: Add plane decryption support

2020-12-09 Thread Huang, Sean Z
user_flags instead gem_object_metadata. [Krishna] Cc: Bommu Krishnaiah Cc: Huang, Sean Z Signed-off-by: Anshuman Gupta --- drivers/gpu/drm/i915/display/intel_sprite.c | 21 ++--- drivers/gpu/drm/i915/i915_reg.h | 1 + 2 files changed, 19 insertions(+), 3 deletions

[Intel-gfx] [RFC-v4 21/21] drm/i915/pxp: Enable the PXP ioctl for protected session

2020-12-09 Thread Huang, Sean Z
In the previous commits, we have implemented the PXP ioctl functions. Now we enable those handlers and expose them as PXP ioctl, so allow the userspace driver can establish, set, or destory the protected session via this ioctl. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_drv.c

[Intel-gfx] [RFC-v4 11/21] drm/i915/uapi: introduce drm_i915_gem_create_ext

2020-12-09 Thread Huang, Sean Z
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 Signed-off-by: Matthew Auld Cc: Joonas Lahtinen joonas.lahti...@linux.i

[Intel-gfx] [RFC-v4 17/21] drm/i915/pxp: Implement ioctl action to send TEE commands

2020-12-09 Thread Huang, Sean Z
Implement the ioctl action to allow userspace driver sends TEE commands via PXP ioctl, instead of TEE iotcl. So we can centralize those protection operations at PXP. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 48 +--- drivers/gpu/drm/i915/pxp

[Intel-gfx] [RFC-v4 14/21] drm/i915/pxp: Implement ioctl action to reserve session slots

2020-12-09 Thread Huang, Sean Z
With this ioctl action, userspace driver can reserve one or multiple session slot/id assigned by kernel PXP, as the first step of PXP session establishment flow. The session info is stored in the session list structure. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile

[Intel-gfx] [RFC-v4 19/21] drm/i915/pxp: Termiante the session upon app crash

2020-12-09 Thread Huang, Sean Z
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 --- drivers/gpu/drm/i915/i915_

[Intel-gfx] [RFC-v4 08/21] drm/i915/pxp: Enable PXP power management

2020-12-09 Thread Huang, Sean Z
the power cycle. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 1 + drivers/gpu/drm/i915/gt/intel_gt_pm.c| 4 ++ drivers/gpu/drm/i915/i915_drv.c | 4 ++ drivers/gpu/drm/i915/pxp/intel_pxp_context.h | 1 + drivers/gpu/drm/i915/pxp

[Intel-gfx] [RFC-v4 10/21] mei: pxp: export pavp client to me client bus

2020-12-09 Thread Huang, Sean Z
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 | 1

[Intel-gfx] [RFC-v4 18/21] drm/i915/pxp: Enable ioctl action to query PXP tag

2020-12-09 Thread Huang, Sean Z
Enable the PXP ioctl action to allow userspace driver 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 --- drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [RFC-v4 07/21] drm/i915/pxp: Destroy arb session upon teardown

2020-12-09 Thread 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, PXP should handle such case and terminate the type0 sessions, which including arb session Signed-off-by: Huang, Sean

[Intel-gfx] [RFC-v5 04/21] drm/i915/pxp: Create the arbitrary session after boot

2020-12-10 Thread Huang, Sean Z
needs to be re-created after teardown or power event because hardware encryption key won't be valid after such cases. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 1 + drivers/gpu/drm/i915/pxp/intel_pxp.c | 1 + drivers/gpu/drm/i915/pxp/intel_

[Intel-gfx] [RFC-v5 16/21] drm/i915/pxp: Implement ioctl action to terminate the session

2020-12-10 Thread Huang, Sean Z
Implement the PXP ioctl action to allow userspace driver to terminate the hardware session and cleanup its software session state. PXP sends the session termination command to GPU once receves this ioctl action. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 10

[Intel-gfx] [RFC-v5 01/21] drm/i915/pxp: Introduce Intel PXP component

2020-12-10 Thread Huang, Sean Z
(a.k.a default session or arbitrary session). So Mesa can allocate the protected buffer, which is encrypted with the leverage of the arbitrary hardware session. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Kconfig | 19 + drivers/gpu/drm/i915/Makefile

[Intel-gfx] [RFC-v5 03/21] drm/i915/pxp: Implement funcs to create the TEE channel

2020-12-10 Thread Huang, Sean Z
Implement the funcs to create the TEE channel, so kernel can send the TEE commands directly to TEE for creating the arbitrary (defualt) session. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 3 +- drivers/gpu/drm/i915/i915_drv.c | 1 + drivers/gpu/drm

[Intel-gfx] [RFC-v5 05/21] drm/i915/pxp: Func to send hardware session termination

2020-12-10 Thread Huang, Sean Z
Implement the functions to allow 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/Makefile| 1 + drivers/gpu/drm/i915/pxp/intel_pxp_cmd.c | 156

[Intel-gfx] [RFC-v5 00/21] Introduce Intel PXP component - Mesa single session

2020-12-10 Thread Huang, Sean Z
#14 to fix the build problem. Anshuman Gupta (1): drm/i915/pxp: Add plane decryption support Bommu Krishnaiah (2): drm/i915/uapi: introduce drm_i915_gem_create_ext drm/i915/pxp: User interface for Protected buffer Huang, Sean Z (17): drm/i915/pxp: Introduce Intel PXP component drm/i91

[Intel-gfx] [RFC-v5 12/21] drm/i915/pxp: User interface for Protected buffer

2020-12-10 Thread Huang, Sean Z
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 ++-- drivers

[Intel-gfx] [RFC-v5 08/21] drm/i915/pxp: Enable PXP power management

2020-12-10 Thread Huang, Sean Z
the power cycle. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 1 + drivers/gpu/drm/i915/gt/intel_gt_pm.c| 4 ++ drivers/gpu/drm/i915/i915_drv.c | 4 ++ drivers/gpu/drm/i915/pxp/intel_pxp_context.h | 1 + drivers/gpu/drm/i915/pxp

[Intel-gfx] [RFC-v5 17/21] drm/i915/pxp: Implement ioctl action to send TEE commands

2020-12-10 Thread Huang, Sean Z
Implement the ioctl action to allow userspace driver sends TEE commands via PXP ioctl, instead of TEE iotcl. So we can centralize those protection operations at PXP. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 48 +--- drivers/gpu/drm/i915/pxp

[Intel-gfx] [RFC-v5 19/21] drm/i915/pxp: Termiante the session upon app crash

2020-12-10 Thread Huang, Sean Z
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 --- drivers/gpu/drm/i915/i915_

[Intel-gfx] [RFC-v5 18/21] drm/i915/pxp: Implement ioctl action to query PXP tag

2020-12-10 Thread Huang, Sean Z
Enable the PXP ioctl action to allow userspace driver 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 --- drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [RFC-v5 02/21] drm/i915/pxp: set KCR reg init during the boot time

2020-12-10 Thread 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/pxp/intel_pxp.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers

[Intel-gfx] [RFC-v5 10/21] mei: pxp: export pavp client to me client bus

2020-12-10 Thread Huang, Sean Z
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 | 1

[Intel-gfx] [RFC-v5 13/21] drm/i915/pxp: Add plane decryption support

2020-12-10 Thread Huang, Sean Z
user_flags instead gem_object_metadata. [Krishna] Cc: Bommu Krishnaiah Cc: Huang, Sean Z Signed-off-by: Anshuman Gupta --- drivers/gpu/drm/i915/display/intel_sprite.c | 21 ++--- drivers/gpu/drm/i915/i915_reg.h | 1 + 2 files changed, 19 insertions(+), 3 deletions

[Intel-gfx] [RFC-v5 21/21] drm/i915/pxp: Enable the PXP ioctl for protected session

2020-12-10 Thread Huang, Sean Z
In the previous commits, we have implemented the PXP ioctl functions. Now we enable those handlers and expose them as PXP ioctl, so allow the userspace driver can establish, set, or destory the protected session via this ioctl. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_drv.c

[Intel-gfx] [RFC-v5 20/21] drm/i915/pxp: Add PXP-related registers into allowlist

2020-12-10 Thread Huang, Sean Z
Add several PXP-related reg into allowlist to allow user space driver to read the those register values. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_reg.h | 6 drivers/gpu/drm/i915/intel_uncore.c | 50 - 2 files changed, 41 insertions(+), 15

[Intel-gfx] [RFC-v5 15/21] drm/i915/pxp: Implement ioctl action to set session in play

2020-12-10 Thread Huang, Sean Z
is ready for secure playback. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c| 11 +- drivers/gpu/drm/i915/pxp/intel_pxp_sm.c | 51 + drivers/gpu/drm/i915/pxp/intel_pxp_sm.h | 2 + 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/

[Intel-gfx] [RFC-v5 09/21] drm/i915/pxp: Expose session state for display protection flip

2020-12-10 Thread Huang, Sean Z
Implement the intel_pxp_gem_object_status() to allow i915 display querying the current PXP session state. In the design, display should not perform protection flip on the protected buffers if there is no PXP session alive. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [RFC-v5 14/21] drm/i915/pxp: Implement ioctl action to reserve session slots

2020-12-10 Thread Huang, Sean Z
With this ioctl action, userspace driver can reserve one or multiple session slot/id assigned by kernel PXP, as the first step of PXP session establishment flow. The session info is stored in the session list structure. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile

[Intel-gfx] [RFC-v5 07/21] drm/i915/pxp: Destroy arb session upon teardown

2020-12-10 Thread 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, PXP should handle such case and terminate the type0 sessions, which including arb session Signed-off-by: Huang, Sean

[Intel-gfx] [RFC-v5 11/21] drm/i915/uapi: introduce drm_i915_gem_create_ext

2020-12-10 Thread Huang, Sean Z
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 Signed-off-by: Matthew Auld Cc: Joonas Lahtinen joonas.lahti...@linux.i

[Intel-gfx] [RFC-v5 06/21] drm/i915/pxp: Enable PXP irq worker and callback stub

2020-12-10 Thread 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 | 3 +- drivers/gpu/drm/i915

[Intel-gfx] [RFC-v6 04/21] drm/i915/pxp: Create the arbitrary session after boot

2020-12-10 Thread Huang, Sean Z
needs to be re-created after teardown or power event because hardware encryption key won't be valid after such cases. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 1 + drivers/gpu/drm/i915/pxp/intel_pxp.c | 1 + drivers/gpu/drm/i915/pxp/intel_

[Intel-gfx] [RFC-v6 11/21] drm/i915/uapi: introduce drm_i915_gem_create_ext

2020-12-10 Thread Huang, Sean Z
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 Signed-off-by: Matthew Auld Cc: Joonas Lahtinen joonas.lahti...@linux.i

[Intel-gfx] [RFC-v6 12/21] drm/i915/pxp: User interface for Protected buffer

2020-12-10 Thread Huang, Sean Z
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 ++-- drivers

[Intel-gfx] [RFC-v6 13/21] drm/i915/pxp: Add plane decryption support

2020-12-10 Thread Huang, Sean Z
user_flags instead gem_object_metadata. [Krishna] Cc: Bommu Krishnaiah Cc: Huang, Sean Z Signed-off-by: Anshuman Gupta --- drivers/gpu/drm/i915/display/intel_sprite.c | 21 ++--- drivers/gpu/drm/i915/i915_reg.h | 1 + 2 files changed, 19 insertions(+), 3 deletions

[Intel-gfx] [RFC-v6 18/21] drm/i915/pxp: Implement ioctl action to query PXP tag

2020-12-10 Thread Huang, Sean Z
Enable the PXP ioctl action to allow userspace driver 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 --- drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [RFC-v6 19/21] drm/i915/pxp: Termiante the session upon app crash

2020-12-10 Thread Huang, Sean Z
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 --- drivers/gpu/drm/i915/i915_

[Intel-gfx] [RFC-v6 00/21] Introduce Intel PXP component - Mesa single session

2020-12-10 Thread Huang, Sean Z
i915/uapi: introduce drm_i915_gem_create_ext drm/i915/pxp: User interface for Protected buffer Huang, Sean Z (17): drm/i915/pxp: Introduce Intel PXP component drm/i915/pxp: set KCR reg init during the boot time drm/i915/pxp: Implement funcs to create the TEE channel drm/i915/pxp: Create the arbitrar

[Intel-gfx] [RFC-v6 14/21] drm/i915/pxp: Implement ioctl action to reserve session slots

2020-12-10 Thread Huang, Sean Z
With this ioctl action, userspace driver can reserve one or multiple session slot/id assigned by kernel PXP, as the first step of PXP session establishment flow. The session info is stored in the session list structure. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile

[Intel-gfx] [RFC-v6 09/21] drm/i915/pxp: Expose session state for display protection flip

2020-12-10 Thread Huang, Sean Z
Implement the intel_pxp_gem_object_status() to allow i915 display querying the current PXP session state. In the design, display should not perform protection flip on the protected buffers if there is no PXP session alive. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [RFC-v6 02/21] drm/i915/pxp: set KCR reg init during the boot time

2020-12-10 Thread 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/pxp/intel_pxp.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers

[Intel-gfx] [RFC-v6 01/21] drm/i915/pxp: Introduce Intel PXP component

2020-12-10 Thread Huang, Sean Z
(a.k.a default session or arbitrary session). So Mesa can allocate the protected buffer, which is encrypted with the leverage of the arbitrary hardware session. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Kconfig | 19 + drivers/gpu/drm/i915/Makefile

[Intel-gfx] [RFC-v6 21/21] drm/i915/pxp: Enable the PXP ioctl for protected session

2020-12-10 Thread Huang, Sean Z
In the previous commits, we have implemented the PXP ioctl functions. Now we enable those handlers and expose them as PXP ioctl, so allow the userspace driver can establish, set, or destory the protected session via this ioctl. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_drv.c

[Intel-gfx] [RFC-v6 07/21] drm/i915/pxp: Destroy arb session upon teardown

2020-12-10 Thread 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, PXP should handle such case and terminate the type0 sessions, which including arb session Signed-off-by: Huang, Sean

[Intel-gfx] [RFC-v6 17/21] drm/i915/pxp: Implement ioctl action to send TEE commands

2020-12-10 Thread Huang, Sean Z
Implement the ioctl action to allow userspace driver sends TEE commands via PXP ioctl, instead of TEE iotcl. So we can centralize those protection operations at PXP. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 48 +--- drivers/gpu/drm/i915/pxp

[Intel-gfx] [RFC-v6 20/21] drm/i915/pxp: Add PXP-related registers into allowlist

2020-12-10 Thread Huang, Sean Z
Add several PXP-related reg into allowlist to allow user space driver to read the those register values. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_reg.h | 6 drivers/gpu/drm/i915/intel_uncore.c | 50 - 2 files changed, 41 insertions(+), 15

[Intel-gfx] [RFC-v6 10/21] mei: pxp: export pavp client to me client bus

2020-12-10 Thread Huang, Sean Z
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 | 1

[Intel-gfx] [RFC-v6 05/21] drm/i915/pxp: Func to send hardware session termination

2020-12-10 Thread Huang, Sean Z
Implement the functions to allow 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/Makefile| 1 + drivers/gpu/drm/i915/pxp/intel_pxp_cmd.c | 156

[Intel-gfx] [RFC-v6 15/21] drm/i915/pxp: Implement ioctl action to set session in play

2020-12-10 Thread Huang, Sean Z
is ready for secure playback. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c| 11 +- drivers/gpu/drm/i915/pxp/intel_pxp_sm.c | 51 + drivers/gpu/drm/i915/pxp/intel_pxp_sm.h | 2 + 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/

[Intel-gfx] [RFC-v6 16/21] drm/i915/pxp: Implement ioctl action to terminate the session

2020-12-10 Thread Huang, Sean Z
Implement the PXP ioctl action to allow userspace driver to terminate the hardware session and cleanup its software session state. PXP sends the session termination command to GPU once receves this ioctl action. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 10

[Intel-gfx] [RFC-v6 08/21] drm/i915/pxp: Enable PXP power management

2020-12-10 Thread Huang, Sean Z
the power cycle. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 1 + drivers/gpu/drm/i915/gt/intel_gt_pm.c| 4 ++ drivers/gpu/drm/i915/i915_drv.c | 4 ++ drivers/gpu/drm/i915/pxp/intel_pxp_context.h | 1 + drivers/gpu/drm/i915/pxp

[Intel-gfx] [RFC-v6 06/21] drm/i915/pxp: Enable PXP irq worker and callback stub

2020-12-10 Thread 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 | 3 +- drivers/gpu/drm/i915

[Intel-gfx] [RFC-v6 03/21] drm/i915/pxp: Implement funcs to create the TEE channel

2020-12-10 Thread Huang, Sean Z
Implement the funcs to create the TEE channel, so kernel can send the TEE commands directly to TEE for creating the arbitrary (defualt) session. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 3 +- drivers/gpu/drm/i915/i915_drv.c | 1 + drivers/gpu/drm

[Intel-gfx] [RFC-v7 00/21] Introduce Intel PXP component - Mesa single session

2020-12-10 Thread Huang, Sean Z
Add plane decryption support Bommu Krishnaiah (2): drm/i915/uapi: introduce drm_i915_gem_create_ext drm/i915/pxp: User interface for Protected buffer Huang, Sean Z (17): drm/i915/pxp: Introduce Intel PXP component drm/i915/pxp: set KCR reg init during the boot time drm/i915/pxp: Imple

[Intel-gfx] [RFC-v7 07/21] drm/i915/pxp: Destroy arb session upon teardown

2020-12-10 Thread 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, PXP should handle such case and terminate the type0 sessions, which including arb session Signed-off-by: Huang, Sean

[Intel-gfx] [RFC-v7 03/21] drm/i915/pxp: Implement funcs to create the TEE channel

2020-12-10 Thread Huang, Sean Z
Implement the funcs to create the TEE channel, so kernel can send the TEE commands directly to TEE for creating the arbitrary (defualt) session. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 3 +- drivers/gpu/drm/i915/i915_drv.c | 1 + drivers/gpu/drm

[Intel-gfx] [RFC-v7 12/21] drm/i915/pxp: User interface for Protected buffer

2020-12-10 Thread Huang, Sean Z
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 ++-- drivers

[Intel-gfx] [RFC-v7 06/21] drm/i915/pxp: Enable PXP irq worker and callback stub

2020-12-10 Thread 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 | 3 +- drivers/gpu/drm/i915

[Intel-gfx] [RFC-v7 19/21] drm/i915/pxp: Termiante the session upon app crash

2020-12-10 Thread Huang, Sean Z
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 --- drivers/gpu/drm/i915/i915_

[Intel-gfx] [RFC-v7 02/21] drm/i915/pxp: set KCR reg init during the boot time

2020-12-10 Thread 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/pxp/intel_pxp.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers

[Intel-gfx] [RFC-v7 20/21] drm/i915/pxp: Add PXP-related registers into allowlist

2020-12-10 Thread Huang, Sean Z
Add several PXP-related reg into allowlist to allow user space driver to read the those register values. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_reg.h | 6 drivers/gpu/drm/i915/intel_uncore.c | 50 - 2 files changed, 41 insertions(+), 15

[Intel-gfx] [RFC-v7 08/21] drm/i915/pxp: Enable PXP power management

2020-12-10 Thread Huang, Sean Z
the power cycle. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 1 + drivers/gpu/drm/i915/gt/intel_gt_pm.c| 4 ++ drivers/gpu/drm/i915/i915_drv.c | 4 ++ drivers/gpu/drm/i915/pxp/intel_pxp_context.h | 1 + drivers/gpu/drm/i915/pxp

[Intel-gfx] [RFC-v7 01/21] drm/i915/pxp: Introduce Intel PXP component

2020-12-10 Thread Huang, Sean Z
(a.k.a default session or arbitrary session). So Mesa can allocate the protected buffer, which is encrypted with the leverage of the arbitrary hardware session. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Kconfig | 19 + drivers/gpu/drm/i915/Makefile

[Intel-gfx] [RFC-v7 05/21] drm/i915/pxp: Func to send hardware session termination

2020-12-10 Thread Huang, Sean Z
Implement the functions to allow 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/Makefile| 1 + drivers/gpu/drm/i915/pxp/intel_pxp_cmd.c | 156

[Intel-gfx] [RFC-v7 09/21] drm/i915/pxp: Expose session state for display protection flip

2020-12-10 Thread Huang, Sean Z
Implement the intel_pxp_gem_object_status() to allow i915 display querying the current PXP session state. In the design, display should not perform protection flip on the protected buffers if there is no PXP session alive. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [RFC-v7 13/21] drm/i915/pxp: Add plane decryption support

2020-12-10 Thread Huang, Sean Z
user_flags instead gem_object_metadata. [Krishna] Cc: Bommu Krishnaiah Cc: Huang, Sean Z Signed-off-by: Anshuman Gupta --- drivers/gpu/drm/i915/display/intel_sprite.c | 21 ++--- drivers/gpu/drm/i915/i915_reg.h | 1 + 2 files changed, 19 insertions(+), 3 deletions

[Intel-gfx] [RFC-v7 16/21] drm/i915/pxp: Implement ioctl action to terminate the session

2020-12-10 Thread Huang, Sean Z
Implement the PXP ioctl action to allow userspace driver to terminate the hardware session and cleanup its software session state. PXP sends the session termination command to GPU once receves this ioctl action. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 10

[Intel-gfx] [RFC-v7 10/21] mei: pxp: export pavp client to me client bus

2020-12-10 Thread Huang, Sean Z
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 | 1

[Intel-gfx] [RFC-v7 18/21] drm/i915/pxp: Implement ioctl action to query PXP tag

2020-12-10 Thread Huang, Sean Z
Enable the PXP ioctl action to allow userspace driver 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 --- drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [RFC-v7 04/21] drm/i915/pxp: Create the arbitrary session after boot

2020-12-10 Thread Huang, Sean Z
needs to be re-created after teardown or power event because hardware encryption key won't be valid after such cases. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile| 1 + drivers/gpu/drm/i915/pxp/intel_pxp.c | 1 + drivers/gpu/drm/i915/pxp/intel_

[Intel-gfx] [RFC-v7 11/21] drm/i915/uapi: introduce drm_i915_gem_create_ext

2020-12-10 Thread Huang, Sean Z
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 Signed-off-by: Matthew Auld Cc: Joonas Lahtinen joonas.lahti...@linux.i

[Intel-gfx] [RFC-v7 17/21] drm/i915/pxp: Implement ioctl action to send TEE commands

2020-12-10 Thread Huang, Sean Z
Implement the ioctl action to allow userspace driver sends TEE commands via PXP ioctl, instead of TEE iotcl. So we can centralize those protection operations at PXP. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 48 +--- drivers/gpu/drm/i915/pxp

[Intel-gfx] [RFC-v7 15/21] drm/i915/pxp: Implement ioctl action to set session in play

2020-12-10 Thread Huang, Sean Z
is ready for secure playback. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c| 11 +- drivers/gpu/drm/i915/pxp/intel_pxp_sm.c | 51 + drivers/gpu/drm/i915/pxp/intel_pxp_sm.h | 2 + 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/

[Intel-gfx] [RFC-v7 14/21] drm/i915/pxp: Implement ioctl action to reserve session slots

2020-12-10 Thread Huang, Sean Z
With this ioctl action, userspace driver can reserve one or multiple session slot/id assigned by kernel PXP, as the first step of PXP session establishment flow. The session info is stored in the session list structure. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile

[Intel-gfx] [RFC-v7 21/21] drm/i915/pxp: Enable the PXP ioctl for protected session

2020-12-10 Thread Huang, Sean Z
In the previous commits, we have implemented the PXP ioctl functions. Now we enable those handlers and expose them as PXP ioctl, so allow the userspace driver can establish, set, or destory the protected session via this ioctl. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/i915_drv.c

[Intel-gfx] [RFC-v8 01/23] drm/i915/pxp: Introduce Intel PXP component

2020-12-11 Thread Huang, Sean Z
(a.k.a default session or arbitrary session). So Mesa can allocate the protected buffer, which is encrypted with the leverage of the arbitrary hardware session. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Kconfig | 19 + drivers/gpu/drm/i915/Makefile

[Intel-gfx] [RFC-v8 02/23] drm/i915/pxp: set KCR reg init during the boot time

2020-12-11 Thread 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/pxp/intel_pxp.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers

[Intel-gfx] [RFC-v8 06/23] drm/i915/pxp: Enable PXP irq worker and callback stub

2020-12-11 Thread 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 | 3 +- drivers/gpu/drm/i915

[Intel-gfx] [RFC-v8 09/23] drm/i915/pxp: Expose session state for display protection flip

2020-12-11 Thread Huang, Sean Z
Implement the intel_pxp_gem_object_status() to allow i915 display querying the current PXP session state. In the design, display should not perform protection flip on the protected buffers if there is no PXP session alive. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [RFC-v8 00/23] Introduce Intel PXP component - Mesa single session

2020-12-11 Thread Huang, Sean Z
or PXP multi-session usage Alexander Usyskin (1): mei: bus: add vtag support Anshuman Gupta (1): drm/i915/pxp: Add plane decryption support Bommu Krishnaiah (2): drm/i915/uapi: introduce drm_i915_gem_create_ext drm/i915/pxp: User interface for Protected buffer Huang, Sean Z (17): drm/i915/

[Intel-gfx] [RFC-v8 17/23] drm/i915/pxp: Implement ioctl action to send TEE commands

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

[Intel-gfx] [RFC-v8 07/23] drm/i915/pxp: Destroy arb session upon teardown

2020-12-11 Thread 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, PXP should handle such case and terminate the type0 sessions, which including arb session Signed-off-by: Huang, Sean

[Intel-gfx] [RFC-v8 21/23] mei: bus: add vtag support

2020-12-11 Thread Huang, Sean Z
From: Alexander Usyskin Add API to support vtag in communication on mei bus. Add mei_cldev_send_vtag, mei_cldev_recv_vtag and mei_cldev_recv_nonblock_vtag functions to allow sending a message with vtag set and to receive vtag of an incoming message. Cc: Sean Z Huang Signed-off-by: Alexander Us

[Intel-gfx] [RFC-v8 18/23] drm/i915/pxp: Implement ioctl action to query PXP tag

2020-12-11 Thread Huang, Sean Z
Enable the PXP ioctl action to allow userspace driver 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 --- drivers/gpu/drm/i915/pxp/intel_pxp.c

[Intel-gfx] [RFC-v8 14/23] drm/i915/pxp: Implement ioctl action to reserve session slots

2020-12-11 Thread Huang, Sean Z
With this ioctl action, userspace driver can reserve one or multiple session slot/id assigned by kernel PXP, as the first step of PXP session establishment flow. The session info is stored in the session list structure. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile

[Intel-gfx] [RFC-v8 05/23] drm/i915/pxp: Func to send hardware session termination

2020-12-11 Thread Huang, Sean Z
Implement the functions to allow 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/Makefile| 1 + drivers/gpu/drm/i915/pxp/intel_pxp_cmd.c | 156

[Intel-gfx] [RFC-v8 16/23] drm/i915/pxp: Implement ioctl action to terminate the session

2020-12-11 Thread Huang, Sean Z
Implement the PXP ioctl action to allow userspace driver to terminate the hardware session and cleanup its software session state. PXP sends the session termination command to GPU once receves this ioctl action. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 10

  1   2   3   4   5   6   >