18 Jan, 2021

7 commits

  • While 'uint' and 'ulong' are defined in , in Linux kernel
    code they're used far less often than 'unsigned int' and 'unsigned
    long'. So replace these types with the standard ones.

    In the process, remove some unnecessary casts to these types:

    - Don't cast to uint to print u32 or smaller with %u. It's not needed.

    - Don't cast to uint to print size_t; instead just use %zu.

    Change-Id: I53e405f9f40d8e935f1f68e0549125859ab78ca5
    Signed-off-by: Eric Biggers

    Eric Biggers
     
  • Linux kernel code conventionally uses u8, u16, u32, etc. instead of the
    stdint-style uint8_t, uint16_t, uint32_t, etc. So replace the
    stdint-style types with the Linux-style types.

    Don't make this change in arm_ffa.h or trusty-log.h, since there is a
    copy of these headers in non-Linux code, and there is a desire to keep
    the copies the same.

    Change-Id: I0a0239cbda9a32b004581e80e5d4420cee7ee429
    Signed-off-by: Eric Biggers

    Eric Biggers
     
  • This fixes several instances of the following checkpatch warning:

    WARNING: Missing or malformed SPDX-License-Identifier tag

    This doesn't change the actual licenses.

    Test: trusty/vendor/google/aosp/scripts/build.py qemu-generic-arm64-test-debug
    Change-Id: I611721ef5af4ead7a33e402b618ad5de1ffa730e
    Signed-off-by: Eric Biggers

    Eric Biggers
     
  • If trusty runs in an environment where it does not have access to all
    memory, any memory passed to trusty must be explicitly shared.

    Bug: 128698138
    Change-Id: I42c8acad0e77ab6e19c76ed1ee0777c9e091e023
    Signed-off-by: Arve Hjønnevåg

    Arve Hjønnevåg
     
  • Define memory attrributes and permissions passed to trusty. Also remove
    user permission as trusty has no need for it.

    Bug: 128698138
    Change-Id: I4d1f12220ae36d76eacf7a13b74cfd8cb3da8e8b
    Signed-off-by: Arve Hjønnevåg

    Arve Hjønnevåg
     
  • The current implementation only supports contiguous regions and uses the
    physical address as the id.

    includes: Remove trusty_call32_mem_buf

    It is no longer used.

    includes: Set dma_mask

    Set dma_mask to 48 bits. This is the current limit of our encoded page
    information. Allow sharing memory above 4GB with trusty on platforms
    where the default dma_mask is 32 bits.

    Bug: 128698138
    Change-Id: Ib0801a0d67032bdf35cea4c27e27663bf68b2aa1
    Signed-off-by: Arve Hjønnevåg
    Signed-off-by: Tri Vo

    Arve Hjønnevåg
     
  • trusty_encode_page_info - encodes page physical address, memory
    type and other attributes into architecture specific structure
    that can be parsed by secure side.

    trusty_call32_mem_buf - can be used by drivers to make
    specified smc call with physicaly contigues memory buffer as
    an argument. Memory buffer info in retrieved by trusty_encode_page_info
    and along with buffer size is encoded into series of 32-bit
    smc call parameters.

    Change-Id: Iae155c0eff0bb6269be1abbe53ee42f27a1c23f5
    Signed-off-by: Michael Ryleev

    Michael Ryleev