| 61bdedea | 13-Jan-2022 |
Jerome Forissier <jerome@forissier.org> |
core: define DT drivers using scattered arrays
Replace the specific mechanism used to define and enumerate DT drivers with scattered arrays. Doing so simplifies the TEE linker file a bit.
Signed-of
core: define DT drivers using scattered arrays
Replace the specific mechanism used to define and enumerate DT drivers with scattered arrays. Doing so simplifies the TEE linker file a bit.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Suggested-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9c4aaf67 | 11-Jan-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: make mobj_get_va() more secure
Adds a length parameter to allow mobj_get_va() to check that the entire va range requested is available.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.
core: make mobj_get_va() more secure
Adds a length parameter to allow mobj_get_va() to check that the entire va range requested is available.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c2d44948 | 20-Apr-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add asynchronous notifications
Adds support for asynchronous notifications from secure world to normal world. This allows a design with a top half and bottom half type of driver where the top
core: add asynchronous notifications
Adds support for asynchronous notifications from secure world to normal world. This allows a design with a top half and bottom half type of driver where the top half runs in secure interrupt context and a notifications tells normal world to schedule a yielding call to do the bottom half processing.
The protocol is defined in optee_msg.h optee_rpc_cmd.h and optee_smc.h.
A notification consists of a 32-bit value which normal world can retrieve using a fastcall into secure world. OP-TEE is currently only supporting the value 0-63 where 0 has a special meaning. When 0 is sent it means that normal world is supposed to make a yielding call OPTEE_MSG_CMD_DO_BOTTOM_HALF.
The notification framework in OP-TEE defines an interface where drivers can register a callback which is called on each yielding bottom half call.
Notification capability is negotiated with the normal world while it initializes its driver. If both sides supports these notifications then they are enabled.
CFG_CORE_ASYNC_NOTIF_GIC_INTID is added to define the hardware interrupt used to notify normal world. This is added to the DTB in case OP-TEE can is configured with CFG_DT=y. Other cases requires the normal world DTB to be kept in sync with this.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2828809e | 20-Apr-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add new interface for synchronous notifications
Adds a new interface for synchronous notifications. The old RPC interface based on OPTEE_RPC_CMD_WAIT_QUEUE is renamed to OPTEE_RPC_CMD_NOTIFICA
core: add new interface for synchronous notifications
Adds a new interface for synchronous notifications. The old RPC interface based on OPTEE_RPC_CMD_WAIT_QUEUE is renamed to OPTEE_RPC_CMD_NOTIFICATION in order to match the new interface.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 0d482f82 | 02-Nov-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ldelf: Add support for mapping ELF executable sections as guarded
Introduce LDELF_MAP_FLAG_BTI to indicate if ELF supports BTI. A BTI instruction is used to guard against the execution of instructio
ldelf: Add support for mapping ELF executable sections as guarded
Introduce LDELF_MAP_FLAG_BTI to indicate if ELF supports BTI. A BTI instruction is used to guard against the execution of instructions that are not the intended target of a branch. The executable pages need to be marked as guarded to ensure that BTI doesn't execute as NOP.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c9bd3375 | 24-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: probe drivers before/after crypto services
Changes drivers probing sequence to probe before and after core crypto services that are initialized at service_init initcall level. It in
core: dt_driver: probe drivers before/after crypto services
Changes drivers probing sequence to probe before and after core crypto services that are initialized at service_init initcall level. It intends to support probing of drivers the crypto layer depends on (as those registering to drvcrypt framework) as well as drivers that depend on crypto services.
At early_init_late initcall level, root node is parsed and the driver probing loop is run as prior this change. With this change the probing loop may end-up unresolved dependencies hence another round of driver probing is done at driver_init initcall level. Drivers dependencies are expected to be resolved at that stage.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 3de8f0de | 25-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: helper for dependency on crypt service
Adds dt_driver_get_crypto() function to allow drivers to request probe deferral when depending on core crypto services. For that purpose tee_c
core: dt_driver: helper for dependency on crypt service
Adds dt_driver_get_crypto() function to allow drivers to request probe deferral when depending on core crypto services. For that purpose tee_cryp_init() is changed to call dt_driver_crypt_init_complete() once crypt layer initialization completes.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 3430d816 | 08-Dec-2021 |
Lionel Debieve <lionel.debieve@foss.st.com> |
core: pm: fix incorrect flag check in pm_callback
Fix test error check that always return true with current condition. The check must be done to identify if the SUSPENDED flag has been set.
Fixes:
core: pm: fix incorrect flag check in pm_callback
Fix test error check that always return true with current condition. The check must be done to identify if the SUSPENDED flag has been set.
Fixes: 5920ec258f16 ("core: kernel: pm: refine suspend/resume sequence order") Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 736cb9e1 | 22-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: allow drivers to fail initialization
Change the probing logic to not panic core if a drivers fails to initialize. Driver that fail to probe are moved in a specific list that may be
core: dt_driver: allow drivers to fail initialization
Change the probing logic to not panic core if a drivers fails to initialize. Driver that fail to probe are moved in a specific list that may be later print for debug purpose.
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 115944b5 | 22-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: factorize resource releasing
Moves dt_driver_release_provider() into release_probe_lists() to get all DT driver probing resources released upon core initialization completion.
Also
core: dt_driver: factorize resource releasing
Moves dt_driver_release_provider() into release_probe_lists() to get all DT driver probing resources released upon core initialization completion.
Also removes the debug verbosity that is not useful at that place.
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| c4c84e2c | 02-Dec-2021 |
Sahil Malhotra <sahil.malhotra@nxp.com> |
core: dt_driver: skip drivers not providing a probe operator
If drivers is not providing a probe operator, that can result in crash, so skip drivers not providing a probe operator.
Signed-off-by: S
core: dt_driver: skip drivers not providing a probe operator
If drivers is not providing a probe operator, that can result in crash, so skip drivers not providing a probe operator.
Signed-off-by: Sahil Malhotra <sahil.malhotra@nxp.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Fixes: https://github.com/OP-TEE/optee_os/issues/5017
show more ...
|
| 8dca59b4 | 19-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: use driver type when finding a driver provider
Adds driver type argument to functions dt_driver_get_provider_by_node(), and dt_driver_get_provider_by_phandle() to differentiate driv
core: dt_driver: use driver type when finding a driver provider
Adds driver type argument to functions dt_driver_get_provider_by_node(), and dt_driver_get_provider_by_phandle() to differentiate driver provider references when a single DT node relates to several driver providers that are of different type by DT binding definition. For example, a DT node may describe a device that acts both as a clock provider and a reset controller, for which two driver references are needed in the driver provider list.
Updates dt_driver_device_from_node_idx_prop() accordingly.
Fixes: f498c4042931 ("core: dt_driver: factorize clk_get_provider_by_*()") Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| a3f00f7d | 21-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: return TEE_ERROR_DEFER_DRIVER_INIT if no provider
Changes dt_driver_device_from_node_idx_prop() to report caller driver probe deferral when the expected provider is not yet found in
core: dt_driver: return TEE_ERROR_DEFER_DRIVER_INIT if no provider
Changes dt_driver_device_from_node_idx_prop() to report caller driver probe deferral when the expected provider is not yet found in the provider list as the function description expects.
Fixes: d8b14b46af9d ("core: dt_driver: get return code when querying a device") Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 33b38f8c | 21-Nov-2021 |
Ruslan Piasetskyi <ruslan.piasetskyi@gmail.com> |
core: introduce CFG_CORE_HUK_SUBKEY_COMPAT_USE_OTP_DIE_ID
Adds CFG_CORE_HUK_SUBKEY_COMPAT_USE_OTP_DIE_ID which if set to 'y' makes huk_subkey_derive() generate SSK using tee_otp_get_die_id().
Old s
core: introduce CFG_CORE_HUK_SUBKEY_COMPAT_USE_OTP_DIE_ID
Adds CFG_CORE_HUK_SUBKEY_COMPAT_USE_OTP_DIE_ID which if set to 'y' makes huk_subkey_derive() generate SSK using tee_otp_get_die_id().
Old scheme for SSK generation: SSK = HMAC_SHA256(HUK, Chip_ID || "ONLY_FOR_tee_fs_ssk") This config changes Chip_ID from the default BEEF-like value to the result of tee_otp_get_die_id().
Note that this option works only if CFG_CORE_HUK_SUBKEY_COMPAT=y.
Acked-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Ruslan Piasetskyi <ruslan.piasetskyi@gmail.com>
show more ...
|
| 6e2de0d7 | 24-Nov-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: Fix warnings in core/kernel/lockdep.c
Fixes -Wdeclaration-after-statement warnings in core/kernel/lockdep.c: core/kernel/lockdep.c: In function 'lockdep_graph_get_shortest_cycle': core/kernel/
core: Fix warnings in core/kernel/lockdep.c
Fixes -Wdeclaration-after-statement warnings in core/kernel/lockdep.c: core/kernel/lockdep.c: In function 'lockdep_graph_get_shortest_cycle': core/kernel/lockdep.c:151:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct lockdep_node *n = qe->node; ^~~~~~ core/kernel/lockdep.c:155:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct lockdep_edge *e = NULL; ^~~~~~ core/kernel/lockdep.c:183:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] size_t nlen = qe->pathlen + 1; ^~~~~~ core/kernel/lockdep.c: In function 'lockdep_visit': core/kernel/lockdep.c:221:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct lockdep_edge *e; ^~~~~~ core/kernel/lockdep.c: In function '__lockdep_lock_acquire': core/kernel/lockdep.c:343:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct lockdep_lock *lock = NULL; ^~~~~~ core/kernel/lockdep.c:356:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] TEE_Result res = lockdep_graph_sort(graph); ^~~~~~~~~~ core/kernel/lockdep.c: In function '__lockdep_lock_tryacquire': core/kernel/lockdep.c:390:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct lockdep_lock *lock = NULL; ^~~~~~
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3f4f2e50 | 24-Nov-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: Fix warning in __wq_rpc()
Fixes a -Wdeclaration-after-statement warning in __wq_rpc(): core/kernel/wait_queue.c:36:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-af
core: Fix warning in __wq_rpc()
Fixes a -Wdeclaration-after-statement warning in __wq_rpc(): core/kernel/wait_queue.c:36:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param params = THREAD_PARAM_VALUE(IN, func, id, 0); ^~~~~~
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3c6cfce4 | 24-Nov-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: Fix warning in find_chosen_node()
Fixes a -Wdeclaration-after-statement warning in find_chosen_node(): core/kernel/console.c:48:2: error: ISO C90 forbids mixed declarations and code [-Werror=d
core: Fix warning in find_chosen_node()
Fixes a -Wdeclaration-after-statement warning in find_chosen_node(): core/kernel/console.c:48:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] int offset = fdt_path_offset(fdt, "/secure-chosen"); ^~~
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b17cf5c8 | 21-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: debug trace if property not found
Adds a debug level trace message in dt_driver_device_from_node_idx_prop() when unexpectedly not finding provider expected property in target node.
core: dt_driver: debug trace if property not found
Adds a debug level trace message in dt_driver_device_from_node_idx_prop() when unexpectedly not finding provider expected property in target node.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| f21b3ed5 | 21-Sep-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: release driver probing resource after initialization
Use release_init_resource initcall level to release DT phandle provider list, probe list and ready list.
Reviewed-by: Jens Wiklander <jens
core: release driver probing resource after initialization
Use release_init_resource initcall level to release DT phandle provider list, probe list and ready list.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| ea29d587 | 12-Sep-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: add simple bus driver
Simple bus driver simply parses the device subnodes for device to probe driver with.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Co-developed-by: Lio
core: dt_driver: add simple bus driver
Simple bus driver simply parses the device subnodes for device to probe driver with.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Co-developed-by: Lionel Debieve <lionel.debieve@st.com> Signed-off-by: Lionel Debieve <lionel.debieve@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| b3a88b52 | 12-Sep-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver probe sequence
Add a driver_init initcall function to parse DT from root node and probe devices for which a compatible driver is registered in the dt_driver list. When a matching dri
core: dt_driver probe sequence
Add a driver_init initcall function to parse DT from root node and probe devices for which a compatible driver is registered in the dt_driver list. When a matching driver is found, its probe function is called to initialize the device.
Driver probe function returns TEE_SUCCESS or successful initialization, TEE_ERROR_DEFER_DRIVER_INIT if waiting for a dependent device, otherwise another TEE_Result error code. In the later case, the probe function panics.
The probe sequence uses 2 lists: a list of the device DT nodes for which a driver shall be probed (probe list) and a list of devices that were successfully probed and initialized (ready list). Since at least clock framework and dt_driver do both parse DT for matching nodes, we must centralized successfully probed devices to not add them twice in the probe list.
Note that a DT node can probe several drivers, one per driver type, as defined by dt_driver_type enumerated type.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Co-developed-by: Lionel Debieve <lionel.debieve@st.com> Signed-off-by: Lionel Debieve <lionel.debieve@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| d8b14b46 | 27-Oct-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: get return code when querying a device
Change dt_driver_device_from_provider_prop() function and friends to output return a TEE_Result code if failing to find target device instance
core: dt_driver: get return code when querying a device
Change dt_driver_device_from_provider_prop() function and friends to output return a TEE_Result code if failing to find target device instance. Return code TEE_ERROR_DEFER_DRIVER_INIT reports that requested device is not yet registered and initialized in the dt_driver provider list.
This change will be used to probed device drivers and allow probe deferral when a device depends on another device driver that is not yet initialized.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 36ebac6d | 02-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: kernel: pm: initialize local variables
Initialize local variables in pm_change_state().
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@
core: kernel: pm: initialize local variables
Initialize local variables in pm_change_state().
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 5920ec25 | 02-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: kernel: pm: refine suspend/resume sequence order
Change PM generic implementation to call handlers for suspend in the reserve order in which they were registered and to call handlers for resum
core: kernel: pm: refine suspend/resume sequence order
Change PM generic implementation to call handlers for suspend in the reserve order in which they were registered and to call handlers for resume in the opposite order, that is the order in which the handlers where registered.
This change allows to reuse the driver initialization ordering which is expected to match device drivers dependencies. This change will be even more useful when using probe support and dependencies resolution.
The change does not affect the 2 PM registration levels: core and drivers. Core handlers are still suspends after drivers and resumed before drivers.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Gatien Chevallier <gatien.chevallier@st.com>
show more ...
|
| 502e23ad | 02-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: pm: add a name to registered pm_callback_handle
Adds an argument to register a name (string debug identifier) for PM handlers registered to PM framework.
Caller can provide a NULL reference o
core: pm: add a name to registered pm_callback_handle
Adds an argument to register a name (string debug identifier) for PM handlers registered to PM framework.
Caller can provide a NULL reference or a valid string pointer. When pager is enabled, the registration ensures the name lies in an unpaged section, possibly allocating heap for that purpose.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Gatien Chevallier <gatien.chevallier@st.com>
show more ...
|