History log of /optee_os/lib/ (Results 101 – 125 of 882)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
3afba46906-Oct-2023 Clement Faure <clement.faure@nxp.com>

core: pta: imx: fix typo DEK blob command

The PTA command had the manufacturing protection prefix instead of the
DEK blob prefix.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Acked-by: Jero

core: pta: imx: fix typo DEK blob command

The PTA command had the manufacturing protection prefix instead of the
DEK blob prefix.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>

show more ...

ce56605a22-Sep-2023 Sichun Qin <sichun.qin@amlogic.com>

core: support fault mitigations in non-threaded code

Fault mitigation won't work in non-threaded code due to the following
error:
assertion 'ct >= 0 && ct < CFG_NUM_THREADS' failed at core/arch/arm/

core: support fault mitigations in non-threaded code

Fault mitigation won't work in non-threaded code due to the following
error:
assertion 'ct >= 0 && ct < CFG_NUM_THREADS' failed at core/arch/arm/kernel
/thread.c:799 <thread_get_id>

The problem is in __ftmn_get_tsd_func_arg_pp which calls thread_get_tsd
which thread_get_id. The reason is that the interrupt handler is not
associated with any thread, so the ct (current_thread_id) value is -1 which
would cause an assert problem.

The fix is to add ftmn_arg to thread_core_local and the new variable would
be used when the current thread is < 0.

Signed-off-by: Sichun Qin <sichun.qin@amlogic.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


/optee_os/core/arch/arm/arm.mk
/optee_os/core/arch/arm/include/kernel/secure_partition.h
/optee_os/core/arch/arm/include/kernel/thread_arch.h
/optee_os/core/arch/arm/kernel/boot.c
/optee_os/core/arch/arm/kernel/entry_a64.S
/optee_os/core/arch/arm/kernel/secure_partition.c
/optee_os/core/arch/arm/plat-imx/imx-regs.h
/optee_os/core/arch/arm/plat-imx/imx.h
/optee_os/core/arch/arm/plat-imx/registers/imx6.h
/optee_os/core/arch/arm/plat-imx/registers/imx7.h
/optee_os/core/arch/arm/plat-imx/sub.mk
/optee_os/core/arch/arm/plat-k3/conf.mk
/optee_os/core/arch/arm/plat-zynqmp/platform_config.h
/optee_os/core/arch/riscv/include/kernel/thread_arch.h
/optee_os/core/arch/riscv/include/kernel/thread_private_arch.h
/optee_os/core/arch/riscv/include/tee/entry_fast.h
/optee_os/core/arch/riscv/include/tee/optee_abi.h
/optee_os/core/arch/riscv/include/tee/teeabi_opteed.h
/optee_os/core/arch/riscv/include/tee/teeabi_opteed_macros.h
/optee_os/core/arch/riscv/kernel/sub.mk
/optee_os/core/arch/riscv/kernel/thread_arch.c
/optee_os/core/arch/riscv/kernel/thread_optee_abi.c
/optee_os/core/arch/riscv/kernel/thread_optee_abi_rv.S
/optee_os/core/arch/riscv/kernel/thread_rv.S
/optee_os/core/arch/riscv/tee/entry_fast.c
/optee_os/core/arch/riscv/tee/sub.mk
/optee_os/core/drivers/imx_snvs.c
/optee_os/core/drivers/pm/imx/gpcv2.c
/optee_os/core/drivers/pm/imx/local.h
/optee_os/core/drivers/pm/imx/psci.c
/optee_os/core/drivers/pm/imx/src.c
/optee_os/core/drivers/pm/imx/sub.mk
/optee_os/core/drivers/pm/sub.mk
/optee_os/core/include/drivers/imx_snvs.h
/optee_os/core/include/kernel/nv_counter.h
/optee_os/core/include/mm/core_mmu.h
/optee_os/core/include/tee/fs_dirfile.h
/optee_os/core/include/tee/fs_htree.h
/optee_os/core/kernel/nv_counter.c
/optee_os/core/kernel/sub.mk
/optee_os/core/kernel/tpm.c
/optee_os/core/mm/core_mmu.c
/optee_os/core/pta/stats.c
/optee_os/core/pta/tests/fs_htree.c
/optee_os/core/tee/fs_dirfile.c
/optee_os/core/tee/fs_htree.c
/optee_os/core/tee/tee_ree_fs.c
libutils/ext/include/fault_mitigation.h
/optee_os/mk/config.mk
/optee_os/scripts/sign_rproc_fw.py
b952639213-Sep-2023 Jens Wiklander <jens.wiklander@linaro.org>

libutils: add runtime_assert()

Adds runtime_assert() as a version of assert() that can be used instead
of assert() when evaluating constant expressions to avoid the warning:
error: function might be

libutils: add runtime_assert()

Adds runtime_assert() as a version of assert() that can be used instead
of assert() when evaluating constant expressions to avoid the warning:
error: function might be candidate for attribute ‘noreturn’

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Leisen <leisen1@huawei.com>
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...

44ce4e4002-Jun-2023 Clement Faure <clement.faure@nxp.com>

core: pta: imx: add DEK blob

Add DEK blob PTA to generate CAAM DEK blobs.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>


/optee_os/MAINTAINERS
/optee_os/core/arch/arm/include/arm64.h
/optee_os/core/arch/arm/kernel/secure_partition.c
/optee_os/core/arch/arm/kernel/spmc_sp_handler.c
/optee_os/core/arch/arm/plat-imx/registers/imx8m.h
/optee_os/core/arch/riscv/plat-spike/platform_config.h
/optee_os/core/drivers/clk/clk_dt.c
/optee_os/core/drivers/crypto/caam/blob/caam_dek.c
/optee_os/core/drivers/crypto/caam/blob/sub.mk
/optee_os/core/drivers/crypto/caam/caam_ctrl.c
/optee_os/core/drivers/crypto/caam/caam_sm.c
/optee_os/core/drivers/crypto/caam/crypto.mk
/optee_os/core/drivers/crypto/caam/hal/common/hal_ctrl.c
/optee_os/core/drivers/crypto/caam/hal/common/hal_sm.c
/optee_os/core/drivers/crypto/caam/hal/common/registers/sm_regs.h
/optee_os/core/drivers/crypto/caam/hal/common/sub.mk
/optee_os/core/drivers/crypto/caam/hal/imx_8m/registers/ctrl_regs.h
/optee_os/core/drivers/crypto/caam/include/caam_desc_defines.h
/optee_os/core/drivers/crypto/caam/include/caam_desc_helper.h
/optee_os/core/drivers/crypto/caam/include/caam_hal_ctrl.h
/optee_os/core/drivers/crypto/caam/include/caam_hal_sm.h
/optee_os/core/drivers/crypto/caam/include/caam_sm.h
/optee_os/core/drivers/crypto/caam/include/caam_trace.h
/optee_os/core/drivers/crypto/caam/sub.mk
/optee_os/core/drivers/crypto/caam/utils/utils_dmaobj.c
/optee_os/core/include/drivers/caam_extension.h
/optee_os/core/include/kernel/embedded_ts.h
/optee_os/core/include/kernel/tee_ta_manager.h
/optee_os/core/include/kernel/ts_manager.h
/optee_os/core/include/kernel/ts_store.h
/optee_os/core/include/kernel/user_access.h
/optee_os/core/include/tee/tadb.h
/optee_os/core/kernel/dt_driver.c
/optee_os/core/kernel/embedded_ts.c
/optee_os/core/kernel/ldelf_loader.c
/optee_os/core/kernel/ldelf_syscalls.c
/optee_os/core/kernel/ree_fs_ta.c
/optee_os/core/kernel/scall.c
/optee_os/core/kernel/secstor_ta.c
/optee_os/core/kernel/tee_ta_manager.c
/optee_os/core/kernel/user_access.c
/optee_os/core/kernel/user_ta.c
/optee_os/core/mm/vm.c
/optee_os/core/pta/imx/dek_blob.c
/optee_os/core/pta/imx/manufacturing_protection.c
/optee_os/core/pta/imx/sub.mk
/optee_os/core/pta/system.c
/optee_os/core/tee/sub.mk
/optee_os/core/tee/tadb.c
/optee_os/core/tee/tee_svc.c
/optee_os/core/tee/tee_svc_cryp.c
/optee_os/core/tee/tee_svc_storage.c
libutee/include/pta_imx_dek_blob.h
/optee_os/mk/config.mk
/optee_os/scripts/sign_rproc_fw.py
/optee_os/ta/pkcs11/include/pkcs11_ta.h
/optee_os/ta/pkcs11/src/attributes.c
/optee_os/ta/pkcs11/src/object.c
/optee_os/ta/pkcs11/src/pkcs11_attributes.c
/optee_os/ta/pkcs11/src/pkcs11_attributes.h
/optee_os/ta/pkcs11/src/pkcs11_helpers.c
/optee_os/ta/pkcs11/src/processing_ec.c
/optee_os/ta/ta.mk
7bd4f9b201-Sep-2023 Jens Wiklander <jens.wiklander@linaro.org>

libutils: mempool: fix unbalanced put_pool()

Prior to this patch mempool_free() unconditionally called put_pool(),
but if the "ptr" argument is NULL it means that there hasn't been a
corresponding c

libutils: mempool: fix unbalanced put_pool()

Prior to this patch mempool_free() unconditionally called put_pool(),
but if the "ptr" argument is NULL it means that there hasn't been a
corresponding call to get_pool(). Fix this only calling put_pool() for
non-NULL pointers.

Fixes: a51d45b52503 ("libutils: mempool based raw malloc functions")
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>

show more ...

567dbd8129-Aug-2023 loubaihui <loubaihui1@huawei.com>

crypto: change TEE_MAIN_ALGO_X448 value to 0x49

Change the value of TEE_MAIN_ALGO_X448 to 0x49 so that
TEE_ALG_GET_KEY_TYPE(TEE_ALG_X448, true) == TEE_TYPE_X448_KEYPAIR and
TEE_ALG_GET_KEY_TYPE(TEE_

crypto: change TEE_MAIN_ALGO_X448 value to 0x49

Change the value of TEE_MAIN_ALGO_X448 to 0x49 so that
TEE_ALG_GET_KEY_TYPE(TEE_ALG_X448, true) == TEE_TYPE_X448_KEYPAIR and
TEE_ALG_GET_KEY_TYPE(TEE_ALG_X448, false) == TEE_TYPE_X448_PUBLIC_KEY.

Signed-off-by: loubaihui <loubaihui1@huawei.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...

2a8dfb4523-Aug-2023 Jerome Forissier <jerome.forissier@linaro.org>

compiler.h: add __inhibit_loop_to_libcall

Introduce __inhibit_loop_to_libcall which allows to disable a specific
compiler optimization that detects and replaces some open coded loops
with standard l

compiler.h: add __inhibit_loop_to_libcall

Introduce __inhibit_loop_to_libcall which allows to disable a specific
compiler optimization that detects and replaces some open coded loops
with standard library calls (typically: memcpy() and memset()).

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...

7ed603a023-Aug-2023 Jerome Forissier <jerome.forissier@linaro.org>

libutils: asan: raw_realloc(): use unchecked memset() and memcpy()

When raw_realloc() invokes memset() and memcpy() the destination buffer
is not yet tagged for ASAN. Therefore use the unchecked ver

libutils: asan: raw_realloc(): use unchecked memset() and memcpy()

When raw_realloc() invokes memset() and memcpy() the destination buffer
is not yet tagged for ASAN. Therefore use the unchecked versions of
these functions.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...

4d6266da22-Aug-2023 Clement Faure <clement.faure@nxp.com>

lib: libutee: initialize variables in TEE_GetPropertyAsString()

Initialize local variables at declaration as specified by the coding
guidelines.

Signed-off-by: Clement Faure <clement.faure@nxp.com>

lib: libutee: initialize variables in TEE_GetPropertyAsString()

Initialize local variables at declaration as specified by the coding
guidelines.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...

a1f2c43024-Jul-2023 Clement Faure <clement.faure@nxp.com>

lib: libutee: initialize TA property type

TA property type `type` is declared without being initialized and might
be used in the if statement uninitialized.

Signed-off-by: Clement Faure <clement.fa

lib: libutee: initialize TA property type

TA property type `type` is declared without being initialized and might
be used in the if statement uninitialized.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...

09a77c9824-Jul-2023 Clement Faure <clement.faure@nxp.com>

lib: libutee: fix use after free

Make sure to call addr_is_in_no_share_heap() before the freeing buffer.
This is a false positive as only the pointer value is used and not the
memory freed.

Signed-

lib: libutee: fix use after free

Make sure to call addr_is_in_no_share_heap() before the freeing buffer.
This is a false positive as only the pointer value is used and not the
memory freed.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


/optee_os/.github/workflows/ci.yml
/optee_os/CHANGELOG.md
/optee_os/core/arch/arm/include/arm.h
/optee_os/core/arch/arm/include/arm64.h
/optee_os/core/arch/arm/include/kernel/thread_private_arch.h
/optee_os/core/arch/arm/kernel/abort.c
/optee_os/core/arch/arm/kernel/stmm_sp.c
/optee_os/core/arch/arm/kernel/thread.c
/optee_os/core/arch/arm/kernel/thread_optee_smc_a64.S
/optee_os/core/arch/arm/kernel/thread_spmc_a64.S
/optee_os/core/arch/arm/plat-bcm/conf.mk
/optee_os/core/arch/arm/plat-ls/main.c
/optee_os/core/arch/arm/plat-nuvoton/conf.mk
/optee_os/core/arch/arm/plat-nuvoton/main.c
/optee_os/core/arch/arm/plat-stm32mp1/conf.mk
/optee_os/core/arch/arm/plat-stm32mp1/main.c
/optee_os/core/arch/arm/plat-versal/main.c
/optee_os/core/drivers/crypto/caam/mp/caam_mp.c
/optee_os/core/drivers/crypto/caam/utils/utils_dmaobj.c
/optee_os/core/drivers/crypto/crypto_api/acipher/dh.c
/optee_os/core/drivers/crypto/crypto_api/acipher/rsamgf.c
/optee_os/core/drivers/crypto/crypto_api/include/drvcrypt_acipher.h
/optee_os/core/drivers/crypto/se050/core/storage.c
/optee_os/core/drivers/crypto/stm32/authenc.c
/optee_os/core/drivers/crypto/stm32/cipher.c
/optee_os/core/drivers/crypto/stm32/common.h
/optee_os/core/drivers/crypto/stm32/crypto.mk
/optee_os/core/drivers/crypto/stm32/stm32_cryp.c
/optee_os/core/drivers/crypto/stm32/stm32_saes.c
/optee_os/core/drivers/crypto/stm32/stm32_saes.h
/optee_os/core/drivers/crypto/stm32/sub.mk
/optee_os/core/drivers/imx/mu/imx_mu.c
/optee_os/core/drivers/imx/mu/imx_mu_8q.c
/optee_os/core/drivers/imx/mu/imx_mu_8ulp.c
/optee_os/core/drivers/imx/mu/imx_mu_platform.h
/optee_os/core/drivers/ls_dspi.c
/optee_os/core/drivers/ls_sfp.c
/optee_os/core/include/drivers/ls_dspi.h
/optee_os/core/include/kernel/huk_subkey.h
/optee_os/core/include/kernel/pseudo_ta.h
/optee_os/core/include/kernel/user_access.h
/optee_os/core/include/tee/fs_dirfile.h
/optee_os/core/include/tee/tee_fs.h
/optee_os/core/include/tee/tee_supp_plugin_rpc.h
/optee_os/core/kernel/huk_subkey.c
/optee_os/core/kernel/ldelf_loader.c
/optee_os/core/kernel/pseudo_ta.c
/optee_os/core/kernel/ree_fs_ta.c
/optee_os/core/kernel/user_access.c
/optee_os/core/lib/scmi-server/conf-optee-fvp.mk
/optee_os/core/lib/scmi-server/sub.mk
/optee_os/core/pta/attestation.c
/optee_os/core/pta/system.c
/optee_os/core/tee/fs_dirfile.c
/optee_os/core/tee/socket.c
/optee_os/core/tee/tadb.c
/optee_os/core/tee/tee_ree_fs.c
/optee_os/core/tee/tee_rpmb_fs.c
/optee_os/core/tee/tee_supp_plugin_rpc.c
/optee_os/core/tee/tee_svc_storage.c
libutee/tee_api.c
9c4d095517-Jul-2023 loubaihui <loubaihui1@huawei.com>

crypto: add drvcrypt_register_x25519() and drvcrypt_register_x448()

Add X25519 and X448 drvcrypt.

Signed-off-by: loubaihui <loubaihui1@huawei.com>
Acked-by: Jerome Forissier <jerome.forissier@linar

crypto: add drvcrypt_register_x25519() and drvcrypt_register_x448()

Add X25519 and X448 drvcrypt.

Signed-off-by: loubaihui <loubaihui1@huawei.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...

34ce35b114-Jul-2023 loubaihui <loubaihui1@huawei.com>

crypto: add X448 support

Refer to the X25519 algorithm, add the X448 algorithm framework code.

Signed-off-by: loubaihui <loubaihui1@huawei.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.o

crypto: add X448 support

Refer to the X25519 algorithm, add the X448 algorithm framework code.

Signed-off-by: loubaihui <loubaihui1@huawei.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


/optee_os/core/arch/arm/include/arm64.h
/optee_os/core/arch/arm/kernel/boot.c
/optee_os/core/arch/arm/kernel/spmc_sp_handler.c
/optee_os/core/arch/arm/plat-aspeed/platform_ast2600.c
/optee_os/core/arch/arm/plat-aspeed/platform_ast2700.c
/optee_os/core/arch/arm/plat-bcm/main.c
/optee_os/core/arch/arm/plat-corstone1000/main.c
/optee_os/core/arch/arm/plat-imx/main.c
/optee_os/core/arch/arm/plat-imx/pm/cpuidle-imx7d.c
/optee_os/core/arch/arm/plat-imx/pm/imx7_suspend.c
/optee_os/core/arch/arm/plat-k3/main.c
/optee_os/core/arch/arm/plat-ls/main.c
/optee_os/core/arch/arm/plat-marvell/main.c
/optee_os/core/arch/arm/plat-mediatek/main.c
/optee_os/core/arch/arm/plat-nuvoton/main.c
/optee_os/core/arch/arm/plat-rcar/main.c
/optee_os/core/arch/arm/plat-rockchip/main.c
/optee_os/core/arch/arm/plat-rzn1/main.c
/optee_os/core/arch/arm/plat-sam/freq.c
/optee_os/core/arch/arm/plat-sam/main.c
/optee_os/core/arch/arm/plat-sprd/main.c
/optee_os/core/arch/arm/plat-stm/main.c
/optee_os/core/arch/arm/plat-stm32mp1/conf.mk
/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.c
/optee_os/core/arch/arm/plat-stm32mp1/main.c
/optee_os/core/arch/arm/plat-stm32mp1/shared_resources.c
/optee_os/core/arch/arm/plat-stm32mp1/stm32_util.h
/optee_os/core/arch/arm/plat-sunxi/main.c
/optee_os/core/arch/arm/plat-synquacer/main.c
/optee_os/core/arch/arm/plat-ti/a9_plat_init.S
/optee_os/core/arch/arm/plat-ti/main.c
/optee_os/core/arch/arm/plat-totalcompute/main.c
/optee_os/core/arch/arm/plat-uniphier/main.c
/optee_os/core/arch/arm/plat-versal/main.c
/optee_os/core/arch/arm/plat-vexpress/main.c
/optee_os/core/arch/arm/plat-zynq7k/main.c
/optee_os/core/arch/arm/plat-zynqmp/main.c
/optee_os/core/arch/riscv/include/mm/core_mmu_arch.h
/optee_os/core/arch/riscv/kernel/asm-defines.c
/optee_os/core/arch/riscv/kernel/boot.c
/optee_os/core/arch/riscv/kernel/entry.S
/optee_os/core/arch/riscv/mm/core_mmu_arch.c
/optee_os/core/arch/riscv/mm/sub.mk
/optee_os/core/crypto/crypto.c
/optee_os/core/drivers/clk/clk_dt.c
/optee_os/core/drivers/crypto/caam/cipher/caam_cipher_mac.c
/optee_os/core/drivers/crypto/caam/hal/common/hal_cfg.c
/optee_os/core/drivers/crypto/se050/glue/i2c_stm32.c
/optee_os/core/drivers/plic.c
/optee_os/core/drivers/stm32_bsec.c
/optee_os/core/drivers/stm32_gpio.c
/optee_os/core/drivers/stm32_i2c.c
/optee_os/core/drivers/stm32_uart.c
/optee_os/core/drivers/stm32mp15_huk.c
/optee_os/core/drivers/sub.mk
/optee_os/core/include/crypto/crypto.h
/optee_os/core/include/drivers/plic.h
/optee_os/core/include/drivers/stm32_bsec.h
/optee_os/core/include/drivers/stm32_gpio.h
/optee_os/core/include/drivers/stm32_i2c.h
/optee_os/core/include/drivers/stm32_uart.h
/optee_os/core/include/kernel/boot.h
/optee_os/core/include/kernel/dt.h
/optee_os/core/kernel/dt.c
/optee_os/core/kernel/ldelf_loader.c
/optee_os/core/kernel/user_ta.c
/optee_os/core/lib/libtomcrypt/x25519.c
/optee_os/core/tee/tee_svc_cryp.c
libutee/include/utee_defines.h
/optee_os/mk/aosp_optee.mk
/optee_os/ta/pkcs11/src/pkcs11_attributes.c
546e296f04-Jul-2023 Jens Wiklander <jens.wiklander@linaro.org>

libutils: add {high,low}32_from_64() helper

Adds two helper functions high32_from_64() and low32_from_64() used for
retrieving the upper and lower halves of a uint64_t.

Signed-off-by: Jens Wiklande

libutils: add {high,low}32_from_64() helper

Adds two helper functions high32_from_64() and low32_from_64() used for
retrieving the upper and lower halves of a uint64_t.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...

e2ec831c03-Jul-2023 Jihwan Park <jihwp@amazon.com>

core: crypto_bignum_free(): add indirection and set pointer to NULL

To prevent human mistake, crypto_bignum_free() sets the location of the
bignum pointer to NULL after freeing it.

Signed-off-by: J

core: crypto_bignum_free(): add indirection and set pointer to NULL

To prevent human mistake, crypto_bignum_free() sets the location of the
bignum pointer to NULL after freeing it.

Signed-off-by: Jihwan Park <jihwp@amazon.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...

5c2c0fb314-Jun-2023 Jerome Forissier <jerome.forissier@linaro.org>

ftrace: change implementation to use binary circular buffer

The current implementation of function tracing (CFG_FTRACE_SUPPORT)
produces human-readable text into the output buffer that is passed to

ftrace: change implementation to use binary circular buffer

The current implementation of function tracing (CFG_FTRACE_SUPPORT)
produces human-readable text into the output buffer that is passed to
tee-supplicant and ultimately saved to the Linux filesystem. Two main
issues with that:

1. The string formatting code is somewhat complex. It introduces
significant overhead in the execution time of the instrumented
functions.
2. The various policies about how to handle a buffer full condition
(CFG_FTRACE_BUF_WHEN_FULL) are not very convenient. In particular,
"shift" is typically the most desirable option because it always
keeps the most recent entries, but it is very inefficient to the
point of not being usable in practice.

This commit addresses the above concerns by making the ftrace buffer
circular one, each entry being 64-bit value. The formatting code is
offloaded to a new Python script: scripts/ftrace_format.py. The
output is unchanged except for an added field showing the current
depth in the call stack.

Typical usage (captured on QEMUv8):

build$ mkdir -p ../tmp
build$ chmod a+w ../tmp
build$ make CFG_FTRACE_SUPPORT=y CFG_FTRACE_BUF_SIZE=15000 \
CFG_TA_MCOUNT=y CFG_ULIBS_MCOUNT=y CFG_SYSCALL_FTRACE=y \
QEMU_VIRTFS_AUTOMOUNT=y run
$ xtest regression_1004
...
$ cp /tmp/ftrace-cb3e5ba0-adf1-11e0-998b-0002a5d5c51b.out /mnt/host/tmp
build$ cd ..
optee$ optee_os/scripts/ftrace_format.py \
tmp/ftrace-cb3e5ba0-adf1-11e0-998b-0002a5d5c51b.out |
optee_os/scripts/symbolize.py \
-d optee_os/out/arm/core \
-d out-br/build/optee_test_ext-1.0/ta/*/out | less
TEE load address @ 0x5ab04000
Function graph for TA: cb3e5ba0-adf1-11e0-998b-0002a5d5c51b @ 80085000
| 1 | __ta_entry() {
| 2 | __utee_entry() {
43.840 us | 3 | ta_header_get_session()
7.216 us | 3 | tahead_get_trace_level()
14.480 us | 3 | trace_set_level()
| 3 | malloc_add_pool() {
| 4 | raw_malloc_add_pool() {
46.032 us | 5 | bpool()
| 5 | raw_realloc() {
166.256 us | 6 | bget()
23.056 us | 6 | raw_malloc_return_hook()
267.952 us | 5 | }
398.720 us | 4 | }
426.992 us | 3 | }
| 3 | TEE_GetPropertyAsU32() {
23.600 us | 4 | is_propset_pseudo_handle()
| 4 | __utee_check_instring_annotation() {
26.416 us | 5 | strlen()
| 5 | check_access() {
| 6 | TEE_CheckMemoryAccessRights() {
| 7 | _utee_check_access_rights() {
| 8 | syscall_check_access_rights() {
| 9 | ts_get_current_session() {
4.304 us | 10 | ts_get_current_session_may_fail()
10.976 us | 9 | }
| 9 | to_user_ta_ctx() {
2.496 us | 10 | is_user_ta_ctx()
8.096 us | 9 | }
| 9 | vm_check_access_rights() {
| 10 | vm_buf_is_inside_um_private() {
| 11 | core_is_buffer_inside() {
...

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...

b59abd2320-Jun-2023 Alvin Chang <alvinga@andestech.com>

libutils: ftrace: Add definitions for separating architectural headers

Add definitions for separating architectural headers. In kernel mode,
risc-v may include riscv.h to have the timer related func

libutils: ftrace: Add definitions for separating architectural headers

Add definitions for separating architectural headers. In kernel mode,
risc-v may include riscv.h to have the timer related functions. In TA
libraries, risc-v may include riscv_user_sysreg.h to have those
functions.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com>

show more ...

53877f8420-Jun-2023 Alvin Chang <alvinga@andestech.com>

libutee: Implement RISC-V helper functions for TA libraries

To enable ftrace support in TA libraries, the timer related functions
should be implemented. Add riscv_user_sysreg.h which implements thes

libutee: Implement RISC-V helper functions for TA libraries

To enable ftrace support in TA libraries, the timer related functions
should be implemented. Add riscv_user_sysreg.h which implements these
functions for TA libraries. The code is referenced from core header and
the M-mode related code is removed.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com>

show more ...

bc12b0e920-Jun-2023 Alvin Chang <alvinga@andestech.com>

libutils: riscv: Update setjmp() and longjmp() for ftrace support

Fix the registers saving/restoring conventions. The length of jump
buffer is increased with one more slot to restore ftrace return s

libutils: riscv: Update setjmp() and longjmp() for ftrace support

Fix the registers saving/restoring conventions. The length of jump
buffer is increased with one more slot to restore ftrace return stack.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com>

show more ...

ae9b3ff920-Jun-2023 Alvin Chang <alvinga@andestech.com>

libutils: riscv: Implement _mount() and __ftrace_return()

When the core and TA are compiled with the -pg option, the compiler
inserts a call to _mcount() into every function prologue. It can be used

libutils: riscv: Implement _mount() and __ftrace_return()

When the core and TA are compiled with the -pg option, the compiler
inserts a call to _mcount() into every function prologue. It can be used
to trace the function calls such as ftrace.

Implement the _mount() to prepare the necessary parameters for ftrace.
The __ftrace_return() is also implemented for returning from ftrace.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com>

show more ...

97a70d2820-Jun-2023 Alvin Chang <alvinga@andestech.com>

libutils: Add riscv.S to make it available for core and TA libs

Some assembly macros are necessary for both OP-TEE core and TA
libraries. Therefore, we add riscv specific assembly file into libutils

libutils: Add riscv.S to make it available for core and TA libs

Some assembly macros are necessary for both OP-TEE core and TA
libraries. Therefore, we add riscv specific assembly file into libutils
and move some assembly related macros from riscv.h to riscv.S.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com>

show more ...

504f159419-Jun-2023 Vitor Sato Eschholz <vsatoes@baylibre.com>

libutils: malloc: fix raw_malloc_buffer_overlaps_heap()

When checking if there's an overlap between allocated buffer and
heap, raw_malloc_buffer_overlaps_heap() considers two cases: when
buffer come

libutils: malloc: fix raw_malloc_buffer_overlaps_heap()

When checking if there's an overlap between allocated buffer and
heap, raw_malloc_buffer_overlaps_heap() considers two cases: when
buffer comes before the pool and the opposite. On the first case,
overlap will happen if the buffer end after the loop start.
Since buf_end is computed as buf_start + len, it will point to
the address of the first byte after the memory region allocated to
the buffer.

Fix raw_malloc_buffer_overlaps_heap() by considering overlap only
when buffer end is bigger than the pool start.

Fixes: 12d739bd5028 ("libutils: use raw_malloc_*() as more primitive bget wrappers")
Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...

e2eade3602-Jun-2023 Alvin Chang <alvinga@andestech.com>

libutee: riscv: Fix the arguments of __utee_panic() for unwinding

To unwind stack from synchronous panic, the ra and s0(fp) registers
should be saved onto stack, and the a1 should be assigned as sp.

libutee: riscv: Fix the arguments of __utee_panic() for unwinding

To unwind stack from synchronous panic, the ra and s0(fp) registers
should be saved onto stack, and the a1 should be assigned as sp.
The save_panic_regs_rv_ta() can handle these registers for abort usage.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
Tested-by: Marouene Boubakri <marouene.boubakri@nxp.com>
Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com>

show more ...


/optee_os/MAINTAINERS
/optee_os/core/arch/arm/dts/stm32mp13-pinctrl.dtsi
/optee_os/core/arch/arm/dts/stm32mp131.dtsi
/optee_os/core/arch/arm/dts/stm32mp135.dtsi
/optee_os/core/arch/arm/dts/stm32mp135f-dk.dts
/optee_os/core/arch/arm/dts/stm32mp13xc.dtsi
/optee_os/core/arch/arm/dts/stm32mp13xf.dtsi
/optee_os/core/arch/arm/dts/stm32mp15-pinctrl.dtsi
/optee_os/core/arch/arm/include/arm64.h
/optee_os/core/arch/arm/include/ffa.h
/optee_os/core/arch/arm/include/kernel/secure_partition.h
/optee_os/core/arch/arm/include/kernel/tlb_helpers.h
/optee_os/core/arch/arm/include/mm/core_mmu_arch.h
/optee_os/core/arch/arm/kernel/boot.c
/optee_os/core/arch/arm/kernel/cache_helpers_a64.S
/optee_os/core/arch/arm/kernel/secure_partition.c
/optee_os/core/arch/arm/kernel/tlb_helpers_a32.S
/optee_os/core/arch/arm/kernel/tlb_helpers_a64.S
/optee_os/core/arch/arm/mm/core_mmu.c
/optee_os/core/arch/arm/mm/core_mmu_lpae.c
/optee_os/core/arch/arm/mm/core_mmu_v7.c
/optee_os/core/arch/arm/mm/tee_pager.c
/optee_os/core/arch/arm/plat-aspeed/conf.mk
/optee_os/core/arch/arm/plat-aspeed/platform_ast2700.c
/optee_os/core/arch/arm/plat-aspeed/platform_config.h
/optee_os/core/arch/arm/plat-aspeed/sub.mk
/optee_os/core/arch/arm/plat-stm32mp1/conf.mk
/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pwr.c
/optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_syscfg.c
/optee_os/core/arch/arm/plat-stm32mp1/main.c
/optee_os/core/arch/arm/plat-stm32mp1/platform_config.h
/optee_os/core/arch/arm/plat-stm32mp1/scmi_server.c
/optee_os/core/arch/arm/plat-stm32mp1/shared_resources.c
/optee_os/core/arch/arm/plat-stm32mp1/stm32_util.h
/optee_os/core/arch/riscv/include/mm/core_mmu_arch.h
/optee_os/core/arch/riscv/include/riscv.h
/optee_os/core/arch/riscv/kernel/abort.c
/optee_os/core/arch/riscv/kernel/asm-defines.c
/optee_os/core/arch/riscv/kernel/sub.mk
/optee_os/core/arch/riscv/kernel/thread_rv.S
/optee_os/core/arch/riscv/kernel/unwind_rv.c
/optee_os/core/arch/riscv/mm/tlb_helpers_rv.S
/optee_os/core/arch/riscv/riscv.mk
/optee_os/core/drivers/atmel_piobu.c
/optee_os/core/drivers/atmel_saic.c
/optee_os/core/drivers/clk/clk-stm32-core.c
/optee_os/core/drivers/clk/clk-stm32mp15.c
/optee_os/core/drivers/clk/clk_dt.c
/optee_os/core/drivers/clk/sam/at91_clk.h
/optee_os/core/drivers/clk/sam/at91_pmc.c
/optee_os/core/drivers/gic.c
/optee_os/core/drivers/gpio/gpio.c
/optee_os/core/drivers/hfic.c
/optee_os/core/drivers/i2c/atmel_i2c.c
/optee_os/core/drivers/imx_ele.c
/optee_os/core/drivers/pinctrl/atmel_pio.c
/optee_os/core/drivers/pinctrl/pinctrl.c
/optee_os/core/drivers/rstctrl/stm32_rstctrl.c
/optee_os/core/drivers/stm32_bsec.c
/optee_os/core/drivers/stm32_etzpc.c
/optee_os/core/drivers/stm32_gpio.c
/optee_os/core/drivers/stm32_i2c.c
/optee_os/core/include/drivers/clk_dt.h
/optee_os/core/include/drivers/gpio.h
/optee_os/core/include/drivers/i2c.h
/optee_os/core/include/drivers/pinctrl.h
/optee_os/core/include/drivers/rstctrl.h
/optee_os/core/include/drivers/stm32_etzpc.h
/optee_os/core/include/drivers/stm32_gpio.h
/optee_os/core/include/dt-bindings/clock/stm32mp13-clks.h
/optee_os/core/include/dt-bindings/regulator/st,stm32mp13-regulator.h
/optee_os/core/include/dt-bindings/rtc/rtc-stm32.h
/optee_os/core/include/kernel/dt_driver.h
/optee_os/core/include/kernel/interrupt.h
/optee_os/core/include/mm/core_mmu.h
/optee_os/core/kernel/dt_driver.c
/optee_os/core/kernel/interrupt.c
/optee_os/core/mm/core_mmu.c
/optee_os/core/mm/vm.c
/optee_os/core/pta/tests/dt_driver_test.c
/optee_os/ldelf/main.c
/optee_os/ldelf/ta_elf.c
/optee_os/ldelf/ta_elf.h
libutee/arch/riscv/utee_syscalls_rv.S
/optee_os/mk/aosp_optee.mk
/optee_os/scripts/symbolize.py
/optee_os/ta/mk/ta_dev_kit.mk
/optee_os/ta/pkcs11/src/processing.h
/optee_os/ta/ta.mk
2661af2926-May-2023 Alvin Chang <alvinga@andestech.com>

libunw: Implement RISC-V stack unwinding

This patch implements stack unwinding for RISC-V architecture into
libunw. In RISC-V, the caller stores its frame pointer into register
s0 before calling the

libunw: Implement RISC-V stack unwinding

This patch implements stack unwinding for RISC-V architecture into
libunw. In RISC-V, the caller stores its frame pointer into register
s0 before calling the function. In the prologue of callee function,
the return address and the caller's frame pointer are saved into the
bottom of the callee's stack frame, and the callee's frame pointer is
also calculated and stored into s0 within the process of callee
function. Therefore, the caller's stack frame can be traced back from
the callee's stack frame.

The following steps describe the stack unwinding on RV64 system:
1. When an exception occurs, we get the current frame pointer from
trapped register s0/fp.
2. Get the ra from the memory address (fp-0x8).
3. Get the caller's frame pointer from the memory address (fp-0x10).
4. Update the caller's pc as (ra-0x4), this is information we want from
stack unwinding.
5. Repeat the step 2 to step 4, until we exceed the stack frame of the
thread.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...

f7a5c21e29-May-2023 Jerome Forissier <jerome.forissier@linaro.org>

arm64: memtag: strip tag from crash dumps

The MTE tag is not really useful when displaying a crash dump. In fact
it makes it more complicated for tools like script/symbolize.py to
retrieve the actua

arm64: memtag: strip tag from crash dumps

The MTE tag is not really useful when displaying a crash dump. In fact
it makes it more complicated for tools like script/symbolize.py to
retrieve the actual (untagged) virtual address, especially as we now
support non-Arm architectures and therefore blindly stripping the MTE
bits is not possible.

This commit strips the tag in call stacks displayed by
print_stack_arm64(). It also removes it from the virtual address shown
on abort (__print_abort_info()) since symbolize.py does try to resolve
the address as symbol + offset ; but in this case the tagged address is
printed as well, because it can be helpful to diagnose tag check faults.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...

12345678910>>...36