| #
137eb244 |
| 19-Apr-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
ta: rework how ENABLE_MDBG=1 is passed
Reworks how ENABLE_MDBG=1 is passed when compiling the TA.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wik
ta: rework how ENABLE_MDBG=1 is passed
Reworks how ENABLE_MDBG=1 is passed when compiling the TA.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
a42a05af |
| 19-Apr-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
ta/ta.mk: make sure exported conf.mk is updated
Makes sure that conf.mk exported to TA dev kit is updated even if the change isn't due to a change in mk/config.mk
Reviewed-by: Jerome Forissier <jer
ta/ta.mk: make sure exported conf.mk is updated
Makes sure that conf.mk exported to TA dev kit is updated even if the change isn't due to a change in mk/config.mk
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
8c8e1441 |
| 21-Feb-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
ta_dev_kit.mk: define ENABLE_MDBG when CFG_TEE_TA_MALLOC_DEBUG is set
In order to use the memory leak detection code, a user-mode TA needs two things: - A version of libutils.a that was built with m
ta_dev_kit.mk: define ENABLE_MDBG when CFG_TEE_TA_MALLOC_DEBUG is set
In order to use the memory leak detection code, a user-mode TA needs two things: - A version of libutils.a that was built with malloc debug code. This is taken care of by ta/ta.mk which sets ENABLE_MDBG=1 when CFG_TEE_TA_MALLOC_DEBUG is 'y'. - The proper declarations for mdbg_malloc(), mdbg_free(), mdbg_check() etc. as well as the macro redefinitions for malloc(), free() etc. in the header files when the TA is built. This patch adds the missing definition of ENABLE_MDBG in ta/mk/ta_dev_kit.mk when CFG_TEE_TA_MALLOC_DEBUG is 'y'.
In addition, the usage of CFG_TEE_TA_MALLOC_DEBUG and CFG_TEE_CORE_MALLOC_DEBUG is better documented in mk/conf.mk.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
show more ...
|
| #
b924c494 |
| 08-Feb-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
Generate conf.cmake for TA dev kit
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
|
| #
be5c06ca |
| 27-Sep-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: remove Trusted UI code
Removes all the TUI-related code from libutee (lib/libutee/tui), as well as its dependencies: lib/libpng and lib/libzlib. Two reasons for this: 1. This is far from b
libutee: remove Trusted UI code
Removes all the TUI-related code from libutee (lib/libutee/tui), as well as its dependencies: lib/libpng and lib/libzlib. Two reasons for this: 1. This is far from being a complete and testable TUI implementation. In other words, it is dead code, more or less. 2. lib/libzlib (version 1.2.8) contains several CVE vulnerabilities. Even if the code is not used, it may trigger some code analysis tools and is a problem for some projects.
Reported-by: Jianhui Li <airbak.li@hisilicon.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
4746a225 |
| 16-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add target ta_dev_kit
Adds support for `make ta_dev_kit`, to build the user space libraries only and copy them (as well as the related header files and make files) to the export directory.
Signed-o
Add target ta_dev_kit
Adds support for `make ta_dev_kit`, to build the user space libraries only and copy them (as well as the related header files and make files) to the export directory.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
910c5757 |
| 17-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
ta/ta.mk: add scripts/symbolize.py to TA dev kit
scripts/symbolize.py is useful to TA developers, so add it to the TA development kit.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
ta/ta.mk: add scripts/symbolize.py to TA dev kit
scripts/symbolize.py is useful to TA developers, so add it to the TA development kit.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
0ac9c8cf |
| 17-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
ta/ta.mk: remove useless calls to $(wildcard)
File names passed to $(wildcard) in ta/mk contain no wildcarding token and they all exist. Therefore, $(wildcard <file>) is always equal to <file> and $
ta/ta.mk: remove useless calls to $(wildcard)
File names passed to $(wildcard) in ta/mk contain no wildcarding token and they all exist. Therefore, $(wildcard <file>) is always equal to <file> and $(wildcard) may be omitted.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
50a81498 |
| 15-Feb-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: provide a hash tree for secure storage
Provides a hash tree to be used by REE and SQL FS for the secure storage implementation.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Sig
core: provide a hash tree for secure storage
Provides a hash tree to be used by REE and SQL FS for the secure storage implementation.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
50ce5905 |
| 06-Jan-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Fix build error when $(O) starts with ./
When a target starts with './', $@ does not. Therefore we must not use $@ to access a variable if its name is created from $(out-dir) which might start with
Fix build error when $(O) starts with ./
When a target starts with './', $@ does not. Therefore we must not use $@ to access a variable if its name is created from $(out-dir) which might start with './'. We use a macro to make sure that $(conf-mk-file-export) is evaluated immediately rather than when the rule is executed. It is needed because ta/ta.mk may be included twice with different values for $(conf-mk-file-export) (32-bit and 64-bit dev kits).
Fixes the following issue:
$ make O=./build <snip> GEN build/export-ta_arm32/mk/conf.mk /bin/bash: -c: line 0: syntax error near unexpected token `)' /bin/bash: -c: line 0: `() >> build/export-ta_arm32/mk/conf.mk' ta/ta.mk:120: recipe for target 'build/export-ta_arm32/mk/conf.mk' failed make: *** [build/export-ta_arm32/mk/conf.mk] Error 1
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
9ac870c9 |
| 06-Jan-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Make sure "make clean" removes everything "make" has created under $(O)
"make clean" would leave behind some files and many directories. Fix this by correctly tracking the files and directories crea
Make sure "make clean" removes everything "make" has created under $(O)
"make clean" would leave behind some files and many directories. Fix this by correctly tracking the files and directories created under $(O) during the build process: - Fix incorrect file names in $(cleanfiles) and add a few missing ones. - Introduce a makefile macro: $(cleandirs-for-rmdir), defined in a new file: mk/cleandirs.mk. It returns the list of directories that should be removed, given a list of files. The clean target removes the files, then all the directories in depth- first order. $(O) is also removed, if found to be empty.
Note that a more straightforward approach was discussed in [1]: use "rm -rf $(O)/some_dir" and get rid of the whole file and directory tracking via $(cleanfiles) and $(cleandirs). Although it was agreed it would be safe, doing so would necessarily break the backward compatibility for build scripts relying on "make O=<some path>", due to the additional level ($(O)/some_dir).
Finally, mk/cleandirs.mk is exported to the TA dev kit and the clean rule for the TAs is updated.
[1] https://github.com/OP-TEE/optee_os/pull/1270
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Andy Green <andy@warmcat.com>
show more ...
|
| #
bfe62b88 |
| 15-Sep-2016 |
Joakim Bech <joakim.bech@linaro.org> |
ta-dev-kit: Remove use of platform_flags.mk
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Tested-by: Joakim Bech <joakim.bech@linaro.org> (QEMU) Reviewed-by: Jerome Forissier <jerome.forissier
ta-dev-kit: Remove use of platform_flags.mk
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Tested-by: Joakim Bech <joakim.bech@linaro.org> (QEMU) Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
fdf35d01 |
| 27-Mar-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
Import libpng 1.6.21
Imports libpng 1.6.21 from git://git.code.sf.net/p/libpng/code, tag ibpng-1.6.21-master-signed
This library is built as a user-mode lib only and is needed to be able to support
Import libpng 1.6.21
Imports libpng 1.6.21 from git://git.code.sf.net/p/libpng/code, tag ibpng-1.6.21-master-signed
This library is built as a user-mode lib only and is needed to be able to support png images used in Trusted UI.
Internal test files and other unused files are removed.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
ca3a3582 |
| 27-Mar-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
Import zlib-1.2.8
Imports zlib-1.2.8 from http://zlib.net/zlib-1.2.8.tar.xz with MD5 checksum 28f1205d8dd2001f26fec1e8c2cebe37
This library is built as a user-mode lib only and is needed to be able
Import zlib-1.2.8
Imports zlib-1.2.8 from http://zlib.net/zlib-1.2.8.tar.xz with MD5 checksum 28f1205d8dd2001f26fec1e8c2cebe37
This library is built as a user-mode lib only and is needed to be able to decompress png images used in Trusted UI.
Internal test files and other unused files are removed.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
09d93d24 |
| 08-Apr-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: optimize byte swap macros
Optimizes byte swap macros to use compiler builtin if possible. Also adds a 64-bit byte swap macro.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-b
libutee: optimize byte swap macros
Optimizes byte swap macros to use compiler builtin if possible. Also adds a 64-bit byte swap macro.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
c042fbef |
| 05-Feb-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
Introduce CROSS_COMPILE32 and CROSS_COMPILE64
Currently, to build a 64-bit TEE core (as well as mixed 32- and 64-bit TA libraries, which are automatically enabled in this case), one has to set too m
Introduce CROSS_COMPILE32 and CROSS_COMPILE64
Currently, to build a 64-bit TEE core (as well as mixed 32- and 64-bit TA libraries, which are automatically enabled in this case), one has to set too many compiler variables:
$ make PLATFORM=hikey CFG_ARM64_core=y \ CROSS_COMPILE_core=aarch64-linux-gnu- \ CROSS_COMPILE_ta_arm64=aarch64-linux-gnu-
This commit introduces two variables, CROSS_COMPILE32 and CROSS_COMPILE64. They take appropriate default values, so that the above line may be simplified as:
$ make PLATFORM=hikey CFG_ARM64_core=y
The change remains compatible with previous builds, i.e., CROSS_COMPILE can still be used to define the 32-bit compiler because CROSS_COMPILE32 defaults to $(CROSS_COMPILE). Similarly, CROSS_COMPILE_core and CROSS_COMPILE_ta_arm{32,64} are still used so they may be overridden too.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| #
739804b5 |
| 11-Dec-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
get rid of platform_flags.mk
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@l
get rid of platform_flags.mk
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU, FVP) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
b5569a68 |
| 08-Jan-2016 |
Pascal Brand <pascal.brand@st.com> |
Compiles user library using conf.h
Compilation of user libraries now includes conf.h This makes the definition of CFG_xxx macro more reliable, without the need of adding specific -D directives in ta
Compiles user library using conf.h
Compilation of user libraries now includes conf.h This makes the definition of CFG_xxx macro more reliable, without the need of adding specific -D directives in ta/ta.mk
Note that conf.h and conf.mk are no more generated in the out/core directory.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Pascal Brand <pascal.brand@st.com>
show more ...
|
| #
4718d4b8 |
| 18-Dec-2015 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: use CFG_TEE_PANIC_DEBUG setting
When libutee is compiled, the configuration variable CFG_TEE_PANIC_DEBUG is not exported to the C code as a pre-processor macro (contrary to TEE core build,
libutee: use CFG_TEE_PANIC_DEBUG setting
When libutee is compiled, the configuration variable CFG_TEE_PANIC_DEBUG is not exported to the C code as a pre-processor macro (contrary to TEE core build, it does not happen automatically). As a result, all the calls to TEE_Panic() that occur in the GlobalPlatform API wrappers do not call EMSG() when the TA is about to panic. This commit fixes this issue by properly defining the C macro when the configuration variable is enabled.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
3e27ab4b |
| 11-Dec-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
Export CFG_TA_FLOAT_SUPPORT to TA dev kit
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU, FVP Aarch64) Signed-off-by: Jens Wiklander
Export CFG_TA_FLOAT_SUPPORT to TA dev kit
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU, FVP Aarch64) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
156fe685 |
| 03-Dec-2015 |
Pascal Brand <pascal.brand@st.com> |
build: fix definition of MDBG_ENABLE
Note that because of this bug, MDBG_ENABLE was always defined. Now, MDBG_ENABLE is not defined by default.
Reviewed-by: Jerome Forissier <jerome.forissier@linar
build: fix definition of MDBG_ENABLE
Note that because of this bug, MDBG_ENABLE was always defined. Now, MDBG_ENABLE is not defined by default.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU) Signed-off-by: Pascal Brand <pascal.brand@st.com>
show more ...
|
| #
bc33bbd9 |
| 11-Nov-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
Add support to generate multiple TA dev kits
Adds support to generate multiple TA dev kits, one for each word in the variable "ta-targets". ta/ta.mk is included once for each word in "ta-targets" wi
Add support to generate multiple TA dev kits
Adds support to generate multiple TA dev kits, one for each word in the variable "ta-targets". ta/ta.mk is included once for each word in "ta-targets" with the word assigned to "ta-target". This word is the assigned the variable "sm" to allow each "ta-target" to be built as a separate sub-module.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
0fcbddd4 |
| 11-Nov-2015 |
SY Chiu <sy.chiu@linaro.org> |
debug: enable bget memory leak detection
This patch enables memory leak detection in bget_malloc.c. This is very helpful to find memory leakage issue in teecore or user TA. To enable it in teecore,
debug: enable bget memory leak detection
This patch enables memory leak detection in bget_malloc.c. This is very helpful to find memory leakage issue in teecore or user TA. To enable it in teecore, build optee_os with `CFG_TEE_CORE_MALLOC_DEBUG=y`. For user TA, build optee_os with `CFG_TEE_TA_MALLOC_DEBUG=y`.
Then, add the following statement at some point of your code that might frequently been triggered:
mdbg_check(1);
It will dump allocated memory blocks and the holders of them. If you find a memory block appears multiple times after the system runs a period of time, it is very likely the source of memory leakage.
Here is an example output:
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 0 bytes core/tee/tee_svc_storage.c:260 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 104 bytes core/tee/tee_svc_storage.c:444 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 18 bytes core/tee/tee_pobj.c:119 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 56 bytes core/tee/tee_pobj.c:110 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 192 bytes core/arch/arm/mm/tee_mmu.c:93 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 32 bytes core/arch/arm/mm/tee_mmu.c:241 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:75 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:75 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 224 bytes core/arch/arm/kernel/tee_ta_manager.c:573 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 72 bytes core/arch/arm/kernel/tee_ta_manager.c:1202 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 32 bytes core/kernel/handle.c:70 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:48 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:48 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:48 ERR TEE-CORE:mdbg_check:720: Ignore buffer: 16 bytes lib/libutils/isoc/bget_malloc.c:794
You can see the buffer hold by strdup.c:34 appears 4 times, so it's very likely to be the source of memory leakage.
Signed-off-by: SY Chiu <sy.chiu@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Tested-by: SY Chiu <sy.chiu@linaro.org> (MT8173 EVB)
show more ...
|
| #
92ea2867 |
| 26-Oct-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
ta-dev-kit: export signed_hdr.h
Exports core/include/signed_hdr.h to host_include to be able to use struct shdr when testing TAs corrupted at different places.
Signed-off-by: Jens Wiklander <jens.w
ta-dev-kit: export signed_hdr.h
Exports core/include/signed_hdr.h to host_include to be able to use struct shdr when testing TAs corrupted at different places.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
a2e9a830 |
| 16-Sep-2015 |
Cedric Chaumont <cedric.chaumont@st.com> |
GP11 : trusted storage verify (block enc fs)
Signed-off-by: Cedric Chaumont <cedric.chaumont@st.com> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Cedric Chaumont <cedric.chaumont@l
GP11 : trusted storage verify (block enc fs)
Signed-off-by: Cedric Chaumont <cedric.chaumont@st.com> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Cedric Chaumont <cedric.chaumont@linaro.org> (STM boards) Tested-by: Cedric Chaumont <cedric.chaumont@linaro.org> (ARM Juno board)
show more ...
|