* [PATCH v2 1/1] tee: add cancellation support to client interface
@ 2019-01-24 17:32 Igor Opaniuk
2019-02-13 13:36 ` Igor Opaniuk
0 siblings, 1 reply; 3+ messages in thread
From: Igor Opaniuk @ 2019-01-24 17:32 UTC (permalink / raw)
To: linux-kernel, linux-arm-kernel, tee-dev
Cc: jerome.forissier, jens.wiklander, prime.zeng, sumit.garg
Add support of cancellation request to the TEE kernel internal
client interface. Can be used by software TPM drivers, that leverage
TEE under the hood (for instance TPM2.0 mobile profile), for requesting
cancellation of time-consuming operations (RSA key-pair generation etc.).
Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
---
v2:
- use tee_ioctl_cancel_arg to provide session and cancel_id
- fix tee_client_cancel_req function description header
drivers/tee/tee_core.c | 10 ++++++++++
include/linux/tee_drv.h | 12 ++++++++++++
2 files changed, 22 insertions(+)
diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
index 7b2bb4c..1148175 100644
--- a/drivers/tee/tee_core.c
+++ b/drivers/tee/tee_core.c
@@ -1027,6 +1027,16 @@ int tee_client_invoke_func(struct tee_context *ctx,
}
EXPORT_SYMBOL_GPL(tee_client_invoke_func);
+int tee_client_cancel_req(struct tee_context *ctx,
+ struct tee_ioctl_cancel_arg *arg)
+{
+ if (!ctx->teedev->desc->ops->cancel_req)
+ return -EINVAL;
+ return ctx->teedev->desc->ops->cancel_req(ctx, arg->cancel_id,
+ arg->session);
+}
+EXPORT_SYMBOL_GPL(tee_client_cancel_req);
+
static int __init tee_init(void)
{
int rc;
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
index 6cfe058..177016e 100644
--- a/include/linux/tee_drv.h
+++ b/include/linux/tee_drv.h
@@ -526,6 +526,18 @@ int tee_client_invoke_func(struct tee_context *ctx,
struct tee_ioctl_invoke_arg *arg,
struct tee_param *param);
+/**
+ * tee_client_cancel_req() - Request cancellation of the previous open-session
+ * or invoke-command operations in a Trusted Application
+ * @ctx: TEE Context
+ * @arg: Cancellation arguments, see description of
+ * struct tee_ioctl_cancel_arg
+ *
+ * Returns < 0 on error else 0 if the cancellation was successfully requested.
+ */
+int tee_client_cancel_req(struct tee_context *ctx,
+ struct tee_ioctl_cancel_arg *arg);
+
static inline bool tee_param_is_memref(struct tee_param *param)
{
switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] tee: add cancellation support to client interface
2019-01-24 17:32 [PATCH v2 1/1] tee: add cancellation support to client interface Igor Opaniuk
@ 2019-02-13 13:36 ` Igor Opaniuk
2019-02-14 8:42 ` Jens Wiklander
0 siblings, 1 reply; 3+ messages in thread
From: Igor Opaniuk @ 2019-02-13 13:36 UTC (permalink / raw)
To: Linux Kernel Mailing List, Linux ARM, tee-dev, Jens Wiklander
Cc: Jerome Forissier, Zengtao (B), Sumit Garg
On Thu, 24 Jan 2019 at 19:32, Igor Opaniuk <igor.opaniuk@linaro.org> wrote:
>
> Add support of cancellation request to the TEE kernel internal
> client interface. Can be used by software TPM drivers, that leverage
> TEE under the hood (for instance TPM2.0 mobile profile), for requesting
> cancellation of time-consuming operations (RSA key-pair generation etc.).
>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
> ---
>
> v2:
> - use tee_ioctl_cancel_arg to provide session and cancel_id
> - fix tee_client_cancel_req function description header
>
> drivers/tee/tee_core.c | 10 ++++++++++
> include/linux/tee_drv.h | 12 ++++++++++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
> index 7b2bb4c..1148175 100644
> --- a/drivers/tee/tee_core.c
> +++ b/drivers/tee/tee_core.c
> @@ -1027,6 +1027,16 @@ int tee_client_invoke_func(struct tee_context *ctx,
> }
> EXPORT_SYMBOL_GPL(tee_client_invoke_func);
>
> +int tee_client_cancel_req(struct tee_context *ctx,
> + struct tee_ioctl_cancel_arg *arg)
> +{
> + if (!ctx->teedev->desc->ops->cancel_req)
> + return -EINVAL;
> + return ctx->teedev->desc->ops->cancel_req(ctx, arg->cancel_id,
> + arg->session);
> +}
> +EXPORT_SYMBOL_GPL(tee_client_cancel_req);
> +
> static int __init tee_init(void)
> {
> int rc;
> diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
> index 6cfe058..177016e 100644
> --- a/include/linux/tee_drv.h
> +++ b/include/linux/tee_drv.h
> @@ -526,6 +526,18 @@ int tee_client_invoke_func(struct tee_context *ctx,
> struct tee_ioctl_invoke_arg *arg,
> struct tee_param *param);
>
> +/**
> + * tee_client_cancel_req() - Request cancellation of the previous open-session
> + * or invoke-command operations in a Trusted Application
> + * @ctx: TEE Context
> + * @arg: Cancellation arguments, see description of
> + * struct tee_ioctl_cancel_arg
> + *
> + * Returns < 0 on error else 0 if the cancellation was successfully requested.
> + */
> +int tee_client_cancel_req(struct tee_context *ctx,
> + struct tee_ioctl_cancel_arg *arg);
> +
> static inline bool tee_param_is_memref(struct tee_param *param)
> {
> switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
> --
> 2.7.4
>
Hi,
Just gentle reminder - v2 patch has been sitting in ML for almost 2
weeks with no review (all issues mentioned in v1 were addressed).
If anyone has any objections/suggestions, please let me know.
Thanks!
--
Regards,
Igor Opaniuk
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] tee: add cancellation support to client interface
2019-02-13 13:36 ` Igor Opaniuk
@ 2019-02-14 8:42 ` Jens Wiklander
0 siblings, 0 replies; 3+ messages in thread
From: Jens Wiklander @ 2019-02-14 8:42 UTC (permalink / raw)
To: Igor Opaniuk
Cc: Linux Kernel Mailing List, Linux ARM, tee-dev, Jerome Forissier,
Zengtao (B),
Sumit Garg
Hi Igor,
On Wed, Feb 13, 2019 at 2:36 PM Igor Opaniuk <igor.opaniuk@linaro.org> wrote:
>
> On Thu, 24 Jan 2019 at 19:32, Igor Opaniuk <igor.opaniuk@linaro.org> wrote:
> >
> > Add support of cancellation request to the TEE kernel internal
> > client interface. Can be used by software TPM drivers, that leverage
> > TEE under the hood (for instance TPM2.0 mobile profile), for requesting
> > cancellation of time-consuming operations (RSA key-pair generation etc.).
> >
> > Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
> > ---
> >
> > v2:
> > - use tee_ioctl_cancel_arg to provide session and cancel_id
> > - fix tee_client_cancel_req function description header
> >
> > drivers/tee/tee_core.c | 10 ++++++++++
> > include/linux/tee_drv.h | 12 ++++++++++++
> > 2 files changed, 22 insertions(+)
> >
> > diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
> > index 7b2bb4c..1148175 100644
> > --- a/drivers/tee/tee_core.c
> > +++ b/drivers/tee/tee_core.c
> > @@ -1027,6 +1027,16 @@ int tee_client_invoke_func(struct tee_context *ctx,
> > }
> > EXPORT_SYMBOL_GPL(tee_client_invoke_func);
> >
> > +int tee_client_cancel_req(struct tee_context *ctx,
> > + struct tee_ioctl_cancel_arg *arg)
> > +{
> > + if (!ctx->teedev->desc->ops->cancel_req)
> > + return -EINVAL;
> > + return ctx->teedev->desc->ops->cancel_req(ctx, arg->cancel_id,
> > + arg->session);
> > +}
> > +EXPORT_SYMBOL_GPL(tee_client_cancel_req);
> > +
> > static int __init tee_init(void)
> > {
> > int rc;
> > diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
> > index 6cfe058..177016e 100644
> > --- a/include/linux/tee_drv.h
> > +++ b/include/linux/tee_drv.h
> > @@ -526,6 +526,18 @@ int tee_client_invoke_func(struct tee_context *ctx,
> > struct tee_ioctl_invoke_arg *arg,
> > struct tee_param *param);
> >
> > +/**
> > + * tee_client_cancel_req() - Request cancellation of the previous open-session
> > + * or invoke-command operations in a Trusted Application
> > + * @ctx: TEE Context
> > + * @arg: Cancellation arguments, see description of
> > + * struct tee_ioctl_cancel_arg
> > + *
> > + * Returns < 0 on error else 0 if the cancellation was successfully requested.
> > + */
> > +int tee_client_cancel_req(struct tee_context *ctx,
> > + struct tee_ioctl_cancel_arg *arg);
> > +
> > static inline bool tee_param_is_memref(struct tee_param *param)
> > {
> > switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
> > --
> > 2.7.4
> >
> Hi,
>
> Just gentle reminder - v2 patch has been sitting in ML for almost 2
> weeks with no review (all issues mentioned in v1 were addressed).
> If anyone has any objections/suggestions, please let me know.
Looks good. I'll pick it up.
Thanks,
Jens
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-14 8:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 17:32 [PATCH v2 1/1] tee: add cancellation support to client interface Igor Opaniuk
2019-02-13 13:36 ` Igor Opaniuk
2019-02-14 8:42 ` Jens Wiklander
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).