From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9746BC433F5 for ; Fri, 1 Oct 2021 09:37:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5ECEC61A08 for ; Fri, 1 Oct 2021 09:37:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5ECEC61A08 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k4KmH0/8v9G1iQEL1XN7uK8nkh8DVFbN2ZJSOCu1IUU=; b=S3+f6cdf+RMs/W D8QiOO09F1efUnZ0Ni9CSGoMzqvVVN9/WjZeL8yZYnGeF7yeAeUrPOYrBelXeiuF666mMd0hCZ4dl Vn/qkEJx4hdKwLjAmIB2RBjD4DqjhDCQLuMStcVxuNKUfUDROKefXZmRx021EiKtmVEFoOygjqcW7 835b3U/ooCx88xfiYUBOnKGH3ski/fOxPxlGurIbwst4zydrR0tpFn7Hq9NM8OM/PW0gWncV/TGbT HFSpUMuR+YckZ8Snp6TAsUWcoyJ6d79HbZLWfMyRc7JUlablcW2Y3m2ZBdxksA/mMS5ncHz35Fne1 +vGlFpGoqRBwvPOUA7aQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWEwe-00HGBM-BA; Fri, 01 Oct 2021 09:35:08 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWEwa-00HGA1-3H for linux-arm-kernel@lists.infradead.org; Fri, 01 Oct 2021 09:35:05 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B9491101E; Fri, 1 Oct 2021 02:35:00 -0700 (PDT) Received: from bogus (unknown [10.57.26.136]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4FFEC3F70D; Fri, 1 Oct 2021 02:34:58 -0700 (PDT) Date: Fri, 1 Oct 2021 10:34:24 +0100 From: Sudeep Holla To: Jens Wiklander Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, op-tee@lists.trustedfirmware.org, Sumit Garg , Marc Bonnici , Sudeep Holla , Jerome Forissier , sughosh.ganu@linaro.org Subject: Re: [PATCH v5 5/5] optee: add FF-A support Message-ID: <20211001093424.n4x34qp3ewbbijmc@bogus> References: <20210831072412.887565-1-jens.wiklander@linaro.org> <20210831072412.887565-6-jens.wiklander@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210831072412.887565-6-jens.wiklander@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211001_023504_270461_768D94DA X-CRM114-Status: GOOD ( 23.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Aug 31, 2021 at 09:24:12AM +0200, Jens Wiklander wrote: > Adds support for using FF-A [1] as transport to the OP-TEE driver. > > Introduces struct optee_msg_param_fmem which carries all information > needed when OP-TEE is calling FFA_MEM_RETRIEVE_REQ to get the shared > memory reference mapped by the hypervisor in S-EL2. Register usage is > also updated to include the information needed. > > The FF-A part of this driver is enabled if CONFIG_ARM_FFA_TRANSPORT is > enabled. > > [1] https://developer.arm.com/documentation/den0077/latest > Acked-by: Sumit Garg > Signed-off-by: Jens Wiklander > --- > drivers/tee/optee/Makefile | 3 +- > drivers/tee/optee/call.c | 13 +- > drivers/tee/optee/core.c | 16 +- > drivers/tee/optee/ffa_abi.c | 907 ++++++++++++++++++++++++++++++ > drivers/tee/optee/optee_ffa.h | 153 +++++ > drivers/tee/optee/optee_msg.h | 27 +- > drivers/tee/optee/optee_private.h | 43 +- > 7 files changed, 1148 insertions(+), 14 deletions(-) > create mode 100644 drivers/tee/optee/ffa_abi.c > create mode 100644 drivers/tee/optee/optee_ffa.h > > diff --git a/drivers/tee/optee/Makefile b/drivers/tee/optee/Makefile > index d4e4776d2dec..dbfd83d3c4ae 100644 > --- a/drivers/tee/optee/Makefile > +++ b/drivers/tee/optee/Makefile > @@ -7,7 +7,8 @@ optee-objs += supp.o > optee-objs += device.o > > optee-smc-abi-y = smc_abi.o > -optee-objs += $(optee-smc-abi-y) > +optee-ffa-abi-$(CONFIG_ARM_FFA_TRANSPORT) = ffa_abi.o > +optee-objs += $(optee-smc-abi-y) $(optee-ffa-abi-y) > This may not work when CONFIG_ARM_FFA_TRANSPORT=m, I don't have cleaner solution apart from having if else. [...] > diff --git a/drivers/tee/optee/optee_private.h b/drivers/tee/optee/optee_private.h > index ca0213e330b5..2593742364da 100644 > --- a/drivers/tee/optee/optee_private.h > +++ b/drivers/tee/optee/optee_private.h [...] > @@ -116,11 +127,13 @@ struct optee_ops { > * world > * @teedev: client device > * @smc: specific to SMC ABI > + * @ffa: specific to FF-A ABI > * @call_queue: queue of threads waiting to call @invoke_fn > * @wait_queue: queue of threads from secure world waiting for a > * secure world sync object > * @supp: supplicant synchronization struct for RPC to supplicant > * @pool: shared memory pool > + * @rpc_arg_count: If > 0 number of RPC parameters to make room for > * @scan_bus_done flag if device registation was already done. > * @scan_bus_wq workqueue to scan optee bus and register optee drivers > * @scan_bus_work workq to scan optee bus and register optee drivers > @@ -129,11 +142,17 @@ struct optee { > struct tee_device *supp_teedev; > struct tee_device *teedev; > const struct optee_ops *ops; > - struct optee_smc smc; > + union { > + struct optee_smc smc; > +#ifdef CONFIG_ARM_FFA_TRANSPORT I don't see a point in saving this especially that the definition is available always. Also helps the case when FFA is module. > + struct optee_ffa ffa; > +#endif > + }; > struct optee_call_queue call_queue; > struct optee_wait_queue wait_queue; > struct optee_supp supp; > struct tee_shm_pool *pool; > + unsigned int rpc_arg_count; > bool scan_bus_done; > struct workqueue_struct *scan_bus_wq; > struct work_struct scan_bus_work; > @@ -266,4 +285,12 @@ static inline void reg_pair_from_64(u32 *reg0, u32 *reg1, u64 val) > int optee_smc_abi_register(void); > void optee_smc_abi_unregister(void); > > +#ifdef CONFIG_ARM_FFA_TRANSPORT To support CONFIG_ARM_FFA_TRANSPORT=m this must be, #if IS_REACHABLE(CONFIG_ARM_FFA_TRANSPORT) -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel