| e37b526d | 07-Dec-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: move hafnium.h into hfic.c
hafnium.h is only included from hfic.c so move the content into that file instead. Comments trying to describe the paravirtualized interface are removed and replaced
core: move hafnium.h into hfic.c
hafnium.h is only included from hfic.c so move the content into that file instead. Comments trying to describe the paravirtualized interface are removed and replaced by a link to official documentation.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 6959d59f | 07-Dec-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: ffa: exit with native interrupts unmasked
When exiting using the main exit/re-entry loop in ffa_msg_send_direct_resp(), unmask native interrupts before the SMC instruction and mask them again
core: ffa: exit with native interrupts unmasked
When exiting using the main exit/re-entry loop in ffa_msg_send_direct_resp(), unmask native interrupts before the SMC instruction and mask them again on re-entry. This guarantees that native (aka secure) interrupts are not pending during exit. This also means that when entering with FFA_INTERRUPT the interrupt will be handled before thread_spmc_msg_recv() so there is no need to call interrupt_main_handler() from thread_spmc_msg_recv() any longer.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 55a80fa9 | 07-Dec-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm64.h: add DAIFBIT_{NATIVE,FOREIGN}_INTR
Adds the two defines DAIFBIT_NATIVE_INTR and DAIFBIT_FOREIGN_INTR based on DAIFBIT_IRQ and DAIFBIT_FIQ analogous with how THREAD_EXCP_FOREIGN_INTR an
core: arm64.h: add DAIFBIT_{NATIVE,FOREIGN}_INTR
Adds the two defines DAIFBIT_NATIVE_INTR and DAIFBIT_FOREIGN_INTR based on DAIFBIT_IRQ and DAIFBIT_FIQ analogous with how THREAD_EXCP_FOREIGN_INTR and THREAD_EXCP_NATIVE_INTR are defined.
DAIFBIT_NATIVE_INTR and DAIFBIT_FOREIGN_INTR can be used in assembly instead of using #ifdef CFG_CORE_IRQ_IS_NATIVE_INTR.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 012cdca4 | 25-Jan-2024 |
Manorit Chawdhry <m-chawdhry@ti.com> |
plat-k3: drivers: sec_proxy: increment while reading trail bytes
The trail bytes from the secure proxy driver were being overwritten, increase the count each time to not overwrite the existing data
plat-k3: drivers: sec_proxy: increment while reading trail bytes
The trail bytes from the secure proxy driver were being overwritten, increase the count each time to not overwrite the existing data and not get the end data corrupted from secure proxy.
Fixes: cf20f0a4f77e ("plat-k3: drivers: Add secure proxy driver for communication with System Controller") Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com> Acked-by: Andrew Davis <afd@ti.com> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Dhruva Gole <d-gole@ti.com>
show more ...
|
| cb30e9d1 | 25-Jan-2024 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
plat-stm32mp2: default enable embedded test
Set CFG_ENABLE_EMBEDDED_TESTS to y for STM32MP2x platforms.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carrier
plat-stm32mp2: default enable embedded test
Set CFG_ENABLE_EMBEDDED_TESTS to y for STM32MP2x platforms.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 14c31b4f | 25-Jan-2024 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
plat-stm32mp2: allow up to 8GB of external RAM
Default enable CFG_CORE_LARGE_PHYS_ADDR and set CFG_CORE_ARM64_PA_BITS to 34 to allow external DDR sizes up to 8GB. This change does not permit OP-TEE
plat-stm32mp2: allow up to 8GB of external RAM
Default enable CFG_CORE_LARGE_PHYS_ADDR and set CFG_CORE_ARM64_PA_BITS to 34 to allow external DDR sizes up to 8GB. This change does not permit OP-TEE to execute above 32bit virtual addresses but allows OP-TEE to accept and map shared memories of physical addresses above 4GByte.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| e07f9212 | 19-Dec-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
plat-stm32mp1: shared_resource: disable MCKPROT if not needed
Disable RCC MCKPROT if not needed on STM32MP15 platforms to allow non-secure world to control Cortex-M coprocessor. This change is neede
plat-stm32mp1: shared_resource: disable MCKPROT if not needed
Disable RCC MCKPROT if not needed on STM32MP15 platforms to allow non-secure world to control Cortex-M coprocessor. This change is needed when RCC secure hardening is enabled (RCC[TZEN] control bit) as it also default enable RCC MCKPROT preventing non-secure world from accessing some coprocessor SoC resources.
This change is needed when using in tree DTS files stm32mp15*-*-scmi.dts and non-secure world is in charge of loading and managing the remote processor firmware.
Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 54d90e3f | 10-Jan-2024 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
plat-stm32mp2: conf: default enable RNG and RNG PTA
Default enable RNG and RNG PTA for STM32MP2 platforms.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carr
plat-stm32mp2: conf: default enable RNG and RNG PTA
Default enable RNG and RNG PTA for STM32MP2 platforms.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 59fea683 | 16-Jan-2024 |
Igor Opaniuk <igor.opaniuk@foundries.io> |
core: pta: drop benchmark
Drop Benchmark PTA as current implementation is non-function and obsolete, and it's not supported anymore.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: E
core: pta: drop benchmark
Drop Benchmark PTA as current implementation is non-function and obsolete, and it's not supported anymore.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
show more ...
|
| a6f60e0f | 20-Jan-2024 |
Volodymyr Babchuk <volodymyr_babchuk@epam.com> |
arm: plat: rcar: gen4: adjust memory map
Adjust the OP-TEE memory map for Gen4/S4 SoC to reflect changes of IPL layout made by Renesas. Now BL31 starts at 0x46400000, so we have less memory for OP-T
arm: plat: rcar: gen4: adjust memory map
Adjust the OP-TEE memory map for Gen4/S4 SoC to reflect changes of IPL layout made by Renesas. Now BL31 starts at 0x46400000, so we have less memory for OP-TEE.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e7dd9fbb | 17-Jan-2024 |
Volodymyr Babchuk <volodymyr_babchuk@epam.com> |
arm: virtualization: don't allow hypervisor to issue std calls
There is standing issue with having two versions of OP-TEE binary: with virtualization enabled and without it. Correct variant needs to
arm: virtualization: don't allow hypervisor to issue std calls
There is standing issue with having two versions of OP-TEE binary: with virtualization enabled and without it. Correct variant needs to be present on board before booting rest of the system.
If non-virtualized variant is present and user tries to boot a hypervisor, hypervisor can (and should) detect that OP-TEE does not provide OPTEE_SMC_SEC_CAP_VIRTUALIZATION capability and fail gracefully.
On other hand, when virtualized variant of OP-TEE is booted, but user then boots directly into Linux (or any other OS), OP-TEE crashes:
E/TC:0 0 0 Core data-abort at address 0xffffffffffffffa0 (translation fault) E/TC:0 0 0 esr 0x96000044 ttbr0 0x4418d000 ttbr1 0x00000000 cidr 0x0 E/TC:0 0 0 cpu #0 cpsr 0x00000184 E/TC:0 0 0 x0 0000000032000004 x1 0000000000000004 E/TC:0 0 0 x2 000000008183c000 x3 0000000000000000 E/TC:0 0 0 x4 0000000000000000 x5 0000000000000000 E/TC:0 0 0 x6 0000000000000000 x7 0000000000000000 E/TC:0 0 0 x8 0000000000000000 x9 0000000000000000 E/TC:0 0 0 x10 0000000000000000 x11 0000000000000000 E/TC:0 0 0 x12 0000000000000000 x13 0000000000000000 E/TC:0 0 0 x14 0000000000000000 x15 0000000000000000 E/TC:0 0 0 x16 0000000000000000 x17 0000000000000000 E/TC:0 0 0 x18 0000000000000000 x19 0000000000000000 E/TC:0 0 0 x20 0000000000000000 x21 0000000000000000 E/TC:0 0 0 x22 0000000000000000 x23 0000000000000000 E/TC:0 0 0 x24 0000000000000000 x25 0000000000000000 E/TC:0 0 0 x26 0000000000000000 x27 0000000000000000 E/TC:0 0 0 x28 0000000000000000 x29 0000000000000000 E/TC:0 0 0 x30 0000000044103ce4 elr 0000000044106314 E/TC:0 0 0 sp_el0 0000000000000000 E/TC:0 0 0 TEE load address @ 0x44100000 E/TC:0 0 0 Call stack: E/TC:0 0 0 0x44106314 thread_handle_std_smc at core/arch/arm/kernel/thread_optee_smc.c:62 E/TC:0 0 0 Panic 'unhandled pageable abort' at core/arch/arm/kernel/abort.c:584 <abort_handler> E/TC:0 0 0 TEE load address @ 0x44100000 E/TC:0 0 0 Call stack: E/TC:0 0 0 0x44107e14 print_kernel_stack at core/arch/arm/kernel/unwind_arm64.c:89 E/TC:0 0 0 0x44114ffc __do_panic at core/kernel/panic.c:73 E/TC:0 0 0 0x44107050 get_fault_type at core/arch/arm/kernel/abort.c:500
This crash happens because virtualization code has special case for guest_id == HYP_CLNT_ID. This case is needed to allow hypervisor to call fast SMCs, so it can check OP-TEE version, capabilities and ask OP-TEE to create/destroy guest partitions. Problem is that thread_handle_std_smc() assumes that virt_set_guest() really sets the guest partition, which does not happen in this special case.
This patch removes this special case from virt_set_guest(). Instead thread_handle_fast_smc() function checks for HYP_CLNT_ID explicitly.
If hypervisor really want to be able to issue STD calls, it should create a partition for itself using OPTEE_SMC_VM_CREATED call.
With this patch applied, virtualized variant of OP-TEE does not crash anymore when users tries to boot into a baremetal setup.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 6370f75d | 25-Sep-2023 |
Tony Han <tony.han@microchip.com> |
drivers: sam: use header file "platform_config.h" instead of "sama5d2.h"
As "sama5d2.h" is included in "platform_config.h" it's better to use "#include <platform_config.h>" for support more devices
drivers: sam: use header file "platform_config.h" instead of "sama5d2.h"
As "sama5d2.h" is included in "platform_config.h" it's better to use "#include <platform_config.h>" for support more devices later.
Signed-off-by: Tony Han <tony.han@microchip.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| b51aaa62 | 05-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: arm: fix dead code when ARM32 is not defined
Remove dead code warning when ARM32=n. When ARM32=n, ret is always equal to TEE_ERROR_NOT_SUPPORTED. It makes the following if() else if () useless
core: arm: fix dead code when ARM32 is not defined
Remove dead code warning when ARM32=n. When ARM32=n, ret is always equal to TEE_ERROR_NOT_SUPPORTED. It makes the following if() else if () useless.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 5ca2c365 | 10-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander
core: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-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 ...
|
| 34d6dc2b | 10-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
plat-vexpress: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens
plat-vexpress: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-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 ...
|
| 655625e0 | 16-Jan-2024 |
Imre Kis <imre.kis@arm.com> |
core: ffa: Read FF-A version from the SP manifest
Read the SP's FF-A version from the ffa-version property of the SP manifest. This property is mandatory according to the FF-A specification. SPs are
core: ffa: Read FF-A version from the SP manifest
Read the SP's FF-A version from the ffa-version property of the SP manifest. This property is mandatory according to the FF-A specification. SPs are still able to do runtime version negotiation via the FFA_VERSION interface.
Signed-off-by: Imre Kis <imre.kis@arm.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 8a6ca148 | 20-Oct-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: arm: get DDR range from embedded DTB
Find main memory (DDR) physical range(s) from the secure embedded DTB if not found from the external DDR.
Reviewed-by: Jens Wiklander <jens.wiklander@lina
core: arm: get DDR range from embedded DTB
Find main memory (DDR) physical range(s) from the secure embedded DTB if not found from the external DDR.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 29b4cb6e | 17-Jan-2024 |
Sahil Malhotra <sahil.malhotra@nxp.com> |
core: imx: disable ELE support on imx8ulp, imx93 by default
On imx8ulp and imx93, there is only one MU to communicate with ELE, which cannot be dedicated on OP-TEE side all the time. There may be EL
core: imx: disable ELE support on imx8ulp, imx93 by default
On imx8ulp and imx93, there is only one MU to communicate with ELE, which cannot be dedicated on OP-TEE side all the time. There may be ELE services running on Linux side, which can cause conflict with OP-TEE. So disablig ELE by default for now.
Signed-off-by: Sahil Malhotra <sahil.malhotra@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Clement Faure <clement.faure@nxp.com>
show more ...
|
| 5d3112cb | 16-Jan-2024 |
Volodymyr Babchuk <volodymyr_babchuk@epam.com> |
plat: rcar-gen3: disable HWRNG by default
Sometimes ROM code fails to provide random numbers, which leads to OP-TEE panic with "ROM_GetRndVector() returned error!" message.
So far this behavior was
plat: rcar-gen3: disable HWRNG by default
Sometimes ROM code fails to provide random numbers, which leads to OP-TEE panic with "ROM_GetRndVector() returned error!" message.
So far this behavior was observed only on M3 Ver.3.0, but it is unclear if other SoCs are affected. There is a workaround which retries and operation and this workaround seems to work, but again, it is unclear if this is the correct way to deal with the issue. So it is better to disable use of HWRNG by default, until we get clarification on those errors from Renesas.
This patch moves HWRNG code under CFG_RCAR_GEN3_HWRNG option, so expert user still can try to use it.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| ec0d74f2 | 16-Jan-2024 |
Volodymyr Babchuk <volodymyr_babchuk@epam.com> |
plat-rcar: romapi: retry call to ROM_GetRndVector
Sometimes ROM_GetRndVector() function returns an error, which causes OP-TEE panic down the call path, as OP-TEE can't handle errors from the hardwar
plat-rcar: romapi: retry call to ROM_GetRndVector
Sometimes ROM_GetRndVector() function returns an error, which causes OP-TEE panic down the call path, as OP-TEE can't handle errors from the hardware random number generator. As a workaround, we can try to repeat call to the ROM_GetRndVector() because it succeeds on the next try.
Anyways, this hardly can be considered as a normal behavior so it is better to disable HW RNG by default, which will be done in a separate patch.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| a040ef6e | 17-Jan-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
plat-stm32mp1: fix misnamed 157C_EV1_SCMI flavor
Correct platform flavor name 157C_EV1_SCMI, not 157F_EV1_SCMI.
Fixes: 36f1fd6d4930 ("dts: add stm32mp15*-scmi.dts files for when RCC is secure") Ack
plat-stm32mp1: fix misnamed 157C_EV1_SCMI flavor
Correct platform flavor name 157C_EV1_SCMI, not 157F_EV1_SCMI.
Fixes: 36f1fd6d4930 ("dts: add stm32mp15*-scmi.dts files for when RCC is secure") Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 5c4a6d1b | 11-Jan-2024 |
Andrew Davis <afd@ti.com> |
plat-k3: sa2ul_rng: Use mutex instead of spinlock for critical section
While spinlock are slightly more lightweight, they currently require that interrupts are disabled during the critical section.
plat-k3: sa2ul_rng: Use mutex instead of spinlock for critical section
While spinlock are slightly more lightweight, they currently require that interrupts are disabled during the critical section. If this section is long enough it can have a negative affect on realtime sensitive tasks that require deterministic preemption.
As our RNG gathering can loop while waiting for new random numbers to become available we cannot know how long this section will take, so we should use a mutex. Do that here.
Signed-off-by: Andrew Davis <afd@ti.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Bryan Brattlof <bb@ti.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8e9d8acc | 09-Jan-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
plat-vexpress: configure CFG_CORE_ASYNC_NOTIF_GIC_INTID
When compiled for SPMC at S-EL1 (CFG_CORE_SEL1_SPMC=y), configure CFG_CORE_ASYNC_NOTIF_GIC_INTID to an unused secure SGI that can be donated t
plat-vexpress: configure CFG_CORE_ASYNC_NOTIF_GIC_INTID
When compiled for SPMC at S-EL1 (CFG_CORE_SEL1_SPMC=y), configure CFG_CORE_ASYNC_NOTIF_GIC_INTID to an unused secure SGI that can be donated to the normal world.
In boot_primary_init_intc(), only donate the interrupt id if it's in the predefined secure SGI range.
Fixes: 462028ede02d ("qemu_armv8a: add GIC v3 redistributor base address") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 7313a9ba | 09-Jan-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
plat-vexpress: fvp: configure GIC redistributor base address
Configure GIC redistributor base address needed with GICv3.
Fixes: 462028ede02d ("qemu_armv8a: add GIC v3 redistributor base address") S
plat-vexpress: fvp: configure GIC redistributor base address
Configure GIC redistributor base address needed with GICv3.
Fixes: 462028ede02d ("qemu_armv8a: add GIC v3 redistributor base address") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| a3d550e6 | 10-Jan-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: ffa: optionally use CFG_CORE_ASYNC_NOTIF_GIC_INTID
Allow an FF-A configuration to optionally use CFG_CORE_ASYNC_NOTIF_GIC_INTID to configure the interrupt used to notify the normal world
core: arm: ffa: optionally use CFG_CORE_ASYNC_NOTIF_GIC_INTID
Allow an FF-A configuration to optionally use CFG_CORE_ASYNC_NOTIF_GIC_INTID to configure the interrupt used to notify the normal world that there are pending notifications. For FF-A CFG_CORE_ASYNC_NOTIF_GIC_INTID is only dealt with in platform code so relax the static assert about interrupt IDs in (the unused) add_optee_dt_node().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|