| #
3e530d8e |
| 23-Aug-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
backtrace: Print backtrace in assert() and panic()
When any of these functions is called the backtrace will be printed to the console.
Change-Id: Id60842df824b320c485a9323ed6b80600f4ebe35 Signed-of
backtrace: Print backtrace in assert() and panic()
When any of these functions is called the backtrace will be printed to the console.
Change-Id: Id60842df824b320c485a9323ed6b80600f4ebe35 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| #
0c62883f |
| 21-Aug-2018 |
Douglas Raillard <douglas.raillard@arm.com> |
backtrace: Introduce backtrace function
This function diplays the backtrace, the current EL and security state to allow a post-processing tool to choose the right binary to interpret the dump.
The
backtrace: Introduce backtrace function
This function diplays the backtrace, the current EL and security state to allow a post-processing tool to choose the right binary to interpret the dump.
The output can be fed to GNU addr2line to resolve function names given an ELF binary compiled with debug information. The "-i" flag is recommended to improve display in case of inlined functions. The *.dump files generated during the build process can also be used.
The function works in AArch64 and AArch32. In AArch32 it only works in A32 mode (without T32 interworking), which is enforced in the Makefile.
Sample output of a backtrace at EL3:
BACKTRACE: START: function_name 0: EL3: 0x798 1: EL3: 0x538 2: EL3: 0x550 3: EL3: 0x55c 4: EL3: 0x568 5: EL3: 0x5a8 6: EL3: 0xf4 BACKTRACE: END: function_name
In order to enable it the new option ENABLE_BACKTRACE must be set to 1. This option is set to 1 by default only in AArch64 debug builds. As usual, it can be overridden by the platform makefile and in the build command line.
Change-Id: Icaff39b0e5188329728be2f3c72b868b2368e794 Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com> Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
show more ...
|
| #
6d4f6aea |
| 22-Aug-2018 |
Dimitris Papastamos <dimitris.papastamos@arm.com> |
Merge pull request #1528 from antonio-nino-diaz-arm/an/libc
libc: Cleanup library
|
| #
870ce3dd |
| 15-Aug-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
libc: Move tf_printf and tf_snprintf to libc
Change their names to printf and snprintf. They are much smaller than the previous versions we had, which makes them better suited for the Trusted Firmwa
libc: Move tf_printf and tf_snprintf to libc
Change their names to printf and snprintf. They are much smaller than the previous versions we had, which makes them better suited for the Trusted Firmware.
Change-Id: Ia872af91b7b967c47fce012eccecede7873a3daf Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| #
cb6dbfe3 |
| 15-Aug-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
tf_printf: Return number of printed characters
The C standard says that printf() has to return the number of characters it has printed.
Change-Id: I0ef50b1d6766d140724ac0a2fa2c5d023431f984 Signed-o
tf_printf: Return number of printed characters
The C standard says that printf() has to return the number of characters it has printed.
Change-Id: I0ef50b1d6766d140724ac0a2fa2c5d023431f984 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| #
93c78ed2 |
| 16-Aug-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
libc: Fix all includes in codebase
The codebase was using non-standard headers. It is needed to replace them by the correct ones so that we can use the new libc headers.
Change-Id: I530f71d9510cb03
libc: Fix all includes in codebase
The codebase was using non-standard headers. It is needed to replace them by the correct ones so that we can use the new libc headers.
Change-Id: I530f71d9510cb036e69fe79823c8230afe890b9d Acked-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| #
344e4037 |
| 18-Jul-2018 |
Soby Mathew <soby.mathew@arm.com> |
Merge pull request #1480 from sandrine-bailleux-arm/topics/sb/debug-macros
Always compile debug macros
|
| #
cf24229e |
| 20-Jun-2018 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
Run compiler on debug macros for type checking
Even if the log output is too low for a message to be printed out on the console by the debug macros, it should still be evaluated by the compiler to g
Run compiler on debug macros for type checking
Even if the log output is too low for a message to be printed out on the console by the debug macros, it should still be evaluated by the compiler to get some type checking and validation of the format specifiers. To do so, introduce the no_tf_log() macro that encloses the call to tf_log() in an always-false condition.
This avoids the problem of discovering build issues only when we build the firmware with the right LOG_LEVEL value.
Change-Id: Ic0fd252ab691d0187fd925756a4837aca1cbfd7b Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
show more ...
|
| #
b4f4a2f0 |
| 18-Sep-2017 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #1093 from soby-mathew/eb/log_fw
Implement log framework
|
| #
7f56e9a3 |
| 04-Sep-2017 |
Soby Mathew <soby.mathew@arm.com> |
Implement log framework
This patch gives users control over logging messages printed from the C code using the LOG macros defined in debug.h Users now have the ability to reduce the log_level at run
Implement log framework
This patch gives users control over logging messages printed from the C code using the LOG macros defined in debug.h Users now have the ability to reduce the log_level at run time using the tf_log_set_max_level() function. The default prefix string can be defined by platform by overriding the `plat_log_get_prefix()` platform API which is also introduced in this patch.
The new log framework results in saving of some RO data. For example, when BL1 is built for FVP with LOG_LEVEL=LOG_LEVEL_VERBOSE, resulted in saving 384 bytes of RO data and increase of 8 bytes of RW data. The framework also adds about 108 bytes of code to the release build of FVP.
Fixes ARM-software/tf-issues#462
Change-Id: I476013d9c3deedfdd4c8b0b0f125665ba6250554 Co-authored-by: Eleanor Bonnici <Eleanor.bonnici@arm.com> Signed-off-by: Soby Mathew <soby.mathew@arm.com>
show more ...
|
| #
2d7e8282 |
| 04-Sep-2017 |
Soby Mathew <soby.mathew@arm.com> |
Introduce tf_vprintf() and tf_string_print()
This patch introduces tf_vprintf() and tf_string_print() APIs which is needed by the logging framework introduced in a later patch.
Change-Id: Ie4240443
Introduce tf_vprintf() and tf_string_print()
This patch introduces tf_vprintf() and tf_string_print() APIs which is needed by the logging framework introduced in a later patch.
Change-Id: Ie4240443d0e04e070502b51e371e546dd469fd33 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
show more ...
|
| #
572e1413 |
| 30-May-2017 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #949 from antonio-nino-diaz-arm/an/printf-memory
Reduce code size when building with Trusted Board Boot enabled
|
| #
da5241cb |
| 17-May-2017 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
Introduce `tf_snprintf`
This is a reduced version of `snprintf` that only supports formats '%d', '%i' and '%u'. It can be used when the full `snprintf` is not needed in order to save memory. If it f
Introduce `tf_snprintf`
This is a reduced version of `snprintf` that only supports formats '%d', '%i' and '%u'. It can be used when the full `snprintf` is not needed in order to save memory. If it finds an unknown format specifier, it prints an error message and panics.
Change-Id: I2cb06fcdf74cda2c43caf73ae0762a91499fc04e Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
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 ...
|
| #
ed756252 |
| 06-Apr-2017 |
davidcunado-arm <david.cunado@arm.com> |
Merge pull request #886 from dp-arm/dp/stack-protector
Add support for GCC stack protection
|
| #
51faada7 |
| 24-Feb-2017 |
Douglas Raillard <douglas.raillard@arm.com> |
Add support for GCC stack protection
Introduce new build option ENABLE_STACK_PROTECTOR. It enables compilation of all BL images with one of the GCC -fstack-protector-* options.
A new platform funct
Add support for GCC stack protection
Introduce new build option ENABLE_STACK_PROTECTOR. It enables compilation of all BL images with one of the GCC -fstack-protector-* options.
A new platform function plat_get_stack_protector_canary() is introduced. It returns a value that is used to initialize the canary for stack corruption detection. Returning a random value will prevent an attacker from predicting the value and greatly increase the effectiveness of the protection.
A message is printed at the ERROR level when a stack corruption is detected.
To be effective, the global data must be stored at an address lower than the base of the stacks. Failure to do so would allow an attacker to overwrite the canary as part of an attack which would void the protection.
FVP implementation of plat_get_stack_protector_canary is weak as there is no real source of entropy on the FVP. It therefore relies on a timer's value, which could be predictable.
Change-Id: Icaaee96392733b721fa7c86a81d03660d3c1bc06 Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
show more ...
|
| #
b26c222a |
| 29-Mar-2016 |
danh-arm <dan.handley@arm.com> |
Merge pull request #559 from soby-mathew/sm/cpu_ops_verbose_log
Make cpu operations warning a VERBOSE print
|
| #
1319e7b1 |
| 21-Mar-2016 |
Soby Mathew <soby.mathew@arm.com> |
Make cpu operations warning a VERBOSE print
The assembler helper function `print_revision_warning` is used when a CPU specific operation is enabled in the debug build (e.g. an errata workaround) but
Make cpu operations warning a VERBOSE print
The assembler helper function `print_revision_warning` is used when a CPU specific operation is enabled in the debug build (e.g. an errata workaround) but doesn't apply to the executing CPU's revision/part number. However, in some cases the system integrator may want a single binary to support multiple platforms with different IP versions, only some of which contain a specific erratum. In this case, the warning can be emitted very frequently when CPUs are being powered on/off.
This patch modifies this warning print behaviour so that it is emitted only when LOG_LEVEL >= LOG_LEVEL_VERBOSE. The `debug.h` header file now contains guard macros so that it can be included in assembly code.
Change-Id: Ic6e7a07f128dcdb8498a5bfdae920a8feeea1345
show more ...
|
| #
420c5242 |
| 17-Mar-2015 |
danh-arm <dan.handley@arm.com> |
Merge pull request #262 from sandrine-bailleux/sb/check-format-printf
Enable type-checking of arguments passed to printf() et al.
|
| #
dad25049 |
| 05-Feb-2015 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
Enable type-checking of arguments passed to printf() et al.
This patch modifies the declarations of the functions printf() et al. and adds the right GCC attribute to request the compiler to check th
Enable type-checking of arguments passed to printf() et al.
This patch modifies the declarations of the functions printf() et al. and adds the right GCC attribute to request the compiler to check the type of the arguments passed to these functions against the given format string. This will ensure that the compiler outputs warning messages like the following whenever it detects an inconsistency:
file.c:42: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long int’
It also fixes the type mismatch inconsistencies that it revealed across the code base.
NOTE: THIS PATCH MAY FORCE PLATFORM PORTS OR SP/SPDS THAT USE THE PRINTF FAMILY OF FUNCTIONS TO FIX ANY TYPE MISMATCH INCONSISTENCIES.
Change-Id: If36bb54ec7d6dd2cb4791d89b02a24ac13fd2df6
show more ...
|
| #
6f08fd5f |
| 12-Aug-2014 |
danh-arm <dan.handley@arm.com> |
Merge pull request #183 from danh-arm/dh/print_output2
Add concept of console output log levels
Rationalize console log output
|
| #
289c28a8 |
| 08-Aug-2014 |
Dan Handley <dan.handley@arm.com> |
Add concept of console output log levels
Create new LOG_LEVEL build option, which controls the amount of console output compiled into the build. This should be one of the following:
0 (LOG_LEV
Add concept of console output log levels
Create new LOG_LEVEL build option, which controls the amount of console output compiled into the build. This should be one of the following:
0 (LOG_LEVEL_NONE) 10 (LOG_LEVEL_NOTICE) 20 (LOG_LEVEL_ERROR) 30 (LOG_LEVEL_WARNING) 40 (LOG_LEVEL_INFO) 50 (LOG_LEVEL_VERBOSE)
All log output up to and including the log level is compiled into the build. The default value is 40 in debug builds and 20 in release builds.
Complement the existing INFO, WARN and ERROR console output macros with NOTICE and VERBOSE macros, which are conditionally compiled in depending on the value of LOG_LEVEL.
Fixes ARM-software/tf-issues#232
Change-Id: I951e2f333e7b90fc4b1060741d9a6db699d5aa72
show more ...
|
| #
6397bf6a |
| 28-Jul-2014 |
danh-arm <dan.handley@arm.com> |
Merge pull request #172 from soby-mathew/sm/asm_assert
Introduce asm assert and optimize crash reporting
|
| #
626ed510 |
| 25-Jun-2014 |
Soby Mathew <soby.mathew@arm.com> |
Rework the crash reporting in BL3-1 to use less stack
This patch reworks the crash reporting mechanism to further optimise the stack and code size. The reporting makes use of assembly console functi
Rework the crash reporting in BL3-1 to use less stack
This patch reworks the crash reporting mechanism to further optimise the stack and code size. The reporting makes use of assembly console functions to avoid calling C Runtime to report the CPU state. The crash buffer requirement is reduced to 64 bytes with this implementation. The crash buffer is now part of per-cpu data which makes retrieving the crash buffer trivial.
Also now panic() will use crash reporting if invoked from BL3-1.
Fixes ARM-software/tf-issues#199
Change-Id: I79d27a4524583d723483165dc40801f45e627da5
show more ...
|