forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
druvers: tee: optee: Use arch_page_phys_get when MMU enabled
According to the description of z_mem_phys_addr it uses Z_MEM_VM_OFFSET to make a conversion from virtual to physical address. And these macros are intended for assembly, linker code, and static initializers. So when external libraries, such as PICOLIBC or NEWLIB_LIBC uses internal mappings for dynamic memory allocation z_mem_phys_addr may not work properly and return wrong physical address. We have met this problem when testing work with MBEDTLS to generate certificate using PKCS11 in libckteec. Mbedtls allocates buffer dynamically and ivokes tee command to request certificate from PKCS11 TA which should place result to the allocated buffer. The result is the MBEDTLS is used with minimal libc - then everything works fine. But when CONFIG_PICOLIBC or CONFIG_NEWLIB_LIBC is enabled - it returns empty buffer. This happens because z_mem_phys_addr returns incorrect physical address. Signed-off-by: Oleksii Moisieiev <[email protected]>
- Loading branch information
1 parent
4c65677
commit 311b9a8
Showing
3 changed files
with
39 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters