History log of /optee_os/core/arch/arm/include/arm64.h (Results 1 – 25 of 63)
Revision Date Author Comments
# cd2d617e 25-Jun-2025 Jens Wiklander <jens.wiklander@linaro.org>

core: arm64.h: add {read,write}_cntp_{ct,tva,cva}l()

Add wrapper functions to read and write to the EL1 physical timer
registers cntp_ctl_el0, cntp_tval_el0, and cntp_cval_el0. These
registers are u

core: arm64.h: add {read,write}_cntp_{ct,tva,cva}l()

Add wrapper functions to read and write to the EL1 physical timer
registers cntp_ctl_el0, cntp_tval_el0, and cntp_cval_el0. These
registers are used when using the Arm Generic Timer with
CFG_CORE_SEL2_SPMC=y (Hafnium as SPMC at S-EL2).

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>

show more ...


# 325d4963 11-Oct-2023 Gatien Chevallier <gatien.chevallier@foss.st.com>

core: add platform-specific abort handler

Platforms may have specific code to handle an abort when fault type
is FAULT_TYPE_IGNORE. Add plat_abort_handler() that can be overridden
at platform level

core: add platform-specific abort handler

Platforms may have specific code to handle an abort when fault type
is FAULT_TYPE_IGNORE. Add plat_abort_handler() that can be overridden
at platform level.

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

show more ...


# dc9fd53b 14-Jun-2024 Jerome Forissier <jerome.forissier@linaro.org>

arm64.h: fix compile error with Clang

Clang 18.1.6 fails to compile OP-TEE OS with the following error:

CC out/arm/core/arch/arm/kernel/vfp.o
In file included from core/arch/arm/kernel/vfp

arm64.h: fix compile error with Clang

Clang 18.1.6 fails to compile OP-TEE OS with the following error:

CC out/arm/core/arch/arm/kernel/vfp.o
In file included from core/arch/arm/kernel/vfp.c:6:
In file included from core/arch/arm/include/arm.h:137:
core/arch/arm/include/arm64.h:455:1: error: expected readable system register
455 | DEFINE_U32_REG_READWRITE_FUNCS(fpcr)
| ^
core/arch/arm/include/arm64.h:436:3: note: expanded from macro 'DEFINE_U32_REG_READWRITE_FUNCS'
436 | DEFINE_U32_REG_READ_FUNC(reg) \
| ^
core/arch/arm/include/arm64.h:430:3: note: expanded from macro 'DEFINE_U32_REG_READ_FUNC'
430 | DEFINE_REG_READ_FUNC_(reg, uint32_t, reg)
| ^
core/arch/arm/include/arm64.h:417:15: note: expanded from macro 'DEFINE_REG_READ_FUNC_'
417 | asm volatile("mrs %0, " #asmreg : "=r" (val64)); \
| ^
<inline asm>:1:10: note: instantiated into assembly here
1 | mrs x8, fpcr
| ^

...and similar ones for fpcr write, as well as fpsr read and write.

Clang 12.0.0 does not have any problem with this code which makes me
think that it's a Clang/LLVM issue.

Work around the problem by using the coded system register identifiers
S3_3_c4_c4_0 and S3_3_c4_c4_1 instead of fpcr and fpsr, respectively.
The values 3-3-4-4-0 and 3-3-4-4-1 are taken from the Arm ARM sections
C.5.2.8 and C.5.2.9.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Joakim Bech <joakim.bech@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 2d8644ee 31-Jan-2024 Jens Wiklander <jens.wiklander@linaro.org>

core: arm64: add {read,write}_cntps_cval()

Add read_cntps_cval() and write_cntps_cval() to access CNTPS_CVAL_EL1,
Counter-timer Physical Secure Timer CompareValue register.

Signed-off-by: Jens Wikl

core: arm64: add {read,write}_cntps_cval()

Add read_cntps_cval() and write_cntps_cval() to access CNTPS_CVAL_EL1,
Counter-timer Physical Secure Timer CompareValue register.

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

show more ...


# 8a4a051b 21-Feb-2024 Igor Opaniuk <igor.opaniuk@foundries.io>

core: arm64: remove ID_AA64ISAR0_EL1 macros

Remove old definitions for ID_AA64ISAR0_EL1 CRC32 bitmask
and shift.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander

core: arm64: remove ID_AA64ISAR0_EL1 macros

Remove old definitions for ID_AA64ISAR0_EL1 CRC32 bitmask
and shift.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>

show more ...


# f9aaf11e 17-Feb-2024 Igor Opaniuk <igor.opaniuk@foundries.io>

core: arm64: add masks for ID_AA64ISAR0_EL1 fields

Add masks for obtaining Crypto Extensions support status from
ID_AA64ISAR0_EL1 register:

Algo Bits
SM4 - [43:40]
SM3 - [39:36]
SHA

core: arm64: add masks for ID_AA64ISAR0_EL1 fields

Add masks for obtaining Crypto Extensions support status from
ID_AA64ISAR0_EL1 register:

Algo Bits
SM4 - [43:40]
SM3 - [39:36]
SHA3 - [35:32]
RDM - [31:28]
TME - [27:24]
Atomic - [23:20]
CRC32 - [19:16]
SHA2 - [15:12]
SHA1 - [11:8]
AES - [7:4]

For additional details check ARM Architecture Reference Manual
for ARMv8-A architecture profile.
ID_AA64ISAR0_EL1, AArch64 Instruction Set Attribute Register 0.

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

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 ...


# 4fc6c591 03-Jan-2024 Zexi Yu <yuzexi@hisilicon.com>

core: arm64: read_64bit_pair()

Implement read_64bit_pair that read two 64 bits data together.

Signed-off-by: Zexi Yu <yuzexi@hisilicon.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>


# 40613a28 13-Dec-2023 Jens Wiklander <jens.wiklander@linaro.org>

core: arm64.h: add read_id_aa64mmfr0_el1()

Add a read function for the system register ID_AA64MMFR0_EL1 and the
mask ID_AA64MMFR0_EL1_PARANGE_MASK to extract the PARange field.

Signed-off-by: Jens

core: arm64.h: add read_id_aa64mmfr0_el1()

Add a read function for the system register ID_AA64MMFR0_EL1 and the
mask ID_AA64MMFR0_EL1_PARANGE_MASK to extract the PARange field.

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

show more ...


# d50fee03 16-Oct-2023 Etienne Carriere <etienne.carriere@foss.st.com>

core: prefix header file guard names with __

Improves header files guard names consistency by using a __ prefix
where missing.

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

core: prefix header file guard names with __

Improves header files guard names consistency by using a __ prefix
where missing.

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

show more ...


# b430491e 13-Sep-2023 Mark-PK Tsai <mark-pk.tsai@mediatek.com>

core: arm64: Add write_icc_sgi1r() and write_icc_asgi1r()

Adds the wrapper function write_icc_sgi1r() and write_icc_asgi1r()
to write ICC_SGI1R and ICC_ASGI1R to generate group 1 SGIs for
the secure

core: arm64: Add write_icc_sgi1r() and write_icc_asgi1r()

Adds the wrapper function write_icc_sgi1r() and write_icc_asgi1r()
to write ICC_SGI1R and ICC_ASGI1R to generate group 1 SGIs for
the secure and non-secure state CPU.

Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# 3dfe8809 08-Aug-2023 Xiaoxu Zeng <zengxiaoxu@huawei.com>

core: arm64: write_64bit_pair()

Implement write_64bit_pair that write two 64 bits data together.

Signed-off-by: Xiaoxu Zeng <zengxiaoxu@huawei.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linar

core: arm64: write_64bit_pair()

Implement write_64bit_pair that write two 64 bits data together.

Signed-off-by: Xiaoxu Zeng <zengxiaoxu@huawei.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# cad31b28 14-Jul-2023 Jens Wiklander <jens.wiklander@linaro.org>

core: arm: add feat_pan_implemented()

Adds the helper function feat_pan_implemented() to extract the
implemented PAN version. No version is 0 so this function can be used
tested as a boolean too.

S

core: arm: add feat_pan_implemented()

Adds the helper function feat_pan_implemented() to extract the
implemented PAN version. No version is 0 so this function can be used
tested as a boolean too.

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

show more ...


# bda43302 11-Jul-2023 Jens Wiklander <jens.wiklander@linaro.org>

arm64: add read_pan() and SPSR_64_PAN

Adds the wrapper function read_pan() to read PSTATE.PAN, also adds a
SPSR_64_PAN define.

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

arm64: add read_pan() and SPSR_64_PAN

Adds the wrapper function read_pan() to read PSTATE.PAN, also adds a
SPSR_64_PAN define.

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

show more ...


# 3579408c 06-Jul-2023 Xiaoxu Zeng <zengxiaoxu@huawei.com>

core: arm64: add dsb_osh()

Implement the use of osh data barrier to ensure that all data
access and modifications have been completed before executing
subsequent instructions.

Signed-off-by: Xiaoxu

core: arm64: add dsb_osh()

Implement the use of osh data barrier to ensure that all data
access and modifications have been completed before executing
subsequent instructions.

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

show more ...


# 6fa59c9a 12-May-2023 Seonghyun Park <seonghp@amazon.com>

arm64: Introduce permissive PAN implementation

Privileged Access Never (PAN) is a part of ARMv8.1 extension that
restricts accesses to unprivileged memory from privileged mode
in order to prevent un

arm64: Introduce permissive PAN implementation

Privileged Access Never (PAN) is a part of ARMv8.1 extension that
restricts accesses to unprivileged memory from privileged mode
in order to prevent unintended accesses to potentially malicious
memory.

This introduces configuration of PAN and helper functions
enter_user_access() and exit_user_access() that toggles PSTATE.PAN
that controls the behavior of PAN.

Current OP-TEE impelmentation is not ready to apply strict PAN policy
due to missing user-access function uses, etc.

Hence, this patch takes a very permissive approach (yet better
than nothing), where PAN is deactivated in the entire lifetime of
thread_svc_handler (i.e., system call).

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

show more ...


# fe16b87b 08-Jun-2023 Alvin Chang <alvinga@andestech.com>

core: mm: Rename "mva" to "va" for TLB operations

The terminology "mva" is specific for older ARM architecture which has
FCSE extension. To support multiple architecture, it would be good to
rename

core: mm: Rename "mva" to "va" for TLB operations

The terminology "mva" is specific for older ARM architecture which has
FCSE extension. To support multiple architecture, it would be good to
rename "mva" to common terminology, such as "va". This PR renames "mva"
to "va" in TLB operations for ARM64 and RISC-V. For ARM32, "mva" is
reserved because it is really defined in ARM32's documentations.

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

show more ...


# d4351c1e 17-Apr-2023 Balint Dobszay <balint.dobszay@arm.com>

core: arm64: add CRC32 HW support discovery

Add helper function to check if the CRC32 instructions are implemented
by the PE.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: J

core: arm64: add CRC32 HW support discovery

Add helper function to check if the CRC32 instructions are implemented
by the PE.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>

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 ...


# 04b9df6c 09-Feb-2022 Jens Wiklander <jens.wiklander@linaro.org>

core: arm{32,64}.h: add "memory" constraint

Adds the missing memory constraint to the inline assembly instructions
isb, dsb, dmb, sev, wfe and wfi.

Reviewed-by: Jerome Forissier <jerome@forissier.o

core: arm{32,64}.h: add "memory" constraint

Adds the missing memory constraint to the inline assembly instructions
isb, dsb, dmb, sev, wfe and wfi.

Reviewed-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Marouene Boubakri <marouene.boubakri@nxp.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


# b4ef3360 10-Jan-2022 Ruchika Gupta <ruchika.gupta@linaro.org>

arm64: Add registers and bits for pointer authentication support

The ARMv8.3 PAuth (pointer authentication) extension adds:

- Fields in register ID_AA64ISAR1 to report the presence of pointer
aut

arm64: Add registers and bits for pointer authentication support

The ARMv8.3 PAuth (pointer authentication) extension adds:

- Fields in register ID_AA64ISAR1 to report the presence of pointer
authentication functionality.
- Control bits in SCTLR_ELx to enable this functionality.
- New registers to hold the keys necessary for this
functionality.
- New ESR_ELx.EC codes used when the new instructions are affected by
configurable traps

These will be used in later patches as support for pointer
authentication is added.

Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

show more ...


123