| a0e8ffe9 | 04-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add support for MTE
Adds support for the Armv8.5-A Memory Tagging Extension with CFG_MEMTAG=y.
A memtag.h API is introduced to handle this extension. If CFG_MEMTAG=n the API doesn't add any o
core: add support for MTE
Adds support for the Armv8.5-A Memory Tagging Extension with CFG_MEMTAG=y.
A memtag.h API is introduced to handle this extension. If CFG_MEMTAG=n the API doesn't add any overhead and the behaviour is unchanged. With CFG_MEMTAG=y a check is performed to see if the platform can support MTE and the API is dynamically configured accordingly. This means that it's safe to have CFG_MEMTAG=y even for platforms not supporting MTE. There will be some minimal overhead then, but likely not noticeable.
An entry is also added in the TEE_PROPSET_TEE_IMPLEMENTATION for a u32 property "org.trustedfirmware.optee.cpu.feat_memtag_implemented". The property is set to a non-zero value only if CFG_CORE_MEMTAG is configured and the underlying CPU supports FEAT_MTE.
This commit still only uses the default tag with the value 0 resulting in unchanged pointers when accessing memory. However, all plumbing is in place allowing for instance tagging of the heap in a later commit.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 6105aa86 | 12-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: map TA memory using TEE_MATTR_MEM_TYPE_TAGGED
Maps TA memory using the TEE_MATTR_MEM_TYPE_TAGGED which results in tagged cached memory if the system has it enabled.
Acked-by: Etienne Carriere
core: map TA memory using TEE_MATTR_MEM_TYPE_TAGGED
Maps TA memory using the TEE_MATTR_MEM_TYPE_TAGGED which results in tagged cached memory if the system has it enabled.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7c3ab774 | 04-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mm: add TEE_MATTR_MEM_TYPE_TAGGED
Adds TEE_MATTR_MEM_TYPE_TAGGED used to map tagged memory as defined in Armv8.5-A Memory Tagging Extension (MTE).
All OP-TEE core memory should be mapped as t
core: mm: add TEE_MATTR_MEM_TYPE_TAGGED
Adds TEE_MATTR_MEM_TYPE_TAGGED used to map tagged memory as defined in Armv8.5-A Memory Tagging Extension (MTE).
All OP-TEE core memory should be mapped as tagged memory when supported.
Memory potentially shared with non-secure world or other firmware should not be mapped as tagged since we don't have control over the tags then.
The mappings used by TEE_MATTR_MEM_TYPE_TAGGED is replaced by TEE_MATTR_MEM_TYPE_CACHED if MTE isn't supported or configured.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c8e3b5fa | 06-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm64.h: add MTE related defines
Adds defines for bits in SCTLR_EL1 TCR_EL1 and GCR_EL1 relating to the Memory Tagging Extension (MTE).
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.
core: arm64.h: add MTE related defines
Adds defines for bits in SCTLR_EL1 TCR_EL1 and GCR_EL1 relating to the Memory Tagging Extension (MTE).
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f041b3c8 | 06-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm64.h: use 64-bit macros for TCR_* defines
The TCR_EL1 register is a 64-bit register, update the defines to use 64-bit macros instead to reflect that.
Reviewed-by: Jerome Forissier <jerome.
core: arm64.h: use 64-bit macros for TCR_* defines
The TCR_EL1 register is a 64-bit register, update the defines to use 64-bit macros instead to reflect that.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 81df153e | 06-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm64.h: use BIT64() for SCTLR_* defines
The SCTLR_EL1 register is a 64-bit register, update the defines to use the BIT64() macro instead to reflect that.
Reviewed-by: Jerome Forissier <jerom
core: arm64.h: use BIT64() for SCTLR_* defines
The SCTLR_EL1 register is a 64-bit register, update the defines to use the BIT64() macro instead to reflect that.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| aa88017c | 04-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm64: add MTE bits for ID_AA64PFR1
Adds fields in register ID_AA64PFR1 to report the presence of Memory Tagging Extension (MTE).
Adds feat_mte_implemented() to report which MTE feature flav
core: arm64: add MTE bits for ID_AA64PFR1
Adds fields in register ID_AA64PFR1 to report the presence of Memory Tagging Extension (MTE).
Adds feat_mte_implemented() to report which MTE feature flavor is supported.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| fb873b88 | 07-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: recognize tag check faults in abort handler
Adds support in the abort handler to recognize tag check faults.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carr
core: recognize tag check faults in abort handler
Adds support in the abort handler to recognize tag check faults.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8afe7a7c | 11-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: rename mobj_get_cattr() to mobj_get_mem_type()
Renames mobj_get_cattr() to mobj_get_mem_type(). The mobj operation get_ctype() is also renamed to get_mem_type().
This commit is only about ren
core: rename mobj_get_cattr() to mobj_get_mem_type()
Renames mobj_get_cattr() to mobj_get_mem_type(). The mobj operation get_ctype() is also renamed to get_mem_type().
This commit is only about renaming ctype to mem_type, no changes in behaviour.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b683df79 | 23-Mar-2022 |
Clement Faure <clement.faure@nxp.com> |
drivers: imx_ocotp: initialize OCOTP driver earlier
Initialize the OCOTP driver earlier with service_init() instead of driver_init().
With CFG_CORE_HUK_SUBKEY_COMPAT=y, tee_fs_init_key_manager() an
drivers: imx_ocotp: initialize OCOTP driver earlier
Initialize the OCOTP driver earlier with service_init() instead of driver_init().
With CFG_CORE_HUK_SUBKEY_COMPAT=y, tee_fs_init_key_manager() and consequently tee_otp_get_die_id() get executed earlier than the OCOTP driver initialization. tee_fs_init_key_manager() is called by service_init_late() routine.
On platforms featuring the OCOTP driver, the function tee_otp_get_die_id() relies on the driver to be initialized.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 0ce27039 | 26-Apr-2022 |
Neal Liu <neal_liu@aspeedtech.com> |
arm: vfp_a32: check the existence of FPU NEON by CPACR
Almost all Cortex-A processors come with a Floating-Point Unit (FPU) and most also have a NEON unit. However, use of registers D16-D31 of the V
arm: vfp_a32: check the existence of FPU NEON by CPACR
Almost all Cortex-A processors come with a Floating-Point Unit (FPU) and most also have a NEON unit. However, use of registers D16-D31 of the VFP register file depends on the processor's FPU implementation.
Arm coprocessor access control register (CPACR.D32DIS) indicates if FPU and Advanced SIMD is implemented. Check this bit to see if the processor is supported or not.
Signed-off-by: Neal Liu <neal_liu@aspeedtech.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 9c2d6289 | 24-Mar-2022 |
Clement Faure <clement.faure@nxp.com> |
core: lpae: check return value of core_mmu_xlat_table_entry_pa2va()
Since core_mmu_xlat_table_entry_pa2va() can return a NULL pointer, check its return value before the memcpy().
Fixes: 8bdbbf2f5 (
core: lpae: check return value of core_mmu_xlat_table_entry_pa2va()
Since core_mmu_xlat_table_entry_pa2va() can return a NULL pointer, check its return value before the memcpy().
Fixes: 8bdbbf2f5 ("core: lpae: add internal core_mmu_entry_copy()") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 00df7d99 | 24-Mar-2022 |
Clement Faure <clement.faure@nxp.com> |
drivers: crypto: remove unnecessary header
Remove the following header: * utee_defines.h
Fixes: f5a70e3e ("drivers: crypto: generic resources for crypto device driver - RSA") Signed-off-by: Clement
drivers: crypto: remove unnecessary header
Remove the following header: * utee_defines.h
Fixes: f5a70e3e ("drivers: crypto: generic resources for crypto device driver - RSA") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 74bd878e | 24-Mar-2022 |
Clement Faure <clement.faure@nxp.com> |
drivers: crypto: remove unnecessary header
Remove the following header: * utee_defines.h
Fixes: e43ab7a8 ("core: driver: generic resources for crypto cipher driver") Signed-off-by: Clement Faure <
drivers: crypto: remove unnecessary header
Remove the following header: * utee_defines.h
Fixes: e43ab7a8 ("core: driver: generic resources for crypto cipher driver") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 27f7b883 | 24-Mar-2022 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: remove unnecessary header
Remove the following header: * caam_utils_mem.h
Fixes: 2d7a8964 ("driver: implement CAAM driver") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acke
drivers: caam: remove unnecessary header
Remove the following header: * caam_utils_mem.h
Fixes: 2d7a8964 ("driver: implement CAAM driver") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ca430e6e | 24-Mar-2022 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: fix potential memory leak
Free CAAM buffer pabufs before exiting the function in case of an error.
Fixes: 38923d487 ("drivers: caam: implement CAAM DMA Object") Signed-off-by: Clemen
drivers: caam: fix potential memory leak
Free CAAM buffer pabufs before exiting the function in case of an error.
Fixes: 38923d487 ("drivers: caam: implement CAAM DMA Object") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 1ae3ec2d | 24-Mar-2022 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: avoid arithmetic operation for pointer assignment
To parse the pointer array priv->sgtdata[], use this syntax array[idx] instead of array + idx. The new syntax is easier to read and l
drivers: caam: avoid arithmetic operation for pointer assignment
To parse the pointer array priv->sgtdata[], use this syntax array[idx] instead of array + idx. The new syntax is easier to read and less prone to errors.
Fixes: 38923d48 ("drivers: caam: implement CAAM DMA Object") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b13c3ff7 | 25-Apr-2022 |
Neal Liu <neal_liu@aspeedtech.com> |
plat-aspeed: ast2600: control HACE into Secure World
1. Prohibit non-secure access to HACE controller 2. Grant TEE secure memory access to HACE.
Signed-off-by: Neal Liu <neal_liu@aspeedtech.com> Ac
plat-aspeed: ast2600: control HACE into Secure World
1. Prohibit non-secure access to HACE controller 2. Grant TEE secure memory access to HACE.
Signed-off-by: Neal Liu <neal_liu@aspeedtech.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| ca1d8e13 | 25-Apr-2022 |
Neal Liu <neal_liu@aspeedtech.com> |
drivers: crypto: aspeed: hace: fix digest incorrect problem
1. The processing status variable is not set to TEE_SUCCESS if everything works fine. 2. DMA memory needs physically contiguous memory. Al
drivers: crypto: aspeed: hace: fix digest incorrect problem
1. The processing status variable is not set to TEE_SUCCESS if everything works fine. 2. DMA memory needs physically contiguous memory. Allocate aligned DMA memory and copy data from/to DMA memory to make sure consistency of data.
Signed-off-by: Neal Liu <neal_liu@aspeedtech.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 0c2a8f2f | 25-Apr-2022 |
Neal Liu <neal_liu@aspeedtech.com> |
drivers: crypto: aspeed: hace: resolve build issues
Resolve various build and typo issues.
Fixes: commit e752c173aa0f ("crypto/aspeed: ast2600: Add HACE HW hash support") Signed-off-by: Neal Liu <n
drivers: crypto: aspeed: hace: resolve build issues
Resolve various build and typo issues.
Fixes: commit e752c173aa0f ("crypto/aspeed: ast2600: Add HACE HW hash support") Signed-off-by: Neal Liu <neal_liu@aspeedtech.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 5695e448 | 19-Apr-2022 |
Sadiq Hussain <sadiq.muchumarri@intel.com> |
core: Fix compile warning in RPMB storage initialization
Fix the below warning when GCC 10.2.0 toolchain is used:
core/tee/tee_rpmb_fs.c:1137:3: warning: ‘dev_info’ may be used uninitialized in thi
core: Fix compile warning in RPMB storage initialization
Fix the below warning when GCC 10.2.0 toolchain is used:
core/tee/tee_rpmb_fs.c:1137:3: warning: ‘dev_info’ may be used uninitialized in this function [-Wmaybe-uninitialized] memcpy(rpmb_ctx->cid, dev_info.cid, RPMB_EMMC_CID_SIZE);
Signed-off-by: Sadiq Hussain <sadiq.muchumarri@intel.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 89c0a5ea | 15-Apr-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
plat-rockchip: rk3399: define GICC_BASE
Commit 60801696667d ("plat: arm: refactor GIC initialization") has introduced a build regression for Rockchip:
$ make -s PLATFORM=rockchip-rk3399 core/arch
plat-rockchip: rk3399: define GICC_BASE
Commit 60801696667d ("plat: arm: refactor GIC initialization") has introduced a build regression for Rockchip:
$ make -s PLATFORM=rockchip-rk3399 core/arch/arm/plat-rockchip/main.c: In function ‘main_init_gic’: core/arch/arm/plat-rockchip/main.c:29:29: error: ‘GICC_BASE’ undeclared (first use in this function); did you mean ‘GIC_BASE’? 29 | gic_init(&gic_data, GICC_BASE, GICD_BASE); | ^~~~~~~~~ | GIC_BASE
Fix it by defining GICC_BASE unconditionally as most platforms do. The value is taken from the DTS file from the Linux kernel [1].
Fixes: 60801696667d ("plat: arm: refactor GIC initialization") Link: [1] https://github.com/torvalds/linux/blob/v5.17/arch/arm64/boot/dts/rockchip/rk3399.dtsi#L542 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 0e501a9b | 12-Apr-2022 |
Andrew Davis <afd@ti.com> |
plat: arm: fix refactor GIC initialization
Commit 60801696667d ("plat: arm: refactor GIC initialization") converts functions gic_init_base_addr() and gic_init() to take physical addresses instead of
plat: arm: fix refactor GIC initialization
Commit 60801696667d ("plat: arm: refactor GIC initialization") converts functions gic_init_base_addr() and gic_init() to take physical addresses instead of virtual, but only converts half the platforms. This causes boot failure on all the others.
Convert the rest here.
Fixes: 60801696667d ("plat: arm: refactor GIC initialization") Signed-off-by: Andrew Davis <afd@ti.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> [jf: wrap lines >80 characters; cite commit using commonly used format] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 0e467cb0 | 13-Apr-2022 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: add JR interrupt only if CFG_CAAM_ITR=y
Adding the JR interrupt in the OPTEE CAAM driver, even if not used in OPTEE, prevents the Linux CAAM driver from using the JR interrupt on plat
drivers: caam: add JR interrupt only if CFG_CAAM_ITR=y
Adding the JR interrupt in the OPTEE CAAM driver, even if not used in OPTEE, prevents the Linux CAAM driver from using the JR interrupt on platforms sharing the same line of interruption for all job rings.
To dequeue job from the job ring, the Linux CAAM driver would pull the number of jobs done from the output ring slot full register.
The fix is to add the JR interrupt only if CFG_CAAM_ITR=y. This allows the Linux CAAM driver to dequeue jobs faster than polling from a register.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 497dbec8 | 05-Apr-2022 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: fix function definition when CFG_CAAM_NO_ITR=y
There is a bug in the CAAM JR interruption enablement logic. When CFG_CAAM_NO_ITR=y, the JR interruptions are used and when CFG_CAAM_NO_
drivers: caam: fix function definition when CFG_CAAM_NO_ITR=y
There is a bug in the CAAM JR interruption enablement logic. When CFG_CAAM_NO_ITR=y, the JR interruptions are used and when CFG_CAAM_NO_ITR=n, the JR interruptions are not used.
Even with this wrong logic, the CAAM is still able to enqueue jobs. When no JR interruptions are received, the CAAM will manually dequeue jobs from the jobring by checking the number of jobs done in the output ring slots full register.
CAAM JR interruptions are not mandatory for the CAAM to work properly but it makes the dequeuing faster than polling the output ring slot full register.
To avoid confusion, replace CFG_CAAM_NO_ITR with CFG_CAAM_ITR. The CFG_CAAM_ITR is enabled by default and platforms not using the JR interruptions would have this flag disabled instead.
Fixes: 3f45afc31 ("drivers: caam: disable the use of interrupts for some platforms") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|