Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2172790imu; Thu, 24 Jan 2019 08:20:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN6flRAOhJCzYx4LXhD8K7ci7vwaAVI6gAXwkdr7NFcWCxf5ft+xLGVbIKtNjBwBaWqMBP9K X-Received: by 2002:a63:5ec6:: with SMTP id s189mr6226985pgb.357.1548346820155; Thu, 24 Jan 2019 08:20:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548346820; cv=none; d=google.com; s=arc-20160816; b=EkATFeyQoy0VRpwjFXysCYrBlMgK++cg9U2GmAjpkRzK5WMjc6VTT+yPTBvmQA3fFy fIqJSR/56d20WxPkIvnvcJROGt8z2kR4ydBAMYRmSXwXqoXLmaN4KY6OVehUlQkKPzXh SnZlRLVHLpq0vAHEsMIIrYqK/OTYKssjNLyIJb3kxmQTG5wafpvwPGBduNSnjUR2vTOx UzmMBh9G6eMN8+aSQwtGOU9G2/SpALPx8Sqafxycz+jhU3D0ZER65mR0+K59Z/sCOPl8 9lAW8XWmlFaKU4mdgPpcjVK40KfirYa4qBQdbjfFuTTf3svfGn12Cr/U7cq5qG4ZD5fk SorQ== 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=4MfDhyDuR/Zb7WxDMUlVeIwcU+XD2G4F2gkmp10wb3k=; b=hZUElab/zuqVED3NoqZW+LnkuOBaaz5SdURRo7HZ9d5083/ECvGJ6SYTIRiYZ0GcZT PPnN//yH2dBbS3PQuTnwze/INdzSJbo2i4kXzZEU+A2zf+vjlusDE7gqIUtmVyYd8mVl zS9g9wNZKE3tvPuK2z1K6vKA7rw1w9tvIIHWX0LHqBqzbvoVp8d5ShLjVW85ZUZA6Uiv ib8eDaY6AgxsbfJaHwYErMhvYOoP6Y9FssJwRPvJi1BEBEWV17/Uzf61qvLuABCGDiUP /0Ok2RwFVmgKCfvk3GzVLu7rb7NvxeY1iGfVJi1JB38EjZi4M8KL59Fm3F3g0iQ1agRn DwvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qj+6EivJ; 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 d10si22189859pls.170.2019.01.24.08.20.05; Thu, 24 Jan 2019 08:20:20 -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=Qj+6EivJ; 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 S1728832AbfAXQTr (ORCPT + 99 others); Thu, 24 Jan 2019 11:19:47 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:51007 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728756AbfAXQTo (ORCPT ); Thu, 24 Jan 2019 11:19:44 -0500 Received: by mail-it1-f193.google.com with SMTP id z7so5867386iti.0 for ; Thu, 24 Jan 2019 08:19:44 -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=4MfDhyDuR/Zb7WxDMUlVeIwcU+XD2G4F2gkmp10wb3k=; b=Qj+6EivJrL6iw+ZzBfb8QggWcOaCD0osehsHN8Rq7brAgt0gjIGZ8AoNEHXLicyVje TTazv5SE5uV5VJGM9kk0RPsaF5fGxv38rbbnbpX3WQEocNfuTIQ0TJfMcfzkKi8v3RN6 Z3AXxIboNZjNZ9DfPC/4RiV89D0SuklPQDj78= 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=4MfDhyDuR/Zb7WxDMUlVeIwcU+XD2G4F2gkmp10wb3k=; b=HIAtujsRakCskaFXUFrudpKU9lxEe5X/1Q3Pclt33iwsjWKncqDWzzxjRnSLkb9G75 71xm9Xc1+jz6Yd+1w2GQ5gkj3ij9uNGuiauLk2aYAJSmbMN6cxj8aMb4PIRtSd/NBEW5 37+txQC7HtpppP9gEtGh+WAOxDe9OkZuZm5afVBBw3jVT52DzkT4Ud9XLLTcoYUBUAp+ 2TSR61JTqTfbNStq/b0cJDjQR29IFbX+Q0HmYNAG3sw/olLF3z9abFFKzRJiCpJJfK8P A8oza2yGWVrISgnGIQIF3MfwocghbwwHFwRKJ/VWBr8sbLlxh43Y8uGLs3ktr6blfyr+ 6WTw== X-Gm-Message-State: AJcUukfQ57ZHxDbS5LrM/CLJEzI9+PtJHI+gpuTPiD8EFe+I8LHsD6XK 8wFPhLKwEcn2sCMx0+B/y9oBOMoukKn50QWZg8k3ow== X-Received: by 2002:a24:874a:: with SMTP id f71mr1752492ite.120.1548346782796; Thu, 24 Jan 2019 08:19:42 -0800 (PST) MIME-Version: 1.0 References: <1548335501-7868-1-git-send-email-igor.opaniuk@linaro.org> In-Reply-To: <1548335501-7868-1-git-send-email-igor.opaniuk@linaro.org> From: Jens Wiklander Date: Thu, 24 Jan 2019 17:19:31 +0100 Message-ID: Subject: Re: [PATCH 1/1] tee: add cancellation support to client interface To: Igor Opaniuk 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 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 >