| 7540cb75 | 27-Apr-2020 |
Etienne Carriere <etienne.carriere@linaro.org> |
libutils: confine_array_index: fix clang build trace for Thumb2
Avoid trace 'deprecated instruction in IT block [-Werror,-Winline-asm]' when building with CLang. The message states performance issue
libutils: confine_array_index: fix clang build trace for Thumb2
Avoid trace 'deprecated instruction in IT block [-Werror,-Winline-asm]' when building with CLang. The message states performance issue which is true but prefer the performance cost over the security flaw hence warning trace is removed without embedded code changed.
Fixes: 2b6dd0df52b4 ("confine_array_index.h: add A32 and T32 versions of confine_array_index()") Suggested-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a73ebd47 | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
util.h: add ROUNDUP_DIV(x, y) macro
Adds the ROUNDUP_DIV(x, y) macro which Rounds up to the nearest multiple of y and then divides by y. Safe against overflow, y has to be a multiple of 2 just as in
util.h: add ROUNDUP_DIV(x, y) macro
Adds the ROUNDUP_DIV(x, y) macro which Rounds up to the nearest multiple of y and then divides by y. Safe against overflow, y has to be a multiple of 2 just as in the other two ROUNDUP*() macros.
This macro is intended to be used to convert from "number of bytes" to "number of pages" or similar units. Example: num_pages = ROUNDUP_DIV(num_bytes, SMALL_PAGE_SIZE);
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2b6dd0df | 03-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
confine_array_index.h: add A32 and T32 versions of confine_array_index()
Adds inline assembly implementations for the A32 and T32 instruction sets. The implementation is based on __load_no_speculate
confine_array_index.h: add A32 and T32 versions of confine_array_index()
Adds inline assembly implementations for the A32 and T32 instruction sets. The implementation is based on __load_no_speculate1() in <speculation_barrier.h>.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ea4ae5cd | 21-Aug-2019 |
Sheetal Tigadoli <sheetal.tigadoli@broadcom.com> |
trace: Add weak platform tracer function
Add weak platform tracer function This would allow each platform to carry out plat specific logging, possibly to some media for post-mortem analysis
Signed-
trace: Add weak platform tracer function
Add weak platform tracer function This would allow each platform to carry out plat specific logging, possibly to some media for post-mortem analysis
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 98d863a5 | 05-Jul-2019 |
Jerome Forissier <jerome@forissier.org> |
Experimental Clang support
Allows building with Clang with "make COMPILER=clang [other flags...]". The clang command has to be in the $PATH, as well as the associated tools (clang-cpp, ld.lld, llvm-
Experimental Clang support
Allows building with Clang with "make COMPILER=clang [other flags...]". The clang command has to be in the $PATH, as well as the associated tools (clang-cpp, ld.lld, llvm-ar, llvm-nm, llvm-objcopy and llvm-readelf).
Tested with Clang built from the master branch of [1] (development version for 9.0):
mkdir build; cd build cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=~/llvm-install \ -DLLVM_ENABLE_PROJECTS="clang;lld" \ -DLLVM_TARGETS_TO_BUILD="AArch64;ARM" \ ~/llvm-project/llvm ninja && ninja install
Limitations:
- CFG_CORE_SANITIZE_KADDRESS=y is not supported. - CFG_WITH_PAGER is supported, but requires that the TEE core be linked with the GNU linker. The reason is documented in mk/clang.mk.
Bug:
- ldelf assertion failure in xtest 1019 when CFG_ULIBS_SHARED=y (QEMU) E/LD: assertion 'maps[map_idx].sz == sz' failed at ldelf/ta_elf.c:1114 in ta_elf_print_mappings() Prevents ldelf from displaying the TA mappings on abort or panic, but does not seem to cause any other problem.
Link: [1] https://github.com/llvm/llvm-project/commits/8351c327647 Signed-off-by: Jerome Forissier <jerome@forissier.org> Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU pager/no pager) Tested-by: Jerome Forissier <jerome@forissier.org> (QEMUv8, pager/no pager) Tested-by: Jerome Forissier <jerome@forissier.org> (HiKey960, 32/64, GP) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e29072bd | 11-Sep-2019 |
Jerome Forissier <jerome@forissier.org> |
Revert "compiler.h: introduce GCC version check"
This reverts commit fc78b3ffc59ef03e599ae952b4345f03f466f11c and updates the comment in <compiler.h>.
It turns out not only GCC 8.x needs the workar
Revert "compiler.h: introduce GCC version check"
This reverts commit fc78b3ffc59ef03e599ae952b4345f03f466f11c and updates the comment in <compiler.h>.
It turns out not only GCC 8.x needs the workaround. I tried 4.9, 6.2, 8.2, and 8.3 from various sources (Linaro or Ubuntu). If __SECTION_FLAGS_RODATA is empty, this warning is always present:
CC out/arm-plat-vexpress/core/mm/fobj.o {standard input}: Assembler messages: {standard input}:402: Warning: setting incorrect section attributes for .rodata.__unpaged
The generated assembler file contains the "aw" flags:
$ grep '\.section.*\.rodata\.__unpaged' out/arm-plat-vexpress/core/mm/fobj.s .section .rodata.__unpaged,"aw",%progbits
By reverting the above commit, we have:
$ grep '\.section.*\.rodata\.__unpaged' out/arm-plat-vexpress/core/mm/fobj.s .section .rodata.__unpaged,"a",%progbits //,"aw",%progbits
...and the assembler does not warn anymore.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|