aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/arch/aarch64
AgeCommit message (Collapse)Author
2022-05-02linux-gen: sysinfo: use helper macro for calculating array sizeMatias Elo
Use _ODP_ARRAY_SIZE() helper macro for calculating array sizes. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-04-20linux-gen: crypto: arm: remove unused return value from crypto functionsJanne Peltonen
Remove the unused return value from crypto functions. Indicate error in crypto result if required IV is totally missing with deprecated API support. Do not bother setting the error code accurately since the behaviour is anyway undefined after the API usage error. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2022-04-20linux_gen: remove crypto error from packet error flagsJanne Peltonen
Remove the unnecessary crypto_err parse flag from packet header. odp_packet_has_error() is supposed to indicate parse errors not crypto processing errors, which are indicated through odp_crypto_result_t. Remove the flag and its setting in crypto implementations as the flag is not needed and may cause subtle API spec violations. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2022-04-13api: crypto: deprecate odp_crypto_operation()Janne Peltonen
Depracate odp_crypto_operation() and the associated data structures and the completion event. The odp_crypto_operation() function is a bit problematic since it can be synchronous or asynchronous on per-packet basis without application having control on it. Uncontrolled sync versus async behaviour can have adverse effects on packet ordering and application design in general. The function is also somewhat redundant with the newer odp_crypto_op() and odp_crypto_op_enq() functions that provide explicit control on the crypto operation completion behavior. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
2022-03-16linux-gen: crypto: arm: combine cipher and auth into one functionJanne Peltonen
Have only one cipher algorithm specific function pointer in the session instead of separate cipher and auth functions. It fits well AEAD algorithms like AES-GCM which is the only algorithm currently supported. Single crypto processing function per session makes sense also for combinations of individual algorithms that are processed in single pass. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-03-16linux-gen: crypto: arm: optimize authentication tag handlingJanne Peltonen
Use a stack buffer instead of a thread local buffer for the tag to avoid possible overhead of accessing thread-local storage. Use memcpy() instead of the slower packet data copy functions to copy tag to/from a packet when packet data is continuous. Use a compile time constant for tag length since only one tag length is supported. This improves optimization of memcpy() etc. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-03-16linux-gen: crypto: arm: use constant length memcpy for AADJanne Peltonen
Call memcpy() with a constant length when copying AAD to a temporary buffer. This way the generic memcpy call gets optimized away and replaced by a couple of loads and stores. Take advantage of the fact that the implementation currently supports only 8 and 12 byte AAD. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-03-16linux-gen: crypto: arm: avoid unneeded packet data copyJanne Peltonen
When a packet is not segmented, perform crypto operation in-place to avoid copying output data from a temporary buffer back to the packet. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-03-08linux-gen: use _odp_u128_t instead of __int128Jere Leppänen
Replace usage of __int128 and __int128_t with _odp_u128_t. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2022-03-08linux-gen: use new 128-bit integer typeJere Leppänen
Use _odp_u128_t instead of various ad hoc typedefs. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2022-03-02api: crypto: remove deprecated authentication algorithm fieldsMatias Elo
Remove deprecated fields 'md5_96', 'sha256_128', and 'aes128_gcm' from odp_crypto_auth_algos_t. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2022-03-02api: crypto: remove deprecated cipher algorithm fieldsMatias Elo
Remove deprecated fields 'aes128_cbc' and 'aes128_gcm' from odp_crypto_cipher_algos_t. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2022-03-02api: crypto: remove deprecated crypto authentication algorithmsMatias Elo
Remove deprecated crypto authentication algorithms ODP_AUTH_ALG_MD5_96, ODP_AUTH_ALG_SHA256_128, and ODP_AUTH_ALG_AES128_GCM. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2022-03-02api: crypto: remove deprecated crypto cipher algorithmsMatias Elo
Remove deprecated crypto cipher algorithms ODP_CIPHER_ALG_AES128_CBC and ODP_CIPHER_ALG_AES128_GCM. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2022-02-04linux-gen: packet: add common packet metadata copy functionMatias Elo
Use a single inlined _odp_packet_copy_md() function for copying metadata for both packets and segments. This function is assumed to never fail. A new _odp_packet_copy_md_possible() function may be called beforehand to check that copying packet metadata is possible. For packets the implementation has been optimized as the user area may not have to be always copied. The previous segment metadata copy function wrote only the destination segment's user area pointer, which caused both source and destination segments to use the same area. The old copy function was also missing classifer mark metadata. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2022-02-03linux-gen: crypto: add AES-GCM to armv8cryptoMalvika Gupta
Implement AES-GCM in armv8crypto using the AArch64cryptolib. Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com> Reviewed-by: Govindarajan <govindarajan.mohandoss@arm.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2022-02-03linux-gen: crypto: integrate Aarch64cryptolibMalvika Gupta
Integrate Aarch64cryptolib in the build using pkg-config. Add an autoconf config option to select the crypto implementation to be used and add armv8crypto as an alternative to openssl and null. Add a null crypto based skeleton crypto implementation to be used with the Aarch64cryptolib. Signed-off-by: Govindarajan <govindarajan.mohandoss@arm.com> Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com> Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2022-01-25linux-gen: random: implement true random number generation on aarch64Malvika Gupta
Implement true random data on aarch64 via RNDR register introduced as an extension in Armv8.5-a ISA. Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com> Reviewed-by: Govindarajan <govindarajan.mohandoss@arm.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-11-23linux-gen: arch: add new aarch64 CPU enumerationsPetri Savolainen
Added part number enumerations for ARM V1, N2, A510 and A710 CPUs. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2021-11-08linux-gen: sysinfo: dump aarch64 cpu hardware flagsMalvika Gupta
CPU specific hardware/software features are exposed by the kernel to the userspace through a set of flags called hwcaps, exposed in the auxiliary vector. Userspace software can test for features by acquiring the AT_HWCAP and AT_HWCAP2 entry of the auxiliary vector. These hwcaps are defined in terms of architected system register fields and those exposed in AT_HWCAP and AT_HWCAP2 typically have feature flags associated with them. These mapped feature flags are printed. Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com> Reviewed-by: Govindarajan <govindarajan.mohandoss@arm.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-11-08linux-gen: sysinfo: add compile-time cpu flagsMalvika Gupta
More compile-time CPU flags have been added to test the support for newer AArch64 features. Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-11-08linux-gen: sysinfo: move compile-time cpu flags to cpu_flags.cMalvika Gupta
Detection and printing of compile-flags has been moved to a new file, cpu_flags.c in preparation for dumping the CPU hardware flags. Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-10-21linux-gen: llsc: fix casts to union type build errorsMatias Elo
Fix "ISO C forbids casts to union type" errors when building with 'pedantic' option. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-21linux-gen: fix braced-groups within expressions build errorsMatias Elo
Fix "ISO C forbids braced-groups within expressions" errors when building with 'pedantic' option. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-21linux-gen: fix unsupported types build errorsMatias Elo
Fix "ISO C does not support '__int128' types" errors when building with 'pedantic' option. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-12linux-gen: atomic: explicitly use staddl for 64-bit add/sub release opsMatias Elo
GCC generates LDADDL instructions when using __atomic_fetch_add() on aarch64. Explicitly use STADDL to implement odp_atomic_add_rel_u64() and odp_atomic_sub_rel_u64() functions for better performance. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Govindarajan Mohandoss <govindarajan.mohandoss@arm.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-12linux-gen: atomic: explicitly use staddl for 32-bit add/sub release opsMatias Elo
GCC generates LDADDL instructions when using __atomic_fetch_add() on aarch64. Explicitly use STADDL to implement odp_atomic_add_rel_u32() and odp_atomic_sub_rel_u32() functions for better performance. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Govindarajan Mohandoss <govindarajan.mohandoss@arm.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-10-04linux-gen: atomic: use STADD explicitly for aarch64 atomic add operationsMalvika Gupta
By default, GCC generates the LDADD/LDADDL instruction for atomic add/sub/inc/dec functions. These functions could also be implemented on ARMv8.1 ISA (and above) with the store version, STADD/STADDL instruction which result in better performance for fastpath applications. Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com> Reviewed-by: Govindarajan Mohandoss <govindarajan.mohandoss@arm.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-09-30linux-gen: cpu: refactor inlining codeMatias Elo
Refactor CPU ABI and implementation files to follow common project inlining style. odp_cpu_pause() function is now defined only once per architecture. After this clean-up it's simpler for an implementation to add inlined versions of CPU module functions. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2021-09-03linux-gen: atomic: add missing inline function includeMatias Elo
Previously, inlined atomic functions (atomic_inlines.h) were not included through the API headers in non-ABI compat mode on aarch64 platforms. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-05-31linux-gen: time: implement strict time stamp read functionsPetri Savolainen
Implemented strict versions of local and global time stamp read functions. Moved time register read code into inline functions on ARMv8. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2021-04-16linux-gen: detect cpu cache line size during configureMatias Elo
Detect CPU cache line size automatically on aarch64 systems when abi- compatibility is disabled. Automatic cache line size detection is disabled when cross-compiling. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-03-31linux-gen: sysinfo: add new ARMv8 and v9 enumerationsPetri Savolainen
Added support for ARM ISA versions: ARMv8.7-A, ARMv9.0-A, ARMv9.1-A and ARMv9.2-A. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-03-29linux-gen: bitset: move aarch64 specific code to arch filesMalvika Gupta
On arm64 systems, the build fails with the --disable-host-optimization compiler flag as it is unable to locate definitions of lockless APIs used in atomic bit operations since these declarations are present in arch/aarch64/odp_atomic.h files Consequently, the aarch64 specific code has been moved to the arch-specific file while the reminder code has been moved under the default linux-generic implementation. Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com> Reviewed-by: Govindarajan Mohandoss <govindarajan.mohandoss@arm.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-03-23linux-gen: queue_lf: move aarch64 specific code to arch filesMalvika Gupta
On arm64 systems, the build fails with the --disable-host-optimization compiler flag as it is unable to locate definitions of lockless APIs present in arch/aarch64/odp_atomic.h files. Consequently, the aarch64 specific code in odp_queue_lf.c has been moved to the arch-specific file while the reminder code has been added to a new file under the default linux-generic implementation. Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com> Reviewed-by: Govindarajan Mohandoss <govindarajan.mohandoss@arm.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-03-19linux-gen: atomic: optimize arm64 128-bit implementationMatias Elo
Optimize arm64 specific 128-bit atomics implementation. The init function doesn't have to be atomic and CAS operations' 'old_val' needs to be updated only on failure. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-03-19linux-gen: atomics: implement 128-bit operations using gcc builtinsMatias Elo
Add new implementation for the 128-bit atomic operations using GCC builtin atomics. This improves performance considerably compared to the basic lock-based implementation. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-03-19linux-gen: atomic: move odp_atomic_lock_free implementations under archMatias Elo
Enables architecture specific implementations. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-03-19linux-gen: atomic: reorganize architecture specific implementationsMatias Elo
Move architecture specific atomic function implementations to separate header files. Enables 128-bit atomic function inlining. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-03-18linux-gen: arch: add ARM part numbersPetri Savolainen
Added part numbers for Cortex-A78 and Neoverse CPUs. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
2021-02-23linux-gen: atomic: add 128 bit atomic apisGovindarajan Mohandoss
Add 128 bit atomic compare-and-swap operations. Signed-off-by: Govindarajan Mohandoss <govindarajan.mohandoss@arm.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Tested-by: Malvika Gupta <Malvika.Gupta@arm.com>
2021-02-12linux-gen: introduce _ODP_UNALIGNED macroJere Leppänen
The _ODP_UNALIGNED pre-processor macro is defined as 1 if the CPU features efficient unaligned memory access, 0 otherwise. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-02-12linux-gen: remove doze()Jere Leppänen
doze() is a trivial wrapper for odp_cpu_pause(). Remove it and call odp_cpu_pause() directly. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-01-26linux-gen: hash: add armv8-a crc32 hash functionsMalvika Gupta
Add Armv8-A architecture-specific CRC32 and CRC32C extensions. Signed-off-by: Malvika Gupta <Malvika.Gupta@arm.com> Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Govindarajan Mohandoss <govindarajan.mohandoss@arm.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2020-12-23linux-gen: rename some global symbols in the static libraryJere Leppänen
Rename some symbols that are global in the static library, in order to avoid clashes with application code. The prefix "_odp_" is added to the existing names. This patch renames most of the global symbols, a few more still remain to be renamed. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2020-12-03linux-gen: system: set cpu_isa_hw based on ARM part numberPetri Savolainen
CPU ISA version is filled in when part number of an ARMv8 device is recognized. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2020-11-18linux-gen: sysinfo: implement system info callPetri Savolainen
Implement the new odp_system_info() function. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Govindarajan Mohandoss <Govindarajan.Mohandoss@arm.com>
2020-08-31linux-gen: remove implementation internal printf() callsMatias Elo
Use internal ODP_PRINT macro instead of printf(). ODP_PRINT enables using application specific logging function. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reported-by: Mikko Kurikka <mikko.kurikka@nokia.com>
2020-07-10linux-gen: sysinfo: update ARM feature macrosPetri Savolainen
Updated the list of ARM predefined macros to be printed. List of feature macros can be used e.g. to check that compiler has been set up to generate code for the correct ARM ISA level. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-and-tested-by: Jerin Jacob <jerinj@marvell.com>
2020-07-10linux-gen: sysinfo: update ARM ISA version number detectionPetri Savolainen
Current Arm C Language Extensions (ACLE) documentation defines that from v8.1 onwards __ARM_ARCH value includes the minor version number. This applies to more recent compilers. Older compilers set __ARM_ARCH value to 8 also when building for v8.1. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-and-tested-by: Jerin Jacob <jerinj@marvell.com>