Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2566067rda; Wed, 25 Oct 2023 06:32:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3X4DtWN6HASV5wbu6kHwiNZxh8faWA631mDFPRhK9MoeIY0efnXYbbOIXP4s5Hrf9QyT+ X-Received: by 2002:a25:820e:0:b0:da0:8065:25d7 with SMTP id q14-20020a25820e000000b00da0806525d7mr183329ybk.7.1698240760691; Wed, 25 Oct 2023 06:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698240760; cv=none; d=google.com; s=arc-20160816; b=lAK3487gQtQkagcrlVHvwHYFoRHpUFqZni2+chmpjhSaUJTZPErNdvSK2fmkao5Hfn K1ydBZz4agDBvCzcfHKNxVESFihBXrV1owusK7oTOts4ojxqYJXygBiyKqNqohxxv0Ux HMu3z1DhMUwSMGVLpB79W7sc1Fmk5S2+5qf8tO24zeThh/34MGUJ9HJNGOP+RFSGvjP+ qkYdjV8SwGaaLYHlR7h05VPBlh0qRezYGOsqSycxDHVVIQeRXd7yHceMvcAXXROmpC11 y0lJzqnLjpQhXJA+pGD/PVdRmx3uBHD8NZGQiDZpFDY5AMqAhfSTqEEQ2JKecvYxtUuc HGeg== 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=ZDeLJegtyrSMQs47LqN+x1DHWKzJbsn6ZNyTsWNzhD0=; fh=Uhc8iamLKguZ/+0lTXqWZ58h7pdXs7u7QGmAheExEJI=; b=PjmzNoC3rdP8+/YwmymOzKhR2qGYvGI4Eo/0ImsxzaXmrmsPQeEZzJxEiqIE8a/I9b nbSbKQkwgc1s6TnIqNY8oyVp17w8gBEE0TMPVAzkvXsbAPdbn1QhbKaQ1PJjZHKtBVjg qTf12GjqA8nKaS+uPCJiwr3Enz1O/ZjbkYO9emN0Rime+JGIuCEuccGvkQ+X+Qcqm1Fy m2wbhvOJKMhEOB0ubf/r3oPWx61PrX1dhhXOogPBAsWMYtqkCaJRQThaUuIdFMIC4Am8 KD3BZouQJuVGWrFQ8KoAlgVVfPc6sTxDE6C4J7gN2pwYDhD2vMLPRSusWrCXXhnE0Hbw cipg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=poNHIo88; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s131-20020a257789000000b00d9ae5227250si11885906ybc.290.2023.10.25.06.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:32:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=poNHIo88; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F2C898092D8B; Wed, 25 Oct 2023 06:32:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235027AbjJYNcf (ORCPT + 99 others); Wed, 25 Oct 2023 09:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235021AbjJYNcV (ORCPT ); Wed, 25 Oct 2023 09:32:21 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 343F81BCB for ; Wed, 25 Oct 2023 06:31:44 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3af609c4dfeso3694283b6e.1 for ; Wed, 25 Oct 2023 06:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698240703; x=1698845503; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZDeLJegtyrSMQs47LqN+x1DHWKzJbsn6ZNyTsWNzhD0=; b=poNHIo88GlChypeADbhU097d9YMRUhAnPbjgvnE0pGsjh/3EOZExa9cUNtqNkh74Re lzicw6lgi0zMEAVLLes+BairaaUKEL9pO5LM8OqVsOV6CyATcRCKfMHU3HvfKmyfMHjb ZDIJIOD6nvLC0HtFU/tYmiZT/+SCYqDOQVP4f078GMr5X94KUo7s9Di4tsQcMTTUAckc J6VfAAPDCJIvvzI0OzAaDhu3Hr8lkSjOJuQ1o3Cuvb7nlswXhpbFNkR9nWLQvV0ekQgs 04dykbr7fGeESFkhwH7OupNg7jv9q2InCx5Gsei1iYyzxD03c4mNd8k/La7HczboVovX t0OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698240703; x=1698845503; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZDeLJegtyrSMQs47LqN+x1DHWKzJbsn6ZNyTsWNzhD0=; b=iP9TRZ71S2399Fw/lD1yXi/Zohr3hLbjY21ektjGPxNbqpTYqTom9NOGZhjTIHPxC5 +fjqLxfUKRei9i8fgmk/uq9vDpX06TYbJh1ucacG6/eRE7nRDUTsYrIxHuVXlnag4xTG gfAYzN+A4tdvvN1AJJIR8VhUgM2JFfrDh9rWi3aoO5IMzBrctLhkKcn+XiNKUGDh664/ 5zX7o/8vW77t/6I57x/LjPoERDZ+cdybztzL6UANtctumJf1kL1S1qTHO6sZLbmD7MYY 5GgCw/H+h+RHIXshj2dXEbF2VdAQFkSD1lZJi+n57bva9rsaMN1xjRhacTptiFK5GFeL lQEA== X-Gm-Message-State: AOJu0Yz59Y8znEEozVPoXqpeQ4MnctHd6Q8VCEjAUo3XsOnO9ZOJej9R g3JqNkHIbviBUXiuvBziRLMBNyVy4hSZun3qkZ8hkQ== X-Received: by 2002:a05:6808:aa3:b0:3ab:7f46:ecc5 with SMTP id r3-20020a0568080aa300b003ab7f46ecc5mr15434307oij.35.1698240703272; Wed, 25 Oct 2023 06:31:43 -0700 (PDT) MIME-Version: 1.0 References: <20231025065700.1556152-1-JESHWANTHKUMAR.NK@amd.com> In-Reply-To: <20231025065700.1556152-1-JESHWANTHKUMAR.NK@amd.com> From: Sumit Garg Date: Wed, 25 Oct 2023 19:01:31 +0530 Message-ID: Subject: Re: [PATCH 0/3] Introduce DMA APIs to allocate and free TEE shared memory To: jeshwank Cc: thomas.lendacky@amd.com, john.allen@amd.com, herbert@gondor.apana.org.au, davem@davemloft.net, jens.wiklander@linaro.org, jarkko.nikula@linux.intel.com, mario.limonciello@amd.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, op-tee@lists.trustedfirmware.org, Mythri.Pandeshwarakrishna@amd.com, Devaraj.Rangasamy@amd.com, Rijo-john.Thomas@amd.com, nimesh.easow@amd.com 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_BLOCKED, SPF_HELO_NONE,SPF_PASS 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-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 06:32:38 -0700 (PDT) Hi Jeshwank, On Wed, 25 Oct 2023 at 12:27, jeshwank wrote: > > From: Jeshwanth Kumar N K > > At present, the shared memory for TEE ring buffer, command buffer and > data buffer is allocated using get_free_pages(). The driver shares the > physical address of these buffers with PSP so that it can be mapped by > the Trusted OS. > > In this patch series we have replaced get_free_pages() with > dma_alloc_coherent() to allocate shared memory to cleanup the existing > allocation method. Thanks for putting this together but I can't find the reasoning behind this change neither in this commit message and nor in the patch descriptions. Care to explain why? -Sumit > > Rijo Thomas (3): > crypto: ccp - Add function to allocate and free memory using DMA APIs > crypto: ccp - Use psp_tee_alloc_buffer() and psp_tee_free_buffer() > tee: amdtee: Use psp_tee_alloc_buffer() and psp_tee_free_buffer() > > drivers/crypto/ccp/psp-dev.c | 3 + > drivers/crypto/ccp/tee-dev.c | 119 ++++++++++++++++++---------- > drivers/crypto/ccp/tee-dev.h | 11 +-- > drivers/tee/amdtee/amdtee_private.h | 18 ++--- > drivers/tee/amdtee/call.c | 74 ++++++++--------- > drivers/tee/amdtee/core.c | 72 ++++++++++------- > drivers/tee/amdtee/shm_pool.c | 21 ++--- > include/linux/psp-tee.h | 47 +++++++++++ > 8 files changed, 221 insertions(+), 144 deletions(-) > > -- > 2.25.1 >