gpoulios opened a new pull request, #16729:
URL: https://github.com/apache/nuttx/pull/16729

   ## Summary
   
   When the MMU is disabled (`CONFIG_ARCH_USE_MMU=n`) the data passed back and 
forth with the TEE needs to be synced from/to the cache, otherwise we get 
random data in either world.
   
   Fix this by cleaning before a call and invalidating after. This has to be 
done both on the optee msg arg, and the shm buffers therein. Cleaning and 
invalidating the page list used to describe non-contiguous shm buffers did not 
seem mandatory in my tests, but common sense says that it should be, so we do 
that too.
   
   This fix does not apply to the optee msg arg of the socket transport 
(optee_socket.c), as that one _should_ be handled by the socket send/recv 
methods. It does apply to all shm buffers though, regardless of transport.
   
   ## Impact
   
   Enables OP-TEE users (`CONFIG_DEV_OPTEE_*`) to run with 
`CONFIG_ARCH_USE_MMU=n`.
   
   Doesn't affect any other users.
   
   ## Testing
   
   Tested on an NXP i.MX93 EVK with a custom flat build config that has 
`CONFIG_ARCH_USE_MMU=n`:
   ```
   NuttShell (NSH)
   nsh> optee_gp
   INF [6] TEEC:main:164: Available devices:
   INF [6] TEEC:main:174:   d96a5b40-c3e5-21e3-8794-1002a5d5c61b
   INF [6] TEEC:main:174:   1619ec9c-18f9-48e3-889c-ed4ef567c806
   INF [6] TEEC:main:174:   f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to