|
|
Log in / Subscribe / Register

Introduce DMA APIs to allocate and free TEE shared memory

From:  jeshwank <JESHWANTHKUMAR.NK-AT-amd.com>
To:  <thomas.lendacky-AT-amd.com>, <john.allen-AT-amd.com>, <herbert-AT-gondor.apana.org.au>, <davem-AT-davemloft.net>, <jens.wiklander-AT-linaro.org>, <sumit.garg-AT-linaro.org>, <jarkko.nikula-AT-linux.intel.com>, <mario.limonciello-AT-amd.com>, <linux-crypto-AT-vger.kernel.org>, <linux-kernel-AT-vger.kernel.org>, <op-tee-AT-lists.trustedfirmware.org>
Subject:  [PATCH 0/3] Introduce DMA APIs to allocate and free TEE shared memory
Date:  Wed, 25 Oct 2023 12:26:57 +0530
Message-ID:  <20231025065700.1556152-1-JESHWANTHKUMAR.NK@amd.com>
Cc:  <Mythri.Pandeshwarakrishna-AT-amd.com>, <Devaraj.Rangasamy-AT-amd.com>, <Rijo-john.Thomas-AT-amd.com>, <nimesh.easow-AT-amd.com>, <JESHWANTHKUMAR.NK-AT-amd.com>
Archive-link:  Article

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.

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



Copyright © 2023, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds