| #
b1e1f42e |
| 25-Apr-2025 |
Govindraj Raja <govindraj.raja@arm.com> |
Merge changes I005586ef,I0d4d74bc into integration
* changes: fix(cpufeat): replace "bti" mnemonic with hint instructions fix(cpufeat): improve xpaci wrapper
|
| #
bdac600b |
| 15-Apr-2025 |
Andre Przywara <andre.przywara@arm.com> |
fix(cpufeat): replace "bti" mnemonic with hint instructions
Older GNU binutils version require to specify at least "armv8.5-a" for the ARM architecture revision to accept "bti" instructions in the a
fix(cpufeat): replace "bti" mnemonic with hint instructions
Older GNU binutils version require to specify at least "armv8.5-a" for the ARM architecture revision to accept "bti" instructions in the assembly code. Binutils v2.35 have relaxed this, since "bti" is in the hint space, so is ignored on older cores and does NOT require a BTI enabled core to execute.
To not exclude those older binutils versions (as shipped with Ubuntu 20.04), use the "hint" encoding for the "bti" instructions, which are accepted regardless of the minimum architecture revision. Hide this encoding in a macro, to make the "bti" usage more readable in the source code.
Change-Id: I005586efd8974a3f2c7202896c881bb5fed07eea Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| #
508a48bb |
| 24-May-2019 |
Paul Beesley <paul.beesley@arm.com> |
Merge "Add support for Branch Target Identification" into integration
|
| #
9fc59639 |
| 24-May-2019 |
Alexei Fedorov <Alexei.Fedorov@arm.com> |
Add support for Branch Target Identification
This patch adds the functionality needed for platforms to provide Branch Target Identification (BTI) extension, introduced to AArch64 in Armv8.5-A by add
Add support for Branch Target Identification
This patch adds the functionality needed for platforms to provide Branch Target Identification (BTI) extension, introduced to AArch64 in Armv8.5-A by adding BTI instruction used to mark valid targets for indirect branches. The patch sets new GP bit [50] to the stage 1 Translation Table Block and Page entries to denote guarded EL3 code pages which will cause processor to trap instructions in protected pages trying to perform an indirect branch to any instruction other than BTI. BTI feature is selected by BRANCH_PROTECTION option which supersedes the previous ENABLE_PAUTH used for Armv8.3-A Pointer Authentication and is disabled by default. Enabling BTI requires compiler support and was tested with GCC versions 9.0.0, 9.0.1 and 10.0.0. The assembly macros and helpers are modified to accommodate the BTI instruction. This is an experimental feature. Note. The previous ENABLE_PAUTH build option to enable PAuth in EL3 is now made as an internal flag and BRANCH_PROTECTION flag should be used instead to enable Pointer Authentication. Note. USE_LIBROM=1 option is currently not supported.
Change-Id: Ifaf4438609b16647dc79468b70cd1f47a623362e Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
show more ...
|
| #
9d068f66 |
| 08-Nov-2018 |
Antonio Niño Díaz <antonio.ninodiaz@arm.com> |
Merge pull request #1673 from antonio-nino-diaz-arm/an/headers
Standardise header guards across codebase
|
| #
c3cf06f1 |
| 08-Nov-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
Standardise header guards across codebase
All identifiers, regardless of use, that start with two underscores are reserved. This means they can't be used in header guards.
The style that this proje
Standardise header guards across codebase
All identifiers, regardless of use, that start with two underscores are reserved. This means they can't be used in header guards.
The style that this project is now to use the full name of the file in capital letters followed by 'H'. For example, for a file called "uart_example.h", the header guard is UART_EXAMPLE_H.
The exceptions are files that are imported from other projects:
- CryptoCell driver - dt-bindings folders - zlib headers
Change-Id: I50561bf6c88b491ec440d0c8385c74650f3c106e Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| #
9a93d8cc |
| 11-Jul-2018 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
Merge pull request #1460 from robertovargas-arm/clang
Make TF compatible with Clang assembler and linker
|
| #
b2805dab |
| 17-Apr-2018 |
Roberto Vargas <roberto.vargas@arm.com> |
Remove .func and .endfunc assembler directives
These directives are only used when stabs debugging information is used, but we use ELF which uses DWARF debugging information. Clang assembler doesn't
Remove .func and .endfunc assembler directives
These directives are only used when stabs debugging information is used, but we use ELF which uses DWARF debugging information. Clang assembler doesn't support these directives, and removing them makes the code more compatible with clang.
Change-Id: I2803f22ebd24c0fe248e04ef1b17de9cec5f89c4 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
show more ...
|
| #
0d3a27e7 |
| 19-Jan-2018 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1200 from robertovargas-arm/bl2-el3
Add BL2_AT_EL3 build option
|
| #
d1f7292e |
| 02-Nov-2017 |
Roberto Vargas <roberto.vargas@arm.com> |
Mark functions defined in assembly files
This patch change the name of the section containing the functions defined in assembly files from text.* to text.asm.*. This change makes possible to select
Mark functions defined in assembly files
This patch change the name of the section containing the functions defined in assembly files from text.* to text.asm.*. This change makes possible to select in the linker script the functions defined in those files.
Change-Id: If35e44ef1b43ffd951dfac5e052db75d7198e2e0 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
show more ...
|
| #
e524d78f |
| 06-Sep-2017 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1076 from masahir0y/asm_macro
asm_macros: set the default assembly code alignment to 4 byte
|
| #
fed18b3a |
| 31-Aug-2017 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
asm_macros: set the default assembly code alignment to 4 byte
Assembly routines are usually defined by using "func" and "endfunc":
func foo ... endfunc foo
Currently, the "func" macr
asm_macros: set the default assembly code alignment to 4 byte
Assembly routines are usually defined by using "func" and "endfunc":
func foo ... endfunc foo
Currently, the "func" macro does not specify ".align" directive by default. It causes unaligned instruction under some circumstances.
As far as I tested, this problem happens for GCC 5 or older. It did not happen for GCC 6 or newer. Taking into account that GCC 4.x / 5.x is still used, make sure that assembly code is at least 4 byte aligned.
[ How to reproduce the problem ]
For example, use GCC 5.3 downloaded from Linaro: http://releases.linaro.org/components/toolchain/binaries/5.3-2016.05/ aarch64-linux-gnu/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu.tar.xz
Expand mbedtls-2.4.2 to the current directory.
Try the following:
$ git log --oneline -1 77544ef Merge pull request #1071 from jeenu-arm/syntax-fix $ aarch64-linux-gnu-gcc --version | head -1 aarch64-linux-gnu-gcc (Linaro GCC 5.3-2016.05) 5.3.1 20160412 $ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=uniphier \ TRUSTED_BOARD_BOOT=1 MBEDTLS_DIR=mbedtls-2.4.2 ( snip build log ) $ aarch64-linux-gnu-nm build/uniphier/release/bl1/bl1.elf | grep handler 00000000800088f4 T bl1_fwu_smc_handler 00000000800084c8 T bl1_smc_handler 000000008000a6e0 t _panic_handler 000000008000a8e0 W plat_error_handler 000000008000a8e8 W plat_panic_handler 000000008000a8d8 W plat_reset_handler 000000008000a39f T reset_handler 000000008000a367 t smc_handler 000000008000a2ef t smc_handler64
You will notice "smc_handler64", "reset_handler", etc. are not properly aligned.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
| #
2458e37a |
| 22-Aug-2017 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1053 from jwerner-chromium/JW_func_align
Add new alignment parameter to func assembler macro
|
| #
64726e6d |
| 01-Aug-2017 |
Julius Werner <jwerner@chromium.org> |
Add new alignment parameter to func assembler macro
Assembler programmers are used to being able to define functions with a specific aligment with a pattern like this:
.align X myfunction:
H
Add new alignment parameter to func assembler macro
Assembler programmers are used to being able to define functions with a specific aligment with a pattern like this:
.align X myfunction:
However, this pattern is subtly broken when instead of a direct label like 'myfunction:', you use the 'func myfunction' macro that's standard in Trusted Firmware. Since the func macro declares a new section for the function, the .align directive written above it actually applies to the *previous* section in the assembly file, and the function it was supposed to apply to is linked with default alignment.
An extreme case can be seen in Rockchip's plat_helpers.S which contains this code:
[...] endfunc plat_crash_console_putc
.align 16 func platform_cpu_warmboot [...]
This assembles into the following plat_helpers.o:
Sections: Idx Name Size [...] Algn 9 .text.plat_crash_console_putc 00010000 [...] 2**16 10 .text.platform_cpu_warmboot 00000080 [...] 2**3
As can be seen, the *previous* function actually got the alignment constraint, and it is also 64KB big even though it contains only two instructions, because the .align directive at the end of its section forces the assembler to insert a giant sled of NOPs. The function we actually wanted to align has the default constraint. This code only works at all because the linker just happens to put the two functions right behind each other when linking the final image, and since the end of plat_crash_console_putc is aligned the start of platform_cpu_warmboot will also be. But it still wastes almost 64KB of image space unnecessarily, and it will break under certain circumstances (e.g. if the plat_crash_console_putc function becomes unused and its section gets garbage-collected out).
There's no real way to fix this with the existing func macro. Code like
func myfunc .align X
happens to do the right thing, but is still not really correct code (because the function label is inserted before the .align directive, so the assembler is technically allowed to insert padding at the beginning of the function which would then get executed as instructions if the function was called). Therefore, this patch adds a new parameter with a default value to the func macro that allows overriding its alignment.
Also fix up all existing instances of this dangerous antipattern.
Change-Id: I5696a07e2fde896f21e0e83644c95b7b6ac79a10 Signed-off-by: Julius Werner <jwerner@chromium.org>
show more ...
|
| #
f132b4a0 |
| 04-May-2017 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #925 from dp-arm/dp/spdx
Use SPDX license identifiers
|
| #
82cb2c1a |
| 03-May-2017 |
dp-arm <dimitris.papastamos@arm.com> |
Use SPDX license identifiers
To make software license auditing simpler, use SPDX[0] license identifiers instead of duplicating the license text in every file.
NOTE: Files that have been imported by
Use SPDX license identifiers
To make software license auditing simpler, use SPDX[0] license identifiers instead of duplicating the license text in every file.
NOTE: Files that have been imported by FreeBSD have not been modified.
[0]: https://spdx.org/
Change-Id: I80a00e1f641b8cc075ca5a95b10607ed9ed8761a Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
show more ...
|
| #
2fa94890 |
| 23-Nov-2016 |
danh-arm <dan.handley@arm.com> |
Merge pull request #763 from douglas-raillard-arm/dr/add_debug_frame_info
Add CFI debug frame information for ASM functions
|
| #
b91d935f |
| 21-Nov-2016 |
Douglas Raillard <douglas.raillard@arm.com> |
Add CFI debug frame information for ASM functions
This allows the debugger to print the callstack when there is an assembly function in the callstack.
It will work as long as the CFA pointer (frame
Add CFI debug frame information for ASM functions
This allows the debugger to print the callstack when there is an assembly function in the callstack.
It will work as long as the CFA pointer (frame pointer) location is not modified (i.e. x29 is not touched in AArch64 state). It is the case in almost all assembly functions, so this patch improves the average debugging experience. Call stacks from the debugger should still be interpreted with care. In more complex functions, one could use .cfi* directives to inform the debugger about the new location of the CFA pointer.
Change-Id: I9dabfbc033b45e8528e67f4823c17de7bf02fa24 Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
show more ...
|
| #
937108a0 |
| 18-Aug-2016 |
danh-arm <dan.handley@arm.com> |
Merge pull request #678 from soby-mathew/sm/PSCI_AArch32
Introduce AArch32 support for PSCI library
|
| #
f24307de |
| 05-May-2016 |
Soby Mathew <soby.mathew@arm.com> |
AArch32: Add assembly helpers
This patch adds various assembly helpers for AArch32 like :
* cache management : Functions to flush, invalidate and clean cache by MVA. Also helpers to do cache operat
AArch32: Add assembly helpers
This patch adds various assembly helpers for AArch32 like :
* cache management : Functions to flush, invalidate and clean cache by MVA. Also helpers to do cache operations by set-way are also added.
* stack management: Macros to declare stack and get the current stack corresponding to current CPU.
* Misc: Macros to access co processor registers in AArch32, macros to define functions in assembly, assert macros, generic `do_panic()` implementation and function to zero block of memory.
Change-Id: I7b78ca3f922c0eda39beb9786b7150e9193425be
show more ...
|
| #
3dd9835f |
| 25-Jul-2016 |
danh-arm <dan.handley@arm.com> |
Merge pull request #667 from soby-mathew/sm/PSCI_lib
Introduce PSCI library
|
| #
738b1fd7 |
| 08-Jul-2016 |
Soby Mathew <soby.mathew@arm.com> |
Rearrange assembly helper macros
This patch moves assembler macros which are not architecture specific to a new file `asm_macros_common.S` and moves the `el3_common_macros.S` into `aarch64` specific
Rearrange assembly helper macros
This patch moves assembler macros which are not architecture specific to a new file `asm_macros_common.S` and moves the `el3_common_macros.S` into `aarch64` specific folder.
Change-Id: I444a1ee3346597bf26a8b827480cd9640b38c826
show more ...
|