Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2251743imu; Thu, 24 Jan 2019 09:35:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN5jpyk0kjzF2nksgGnym82tf+0eNdTfeIt8/0GwlBJQRfMDOU0As5rTdLgI0UBYX5HJmEwH X-Received: by 2002:a17:902:3283:: with SMTP id z3mr7539951plb.76.1548351332357; Thu, 24 Jan 2019 09:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548351332; cv=none; d=google.com; s=arc-20160816; b=njSQCndMIc/Rs7uaknZTXqim9BV+wPNqAQXpOxsNxX8cKQn0ekbTqgLHoem6g8OI47 1MnSxjUwd4COB6gi/VHIs0bJfwJD8OIEEUWpYdUQOVTKOhAtd6WMeCKeHukEAEcm22gq dWvqFYGlTj4nZhPMHXKlbrvR6kEYlegsxab58Ev0KHgUrV8aeLI6IpLezdEFDD9rY977 wxolvEaU+xnhwjnlcRII7FYbZxbRoAqAJMu8ojGJiOt2niIxsq5dThj+eZNS/jX3jDkZ WyNlJZNX5FSJc8EJ/9gGO/BtvqfmT0Y8I53CTiCbNpntFeZNK3yz5HB6SnVCTKIITKE7 TZng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LA99GYjCAxlAjylW9nCkBm63LjgUr2vYqlu2+B4w9Rc=; b=XagkprelEZO61EZ3rlntol8f2jS4eEJZiIgVE5SdE6xTI2nER9NvcVc26kD66ZxIgA GqC4Qs1l9SZ3lsyOns9tiV24i+XZSHwaoa895MkQDFZ5y7YxbJlbDWaehq2CS14kXwBu BQ7Ofkw00y8dkq+DxGFgYoQllmEGdEOUdoZ37/zM5LMA1iF7L0yqKnaX+WQuAvjo6AkS zTlcTl7qqmuQTEAT20q6qGChETRI35dOrdEfaD77nLkqP+00s9NLLYOU5jezqca2FpKN CfummfDMnFFHOS+A3HrMuOFYs7VaQw2HGZIOWxHRS3Rc4S9ILSrRBM8aVP+vB8DkY/cv KHNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UA7xzbCi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x186si22281457pfx.269.2019.01.24.09.35.16; Thu, 24 Jan 2019 09:35:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UA7xzbCi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729081AbfAXRdQ (ORCPT + 99 others); Thu, 24 Jan 2019 12:33:16 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39895 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727998AbfAXRdQ (ORCPT ); Thu, 24 Jan 2019 12:33:16 -0500 Received: by mail-pg1-f193.google.com with SMTP id w6so2950816pgl.6 for ; Thu, 24 Jan 2019 09:33:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LA99GYjCAxlAjylW9nCkBm63LjgUr2vYqlu2+B4w9Rc=; b=UA7xzbCiVYMmz6b1jceub6vFwlcP0sUxCXnPx3YjyrlknatM/hRagT5qkktDnzt6uX A+w9yob+jAMIQOdb5OB+fPEtm2iNQDgHeCRFyFQxffIuo/8wSVSXMr6EobBvAXppT3xV dTCypCHyHsi7x27wm4GQ/TEMsF+Fzf7aFCvFc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LA99GYjCAxlAjylW9nCkBm63LjgUr2vYqlu2+B4w9Rc=; b=Xchll1P1quce4P3bnMa5jwURe3Zs8UlpIRdabpBP/pg/1BdQOQhsBQG6pW/4S9ddY1 WwEf25pTUxkF+QwUxyOP0p0oOyFwOTMcxuVg/oohotl66tXhwkjHaZBzxOYwLBZp5jlZ WXnL6LoU418t6HYvuZNr8bK6mlDR4u4nGtZThcuUVU4WWgMkXSsZ+AcQXP9UieQyP4BB evRnhOwDR2qTZ/QLq+yFGtV8AYp849/odEsthv/FMMAtU2NeEGLAtl4o51tU6ppMPXBk UuoDmE8oRg94Y1SUKo/c8KOGFNBceUUx6i+1EQ2x6/4eV62Q2kbkfvfJ/MjeS/JC07Zp IWew== X-Gm-Message-State: AJcUukePhrkS+6Qtf6M1xRwAsHEHvCE6uIQIBEAcwkZb/DdRIUdHQtAJ QcGCfZpuFch4zUPEjRtQsDhEHLL9++HdM5reHvcot8mI X-Received: by 2002:a63:77ce:: with SMTP id s197mr6706532pgc.89.1548351195596; Thu, 24 Jan 2019 09:33:15 -0800 (PST) MIME-Version: 1.0 References: <1548335501-7868-1-git-send-email-igor.opaniuk@linaro.org> In-Reply-To: From: Igor Opaniuk Date: Thu, 24 Jan 2019 19:32:39 +0200 Message-ID: Subject: Re: [PATCH 1/1] tee: add cancellation support to client interface To: Jens Wiklander Cc: Linux Kernel Mailing List , Linux ARM , tee-dev@lists.linaro.org, Jerome Forissier , "Zengtao (B)" , Sumit Garg Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org right, missed that. Thanks! Addressed this issue + also fixed the description and sent v2. On Thu, 24 Jan 2019 at 18:19, Jens Wiklander wrote: > > On Thu, Jan 24, 2019 at 2:11 PM Igor Opaniuk 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 in TPM2.0 mobile profile), for requesting > > cancellation of time-consuming operations (RSA key-pair generation etc.). > > > > Signed-off-by: Igor Opaniuk > > --- > > drivers/tee/tee_core.c | 12 ++++++++++++ > > include/linux/tee_drv.h | 14 ++++++++++++++ > > 2 files changed, 26 insertions(+) > > > > diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c > > index 7b2bb4c..aba71a8 100644 > > --- a/drivers/tee/tee_core.c > > +++ b/drivers/tee/tee_core.c > > @@ -1027,6 +1027,18 @@ 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, > > + u32 cancel_id, > > + u32 session) > > +{ > > + > > + if (!ctx->teedev->desc->ops->cancel_req) > > + return -EINVAL; > > + return ctx->teedev->desc->ops->cancel_req(ctx, cancel_id, > > + 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..62a0b56 100644 > > --- a/include/linux/tee_drv.h > > +++ b/include/linux/tee_drv.h > > @@ -526,6 +526,20 @@ 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: Unique cancel request id > > + * @param: Session id > > These need to be updated, see struct tee_ioctl_cancel_arg in > include/uapi/linux/tee.h > > Thanks, > Jens > > > + * > > + * Returns < 0 on error else see @arg->ret for result. > > + */ > > +int tee_client_cancel_req(struct tee_context *ctx, > > + u32 cancel_id, > > + u32 session); > > + > > + > > static inline bool tee_param_is_memref(struct tee_param *param) > > { > > switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) { > > -- > > 2.7.4 > > -- Regards, Igor Opaniuk