Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp899908pxb; Fri, 22 Apr 2022 13:48:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMWsvx36kmQeKUxk9/N/M4nSEZXHGDrni5KklbzRdV1MLFlE7MBzW/5pYlao/fBRX4E2mH X-Received: by 2002:a05:6a00:1749:b0:50a:8eed:b824 with SMTP id j9-20020a056a00174900b0050a8eedb824mr6860477pfc.50.1650660517171; Fri, 22 Apr 2022 13:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650660517; cv=none; d=google.com; s=arc-20160816; b=CCw5AvTNBtKXCTinvm/jmvcBIX2vcCLyA4+HqIT36cfA2TzQhILXi5Dg/mO91wYad7 dJpNRCbEQZDWcvvXUsA73wwmldDGxah/7R0essd54n3gNWYLPSO5NR7oW5+eAAGhhOBy F6K4BO2cJaTFQBSVh9pXdqAI1yYz/upxTmhne94n8fG+JgrC8HAx+YhKI/JGDG5O4Pfb Rpt9l2Ahmzm27fBNBBJGo5bfWRg57dRKtydaXVfasHbcbZUWAzuBfBg/LiGgIYTnZ2Zr ljpcJxkvuMMSooWvJWhOZ7octLtIUzh02xRnMhpFGoRGQx5zoARbHSGK17Cwtl40jivM oRKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=x8vc5Lqzum4lYDosmWy4L9nn8ptNN2qPG9vpBgUE29c=; b=wzktFAaAvCIAXizkvyYGXQ5YnBB0O5G+ll4ztVjxwlaFpYjZbmHdSdw8zJKpZ2/0hx geYZ3sCUbddrt39EkuyL51E9T/Vbvggt2lMGI/p5jgYc/rhTBfEOQsWrBgXMDPB/WWwH DrrR4H6hbd+iLvoaHCzEvfWIdo2Q+JdIh13FBDmCfJcKfveotqVuTgk/FgI8bOcwbbKg EcDN3mHAoV4Ka6gTQ8BmwrDz5RsepoMrN7/UOEkq4K/m1V/Nw3nljnrroPDxWwOCp5Bi JJqS17OUAZuLb5tj7KA+f/gy3UayyILBY9XmP52CDfv4fI8cBX05orKLd9x6TRVXiiBc B1hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WreX/8/G"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w28-20020a63af1c000000b003aa74c5447esi9209571pge.201.2022.04.22.13.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:48:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WreX/8/G"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3D76D16E6BD; Fri, 22 Apr 2022 12:38:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388785AbiDULfv (ORCPT + 99 others); Thu, 21 Apr 2022 07:35:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbiDULft (ORCPT ); Thu, 21 Apr 2022 07:35:49 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1281140D0 for ; Thu, 21 Apr 2022 04:33:00 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id h12so896599plf.12 for ; Thu, 21 Apr 2022 04:33:00 -0700 (PDT) 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=x8vc5Lqzum4lYDosmWy4L9nn8ptNN2qPG9vpBgUE29c=; b=WreX/8/GVFQwIgFsNGXkM/1h4E/2rdW6bda3eIkkC4EDnv20mtqcz+bfpGzPbmLSdU /6WSAoqGkCatJS7pWJf/h9LRxRByUSgTbJXuIaoZSJYP0W4QVh+qCGldGbiS78GdIZJE 340OQ23cpojJjq0MoSf2aDDTemNfKoE119MccYMEhTUaezA1IXGBmim2yk/GNoN9Rhoj mjekibaHqyrUXVd3Avqiyly0MKzJF/ykBWz7EpFJIaTE/Pf2hC3He5k/r5/bm5lAYesp 20pGJcfn0UFZfORzJb4im45Rn8pcnWJCN9cWva6GftviGOQlWEq92YZT3UwK0S4XHO0L TY4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x8vc5Lqzum4lYDosmWy4L9nn8ptNN2qPG9vpBgUE29c=; b=URMPBDboXufqlB0CQ3+3HbRxd+vY1FFf1oO3kNJLFlRikrhLf6R/IcAjF3Yc5RZSqy tWbKBf8SNKi8g1WgXdM7zGxSgMlJkDgfT6IJiLbnwi+F+1/eDrDgiEo+IkvrLIWeKxhz nP2uv/JEziyjl2LC/Z8esK7sSuflFwn7E3lcjA/qduGj9XezZEMJfUir1g8U14wodGtV 2c4vgMZP+OXCufIh11EG9Bc+UHqLXOC7d+oDxwBrvO9Kw3uEg8s3Cy7Cw6CNVp3eWJT8 m+T5i57kEgRV5QTwbZq8BjYtUuEHAHnBYUI1N/vDvVeItrzOq0+pzNrRH2YFj5h5t7Jt I2GQ== X-Gm-Message-State: AOAM530rWlDrwUtXlPYp+vTuuOkYZ7NLbBokrpHrFcBugwjItmqmTXjW WBGWSZoVz+AHDri+zOTAmrAU/3xL450fXbIJ+CfH9VmbIUo= X-Received: by 2002:a17:903:1212:b0:156:3ddc:84bd with SMTP id l18-20020a170903121200b001563ddc84bdmr24577436plh.70.1650540780111; Thu, 21 Apr 2022 04:33:00 -0700 (PDT) MIME-Version: 1.0 References: <20220413054418.71996-1-jens.wiklander@linaro.org> In-Reply-To: <20220413054418.71996-1-jens.wiklander@linaro.org> From: Jens Wiklander Date: Thu, 21 Apr 2022 13:32:49 +0200 Message-ID: Subject: Re: [PATCH v3 0/4] OP-TEE RPC argument cache To: linux-kernel@vger.kernel.org, op-tee@lists.trustedfirmware.org Cc: Sumit Garg Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 13, 2022 at 7:44 AM Jens Wiklander wrote: > > Hi all, > > This patchset optimizes handling of the argument struct passed to > call_with_arg when doing a yielding call to OP-TEE. > > Prior to this was this struct allocated before the yielding call and > then freed after it had returned. In case many calls are made in succession > this results in quite a bit of unnecessary allocte/free and possibly also > switching back and forth to secure work in order to register if needed. > > Another optimization handles the way the argument struct needed to do RPC > is passed. Please see the patch "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and > OPTEE_SMC_CALL_WITH_REGD_ARG" for details. > > Thanks, > Jens > > v1->v2: > * Split out a separate commit "optee: rename rpc_arg_count to > rpc_param_count" > * Check optee->rpc_param_count before calling optee_disable_shm_cache(). > * Mention OPTEE_SMC_CALL_WITH_REGD_ARG in commit message. > > v2->v3: > * Applied Sumit's R-B to "optee: rename rpc_arg_count to rpc_param_count" > and "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG" > * Fixed some review comments to "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and > OPTEE_SMC_CALL_WITH_REGD_ARG" > * Rebased on v5.18-rc1 > > > Jens Wiklander (4): > optee: rename rpc_arg_count to rpc_param_count > optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and > OPTEE_SMC_CALL_WITH_REGD_ARG > optee: add FF-A capability OPTEE_FFA_SEC_CAP_ARG_OFFSET > optee: cache argument shared memory structs > > drivers/tee/optee/call.c | 238 ++++++++++++++++++++++++------ > drivers/tee/optee/core.c | 1 + > drivers/tee/optee/ffa_abi.c | 36 +++-- > drivers/tee/optee/optee_ffa.h | 12 +- > drivers/tee/optee/optee_private.h | 31 +++- > drivers/tee/optee/optee_smc.h | 48 +++++- > drivers/tee/optee/smc_abi.c | 162 +++++++++++++++----- > 7 files changed, 428 insertions(+), 100 deletions(-) I'm going to pick up this if there are no further comments. Thanks, Jens > > -- > 2.31.1 >