Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secure dmabuf support #101

Open
wants to merge 18 commits into
base: optee
Choose a base branch
from

Commits on Apr 4, 2022

  1. arm64: dt: Remove timer from mt8173 **not for mainline**

    From the commit below, the mt8173-evb failed to boot to console due to
    changes in the mt8173 device tree files.
    
      commit c0d6fe2
      Merge: b44a3d2 3e4dda7
      Author: Linus Torvalds <[email protected]>
      Date:   Tue Nov 10 15:06:26 2015 -0800
    
          Merge tag 'armsoc-dt' of
          git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
    
    Until properly solved, let's just remove the section in the device tree
    blob that causes this.
    
    Signed-off-by: Joakim Bech <[email protected]>
    Reviewed-by: Pascal Brand <[email protected]>
    jbech-linaro authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    c4773cd View commit details
    Browse the repository at this point in the history
  2. arm64: dt: OP-TEE for foundation-v8 **not for mainline**

    Configures foundation-v8 with OP-TEE.
    
    Signed-off-by: Jens Wiklander <[email protected]>
    [jf: rebase onto v5.9-rc7]
    Signed-off-by: Jerome Forissier <[email protected]>
    jenswi-linaro authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    45f9fc0 View commit details
    Browse the repository at this point in the history
  3. arm64: dt: OP-TEE for Juno **not for mainline**

    Configures Juno with OP-TEE.
    
    Reviewed-by: Pascal Brand <[email protected]>
    Signed-off-by: Jens Wiklander <[email protected]>
    [jf: rebase onto v5.9-rc7]
    Signed-off-by: Jerome Forissier <[email protected]>
    jenswi-linaro authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    eb0ec8c View commit details
    Browse the repository at this point in the history
  4. arm64: dt: Add no-map to the reserved-memory node for OP-TEE for foun…

    …dation-v8 **not for mainline**
    
    All the platforms that reserve memory for OP-TEE statically via the
    DT (i.e., not those that reserve it via UEFI or that patch the DT
    dynamically thanks to OP-TEE's CFG_DT option) have to mark it 'no-map'
    so that only the TEE driver may map it.
    
    Signed-off-by: Jens Wiklander <[email protected]>
    jenswi-linaro authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    eac59af View commit details
    Browse the repository at this point in the history
  5. arm64: dt: Add no-map to the reserved-memory node for OP-TEE for juno…

    … **not for mainline**
    
    All the platforms that reserve memory for OP-TEE statically via the
    DT (i.e., not those that reserve it via UEFI or that patch the DT
    dynamically thanks to OP-TEE's CFG_DT option) have to mark it 'no-map'
    so that only the TEE driver may map it.
    
    Signed-off-by: Jens Wiklander <[email protected]>
    jenswi-linaro authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    148262a View commit details
    Browse the repository at this point in the history
  6. arm64: dt: Add OP-TEE firmware to mt8173 **not for mainline**

    Signed-off-by: Joakim Bech <[email protected]>
    Reviewed-by: Pascal Brand <[email protected]>
    Reviewed-by: Jerome Forissier <[email protected]>
    jbech-linaro authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    56253d9 View commit details
    Browse the repository at this point in the history
  7. arm64: dts: hi3798cv200-poplar: memreserve for bootloader

    Reserve memory for bootloader purposes.
    
    Acked-by: Jerome Forissier <[email protected]>
    Signed-off-by: Igor Opaniuk <[email protected]>
    igoropaniuk authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    11248bc View commit details
    Browse the repository at this point in the history
  8. arm64: dts: hi3798cv200-poplar: add optee node

    Add optee node, so OP-TEE driver is probed properly.
    
    Acked-by: Jerome Forissier <[email protected]>
    Signed-off-by: Igor Opaniuk <[email protected]>
    igoropaniuk authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    b212910 View commit details
    Browse the repository at this point in the history
  9. ARM: dts: stm32: Define OP-TEE resources on stm32mp15 and enable on DK2

    Define OP-TEE firmware node for stm32mp15 based platforms. The node
    if disable by default.
    
    Enable the OP-TEE node and define OP-TEE reserved memory for
    stm32mp157c-dk2.
    
    Signed-off-by: Etienne Carriere <[email protected]>
    [jf: rebase onto v5.9]
    Signed-off-by: Jerome Forissier <[email protected]>
    etienne-lms authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    1eb611e View commit details
    Browse the repository at this point in the history
  10. Enable Microsoft fTPM driver on Arm Foundation v8 models.

    Signed-off-by: Javier Almansa Sobrino <[email protected]>
    Acked-by: Joakim Bech <[email protected]>
    Link: linaro-swg#85
    [jf: not currently intended for upstream; add link to PR]
    Signed-off-by: Jerome Forissier <[email protected]>
    javieralso-arm authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    29258f7 View commit details
    Browse the repository at this point in the history
  11. stm32mp157c-ev1.dts: Fix optee status to 'okay'

    The optee device status is disabled by default, change its status to 'okay'
    in the dts of the EV1 board
    
    Signed-off-by: Timothée Cercueil <[email protected]>
    [jf: rebase onto v5.17]
    Signed-off-by: Jerome Forissier <[email protected]>
    Timothée Cercueil authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    17edde0 View commit details
    Browse the repository at this point in the history
  12. arm: dts: define OP-TEE resources for STM32MP1 ED1 and EV1

    This change fixes EV1 configuration which lacked OP-TEE
    reserved memory. This change also makes ED1 board ready
    the host OP-TEE by enabling OP-TEE node and defining the
    OP-TEE reserved memory for that board. This change defines
    these resources in ED1 DTS file which is included in EV1 DTS
    file.
    
    Signed-off-by: Etienne Carriere <[email protected]>
    Acked-by: Jerome Forissier <[email protected]>
    [jf: rebase onto v5.17]
    Signed-off-by: Jerome Forissier <[email protected]>
    etienne-lms authored and jforissier committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    688e135 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2022

  1. ANDROID: dma-buf: heaps: Add deferred-free-helper library code

    This patch provides infrastructure for deferring buffer frees.
    
    This is a feature ION provided which when used with some form
    of a page pool, provides a nice performance boost in an
    allocation microbenchmark. The reason it helps is it allows the
    page-zeroing to be done out of the normal allocation/free path,
    and pushed off to a kthread.
    
    As not all heaps will find this useful, its implemented as
    a optional helper library that heaps can utilize.
    
    Cc: Daniel Vetter <[email protected]>
    Cc: Sumit Semwal <[email protected]>
    Cc: Liam Mark <[email protected]>
    Cc: Chris Goldsworthy <[email protected]>
    Cc: Laura Abbott <[email protected]>
    Cc: Brian Starkey <[email protected]>
    Cc: Hridya Valsaraju <[email protected]>
    Cc: Suren Baghdasaryan <[email protected]>
    Cc: Sandeep Patil <[email protected]>
    Cc: Daniel Mentz <[email protected]>
    Cc: Ørjan Eide <[email protected]>
    Cc: Robin Murphy <[email protected]>
    Cc: Ezequiel Garcia <[email protected]>
    Cc: Simon Ser <[email protected]>
    Cc: James Jones <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Signed-off-by: John Stultz <[email protected]>
    Bug: 168742043
    johnstultz-work authored and omasse-linaro committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    7927f02 View commit details
    Browse the repository at this point in the history
  2. ANDROID: dma-buf: heaps: Add a shrinker controlled page pool

    This patch adds a simple shrinker controlled page pool to the
    dmabuf heaps subsystem.
    
    This replaces the use of the networking page_pool, over concerns
    that the lack of a shrinker for that implementation may cause
    additional low-memory kills
    
    TODO: Take another pass at trying to unify this w/ the ttm pool
    
    Thoughts and feedback would be greatly appreciated!
    
    Cc: Sumit Semwal <[email protected]>
    Cc: Liam Mark <[email protected]>
    Cc: Laura Abbott <[email protected]>
    Cc: Brian Starkey <[email protected]>
    Cc: Hridya Valsaraju <[email protected]>
    Cc: Suren Baghdasaryan <[email protected]>
    Cc: Sandeep Patil <[email protected]>
    Cc: Daniel Mentz <[email protected]>
    Cc: Chris Goldsworthy <[email protected]>
    Cc: Ørjan Eide <[email protected]>
    Cc: Robin Murphy <[email protected]>
    Cc: Ezequiel Garcia <[email protected]>
    Cc: Simon Ser <[email protected]>
    Cc: James Jones <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Signed-off-by: Olivier Masse <[email protected]>
    Bug: 168742043
    johnstultz-work authored and omasse-linaro committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    5f8d693 View commit details
    Browse the repository at this point in the history
  3. dma-buf: heaps: add Linaro secure dmabuf heap support

    add Linaro secure heap bindings: linaro,secure-heap
    use genalloc to allocate/free buffer from buffer pool.
    buffer pool info is from dts.
    use sg_table instore the allocated memory info, the length of sg_table is 1.
    implement secure_heap_buf_ops to implement buffer share in difference device:
    1. Userspace passes this fd to all drivers it wants this buffer
    to share with: First the filedescriptor is converted to a &dma_buf using
    dma_buf_get(). Then the buffer is attached to the device using dma_buf_attach().
    2. Once the buffer is attached to all devices userspace can initiate DMA
    access to the shared buffer. In the kernel this is done by calling dma_buf_map_attachment()
    3. get sg_table with dma_buf_map_attachment in difference device.
    
    Signed-off-by: Olivier Masse <[email protected]>
    omasse-linaro committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    b7a3d9f View commit details
    Browse the repository at this point in the history
  4. dt-bindings: reserved-memory: add linaro,secure-heap

    DMABUF Reserved memory definition for OP-TEE SDP feaure.
    
    Signed-off-by: Olivier Masse <[email protected]>
    omasse-linaro committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    96e394d View commit details
    Browse the repository at this point in the history
  5. plat-hikey: Add linaro,secure-heap compatible

    Add DMABUF_HEAPS_SECURE in defconfig
    
    Signed-off-by: Olivier Masse <[email protected]>
    omasse-linaro committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    112e3e1 View commit details
    Browse the repository at this point in the history
  6. tee: new ioctl to a register tee_shm from a dmabuf file descriptor

    This change allows userland to create a tee_shm object that refers
    to a dmabuf reference.
    
    Userland provides a dmabuf file descriptor as buffer reference.
    The created tee_shm object exported as a brand new dmabuf reference
    used to provide a clean fd to userland. Userland shall closed this new
    fd to release the tee_shm object resources. The initial dmabuf resources
    are tracked independently through original dmabuf file descriptor.
    
    Once the buffer is registered and until it is released, TEE driver
    keeps a refcount on the registered dmabuf structure.
    
    This change only support dmabuf references that relates to physically
    contiguous memory buffers.
    
    New tee_shm flag to identify tee_shm objects built from a registered
    dmabuf: TEE_SHM_EXT_DMA_BUF. Such tee_shm structures are flagged both
    TEE_SHM_DMA_BUF and TEE_SHM_EXT_DMA_BUF.
    
    Co-Developed-by: Etienne Carriere <[email protected]>
    Signed-off-by: Olivier Masse <[email protected]>
    From: https://github.com/linaro-swg/linux.git
    (cherry picked from commit 41e21e5)
    etienne-lms authored and omasse-linaro committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    00093f6 View commit details
    Browse the repository at this point in the history