Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1728663iob; Thu, 5 May 2022 07:14:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4MgQdB+ius7mP5TbQjlwcty0ueOTMLDeaLZuUuIpTo7LPrc37kiikzWWXApqEE/WO3vdW X-Received: by 2002:a05:6a00:ad0:b0:4e1:2d96:2ab0 with SMTP id c16-20020a056a000ad000b004e12d962ab0mr25944690pfl.3.1651760049123; Thu, 05 May 2022 07:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651760049; cv=none; d=google.com; s=arc-20160816; b=PHyNLKJuWFv5ygWnMsxejlW4iofBsIKJ+eMiZ6TVqLUma4nAYCo+NL/wo5YOCR9rkk 4ZLyXLI7Zohg/TMjcyIkx/rT4T8vsPgnuwwLGtz/tb8nrgJlOoC5hYbIfNI9xzh00zlx 51b1chWDgOmXAqD7vV7JXoumLfJy7Gya801GH1CEzVm2I5kghw0G1gGQjlaoZiDqdG+F sg6uOHatTu9tZJGgt+IWRM3NEKaWHRqrnfZEsLF7xaQ82avxPWzXkSn5oGTQIrYIAkfV g9R91E7zt8kjdejE0Bs4QR/ZVGNFzfP+7s2K6zfGd/MJkUrxcGMyxZCpJi3nBz6UCkzh W+Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=/7SaxbrAKYy5nHjPeP6rKPzhr5cf0KgWZreybqQSSK0=; b=K5b0h2c/FjKdBjZ9K3Ag9kwc5rJk4DSxgsMqEBwI7Sz6axBoq30hS8hn1/+y9ro/IR NBydMi5O1eEtrRE04Y6EfUdZCInJYho/zaBIObRfiY/pQ74Zb32dprYJU8awnEpedEFK bak/iCXnq2ZAtfxvSz3imrV/2MkBpx84a/XLF2UqWutrAgNYMEM6gqs9lhahsQ10GEhb 6hVO7AANEXVIq26mBmxgGv3bXjVQa1KboN24QMltdTUh7vAXo71p/Z8d0Ay0Qan9/t43 RZ2UcUNIWoq1UZcg1QZWK7Pl1Gy5VYpFeF1NMnq6NI9JkYhQQi6goz4RdLTw0kTkGvZ7 n3Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vH4P23aR; 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 j11-20020a17090276cb00b0015d02c4c78esi1855231plt.487.2022.05.05.07.13.52; Thu, 05 May 2022 07:14:09 -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=vH4P23aR; 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 S229488AbiEDUVr (ORCPT + 99 others); Wed, 4 May 2022 16:21:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377951AbiEDUVn (ORCPT ); Wed, 4 May 2022 16:21:43 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C08854C418 for ; Wed, 4 May 2022 13:18:06 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id w19so4220868lfu.11 for ; Wed, 04 May 2022 13:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=/7SaxbrAKYy5nHjPeP6rKPzhr5cf0KgWZreybqQSSK0=; b=vH4P23aRILvPjXrFTf+PKSY5WZyteRVwqCQxiYPHQY4SnjhV5kTiBoIIHwMT3N3nzb n2gTDORYJZ3lIchUKu2QKuDBYZUJnTjm2A0iQh9tjc2GjceqpKx0eQcnQakbOeVlNKcP gYJElSdyE2lUs0EWGrRj5xbNIF9UK5mf3InKhQglmy2HC3/q9dDKE2ud97fB7Xt09juG ZQDZ5a0zyxlT7/vD1CAnIHMa4iRN96ujdZ+vj0ymSR8YEEY/gW2UKHA618uUEQpZBdmh wvrW4Ol5LienogN5JX72UVxYyEm465NfTwzhPyAZY2cSwFPw9PpzHH82RlAB68cPXKx2 l0kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=/7SaxbrAKYy5nHjPeP6rKPzhr5cf0KgWZreybqQSSK0=; b=k+puqyKyDy1daKOy5xTDNwiwKYkfbb4KymUJ0mG7tPc47VqWirJfc7xSbIipuJCvJK mJIFfDhjqkiIqonzMOSAJVj9cM813+IICbqVKiNNnKa4O9MG076HLv5NcARhl4WWTbXp XZsPPsUKW/DZ1FAfD4MRu00zsl60dGcneD6sWjIcRrriLifmrs+f6FJheiWDw8e1lS2e pmnLLSU/0huNdQGez6tu0SmuGXyJjg+qKpurAl1zllhK4zQQdkafNh6zIQ7J5BK1qcSH nb0+cJAVeOQz0xF6R7+nGMPx10RLgoPbB6cbd7iK4yiux8f+N5dImd78aEP+JOo9qYwX 7wfw== X-Gm-Message-State: AOAM5300ZBrq6slcwd0dhlT6Y7OCkSZeKgI8PrncE5uCCqkF6nKMqdWO LNBAzjlw+N5iUO9vbMw4RsM48PTt25GiLQ== X-Received: by 2002:a05:6512:10c2:b0:473:b559:2016 with SMTP id k2-20020a05651210c200b00473b5592016mr4584359lfg.641.1651695485120; Wed, 04 May 2022 13:18:05 -0700 (PDT) Received: from jade (h-79-136-84-253.A175.priv.bahnhof.se. [79.136.84.253]) by smtp.gmail.com with ESMTPSA id h18-20020a05651c159200b0025052e35be2sm1064541ljq.130.2022.05.04.13.18.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 13:18:02 -0700 (PDT) Date: Wed, 4 May 2022 22:17:59 +0200 From: Jens Wiklander To: arm@kernel.org, soc@kernel.org Cc: Linux Kernel Mailing List , op-tee@lists.trustedfirmware.org Subject: [GIT PULL] OP-TEE RPC arg for v5.19 Message-ID: <20220504201759.GA180315@jade> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Hello arm-soc maintainers, Please pull these patches which improves performance when communicating with OP-TEE in the secure world. A cache of argument structs is implemented to minimize the number of alloc/free and possibly also register/unregister of these buffers in the secure world. This boosts the performance in particular in a FF-A configuration. It should also save a bit of shared memory since each multiple a physical page now can hold multiple argument structs, instead of one page per struct as it was before. The OP-TEE SMC ABI is also extended to pass an argument struct needed for RPC together with the primary argument struct, in a manner similar the OP-TEE FF-A ABI. Thanks, Jens The following changes since commit 3123109284176b1532874591f7c81f3837bbdc17: Linux 5.18-rc1 (2022-04-03 14:08:21 -0700) are available in the Git repository at: https://git.linaro.org/people/jens.wiklander/linux-tee.git tags/optee-rpc-arg-for-v5.19 for you to fetch changes up to 5b4018b959149eb5b5f3004fc0339674af67516b: optee: cache argument shared memory structs (2022-04-25 21:13:05 +0200) ---------------------------------------------------------------- OP-TEE RPC argument cache Adds caching of the OP-TEE argument structure used to pass request to secure world. This reduces quite a bit of unnecessary alloc/free and possibly switching back and forth to secure work in order to register the buffers in some configurations, most notably FF-A. ---------------------------------------------------------------- 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(-)