Linux cryptographic layer development
 help / color / mirror / Atom feed
From: "NK, JESHWANTHKUMAR" <jeshwanthkumar.nk@amd.com>
To: Tom Lendacky <thomas.lendacky@amd.com>,
	Sumit Garg <sumit.garg@linaro.org>
Cc: 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,
	ray.huang@amd.com, stefano.stabellini@amd.com
Subject: Re: [PATCH 0/3] Introduce DMA APIs to allocate and free TEE shared memory
Date: Mon, 30 Oct 2023 11:51:06 +0530	[thread overview]
Message-ID: <f21143fb-91d2-4186-938e-0d147e32aa76@amd.com> (raw)
In-Reply-To: <b743d759-8f6b-b4f8-afc6-d8f11a5562ff@amd.com>

Hi Tom,

On 26-Oct-23 8:23 PM, Tom Lendacky wrote:
> On 10/26/23 05:30, NK, JESHWANTHKUMAR wrote:
>>
>> On 25-Oct-23 7:01 PM, Sumit Garg wrote:
>>> Hi Jeshwank,
>>>
>>> On Wed, 25 Oct 2023 at 12:27, jeshwank <JESHWANTHKUMAR.NK@amd.com> 
>>> wrote:
>>>> From: Jeshwanth Kumar N K <JESHWANTHKUMAR.NK@amd.com>
>>>>
>>>> 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
>> Hi Sumit,
>>
>> We see that there is an advantage in using dma_alloc_coherent() over 
>> get_free_pages(). The dma-ops associated with PSP PCIe device can be 
>> overridden. This capability will be helpful when we enable 
>> virtualization support. We plan to post a virtualization related 
>> patch in future.
>
> To be specific, you are referring to Xen virtualization support, 
> correct? Because I don't see how this works in a Qemu/KVM environment 
> where you would get a GPA and not an SPA.

The patch is not specific to Xen. We have verified it in Qemu/KVM and 
Xen PV mode. Support for Xen PVH mode will be added as a separate patch.

>
> If that is the case, you should clearly specify that. Also, this looks 
> like it should be introduced with the virtualization support that you 
> submit in the future and not before.

I will update the commit message in the next version of the patch series 
to include these details.

> Thanks,
> Tom
>
>>
>> Regards,
>>
>> Jeshwanth
>>
>>>
>>>> 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
>>>>

      reply	other threads:[~2023-10-30  6:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25  6:56 [PATCH 0/3] Introduce DMA APIs to allocate and free TEE shared memory jeshwank
2023-10-25  6:56 ` [PATCH 1/3] crypto: ccp - Add function to allocate and free memory using DMA APIs jeshwank
2023-10-27  5:24   ` Christoph Hellwig
2023-10-30  6:05     ` NK, JESHWANTHKUMAR
     [not found]     ` <94059f5c-10dd-4d75-a69c-76b21ff49546@amd.com>
2023-10-30 13:33       ` Christoph Hellwig
2023-11-01 14:12         ` NK, JESHWANTHKUMAR
2023-10-25  6:56 ` [PATCH 2/3] crypto: ccp - Use psp_tee_alloc_buffer() and psp_tee_free_buffer() jeshwank
2023-10-25 21:26   ` kernel test robot
2023-10-25  6:57 ` [PATCH 3/3] tee: amdtee: " jeshwank
2023-10-25 13:31 ` [PATCH 0/3] Introduce DMA APIs to allocate and free TEE shared memory Sumit Garg
2023-10-26 10:30   ` NK, JESHWANTHKUMAR
2023-10-26 14:53     ` Tom Lendacky
2023-10-30  6:21       ` NK, JESHWANTHKUMAR [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f21143fb-91d2-4186-938e-0d147e32aa76@amd.com \
    --to=jeshwanthkumar.nk@amd.com \
    --cc=Devaraj.Rangasamy@amd.com \
    --cc=Mythri.Pandeshwarakrishna@amd.com \
    --cc=Rijo-john.Thomas@amd.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jens.wiklander@linaro.org \
    --cc=john.allen@amd.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=nimesh.easow@amd.com \
    --cc=op-tee@lists.trustedfirmware.org \
    --cc=ray.huang@amd.com \
    --cc=stefano.stabellini@amd.com \
    --cc=sumit.garg@linaro.org \
    --cc=thomas.lendacky@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox