Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2196486iob; Thu, 5 May 2022 18:42:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlhkOKNcPYVxfooiJwGD6tZlJaYJGHC2pCSpE7DT4KQITWyKEiDXDHygMIXXVSQ8UGzPZn X-Received: by 2002:a17:907:960d:b0:6f4:3b68:8d55 with SMTP id gb13-20020a170907960d00b006f43b688d55mr870539ejc.105.1651801321465; Thu, 05 May 2022 18:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651801321; cv=none; d=google.com; s=arc-20160816; b=eY6u7TOnKO5cEfTXHJ+HrvzdHzZ34KF2AcJx7R3ZFHJz77vF8VL3MbvMuTiKDEEL9H LX3fJu5b042wai8bwhu4/fKDkh0SOv4KqyLb5+7qW1aIpIccZXgflC8QWDNamp5hPhn5 mWs3I/8A0C0REnvnuHnsdxK7BUuRppKuV6+RI3D6AnHDbwwfYiQB9sZ56RCQky1Y6Ujk omvXc2G1ergIwKt5MJaNtTVAZTwboQu9F9StQNw3r7PPpSNQjNgutkYGie214Mb+czEp W81v5oMEZ8x88/mFo47hArinIhn/n0bzebf6Tp+oUYjuazPRNmf1vj04DSOJScTuy3mN sUFg== 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=rciyAge845BWG9mlD1S98CNzrOU1Orh/xcyyS8+TIrQ=; b=O2oZbh9/+scq31Dcwe/79nooOenFlt5QNbH4UQLaRWbGC5yl9ACsv77s0y/kFWXx/m abpr7Hgx4diL4Een3+YauSCK0ARDpgUNkz/9m2knxJ06GSKuU2/QmSHeMyw1HZBDv603 8tst/9zv/5XKSjRU/yv9HUk1/L5v8t/WiUFuIQZy1h+MLrtsaxucBsmcT+OXeQLodpQ0 mE4G4TrJc9kpvF5aESjt4N6neG+L8teEEx8i082PCPv2uqFVhZfhlksXSD20yM2FXDcP 43z3j5mCQODqFvo9Pb3mR6QwVuiDblIlfATkS/bTAa8ydZuVfrQNB9kdYxpRKA7lZoB5 NdfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bA31F5qe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx15-20020a0564020b4f00b00421c744d1c7si3043669edb.538.2022.05.05.18.41.38; Thu, 05 May 2022 18:42:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bA31F5qe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S243279AbiEEFSn (ORCPT + 99 others); Thu, 5 May 2022 01:18:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243252AbiEEFSm (ORCPT ); Thu, 5 May 2022 01:18:42 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03EBF6441 for ; Wed, 4 May 2022 22:15:04 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 15so2826536pgf.4 for ; Wed, 04 May 2022 22:15:03 -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=rciyAge845BWG9mlD1S98CNzrOU1Orh/xcyyS8+TIrQ=; b=bA31F5qeB2Pfmy2yJFw8I9b+3ot/zzHb/yJxojfnI+MNjJ3kI6s4rlc2gJU5lbtW79 PkpLTv6ge1hBlbzMb3QpHu4J+/8oHt0RjbIUUpFda0LgQsAeK+NmuXvBz7RQGO+3Sa+s TZxoKfN4NTFpb4U/b24rLCVWtCQregrsErcv3FL+icWAlZMCYfuCOEWGa4aZTlZeAjqM QreWzxf6FJfXQqqqSnsC+Cpb1hez/v+u80sfU/ANvJHJqQaqs0LyK+jASO6ZamI1d32m T0yBuucNpxwGVFfrZTwK/iRSFRYEcupCdfUaipP1OQpAJXE4bOILUumfnQkY4wCKZOom Uyjw== 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=rciyAge845BWG9mlD1S98CNzrOU1Orh/xcyyS8+TIrQ=; b=Ns1kqG1IDoK/Q/DcMPOiMx7qhJh4Hr5O6kI6bF35vlh1KWs0ucP5Ie/NyHF9taj/WS 741dENBTNsgDguZA9Yp+LZ/BSUYRQFxzkEPk0gjhPc7SdzT6FO6YVt3T2GppDgIxLyCL 1Fpfm2sxvZHj07haWbbeDszj6aEu+W/hcOVwTle5mqIPq/wcoo7VkaWGFNiEP/EtkSxN DgS1w2THS0mAIT2YvUZlmfDJTCNWIw7CEzleHwR2jDn0s3l1Na+tCbwz3l8GsLz9dA1G ifcaBx1ecwquNIAfROAcfmqz/ynxAglCbbhAuW3rawOyuMDM3tCfOX/XWYD+8mclCNjA 30TQ== X-Gm-Message-State: AOAM5305lGzq4BhlE/RXr8/16SmqA/ZVygwlVcsrtVPTGqVUnJ6qbk05 AITu3nK2d/MCLeEea/XyeVWspM4rnGeRg9sruJ/XCPZxnOs= X-Received: by 2002:a63:db17:0:b0:3c1:dc15:7a6e with SMTP id e23-20020a63db17000000b003c1dc157a6emr19512781pgg.107.1651727703367; Wed, 04 May 2022 22:15:03 -0700 (PDT) MIME-Version: 1.0 References: <20220426073338.3048192-1-jens.wiklander@linaro.org> In-Reply-To: <20220426073338.3048192-1-jens.wiklander@linaro.org> From: Jens Wiklander Date: Thu, 5 May 2022 07:14:52 +0200 Message-ID: Subject: Re: [PATCH v4 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tue, Apr 26, 2022 at 9:33 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 > > v3->v4: > * Updated "optee: cache argument shared memory structs" to work with older > versions of the SMC-ABI when using dynamic shared memory. > > 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 | 197 ++++++++++++++++++++----- > 7 files changed, 461 insertions(+), 102 deletions(-) > > -- > 2.31.1 > I've picked this up now. Thanks, Jens