23 months agoIncrease stack size for GP TTA_Arithmetical TA master ti2019.01 ti2019.01-rc3 ti2019.01-rc4 ti2019.01-rc5 ti2019.02 ti2019.02-rc1 ti2019.02-rc2 ti2019.02-rc3 ti2019.02-rc4 ti2019.03 ti2019.03-rc1 ti2019.03-rc2 ti2019.03-rc3 ti2019.03-rc4 ti2019.04 ti2019.04-rc1 ti2019.04-rc2 ti2019.04-rc3 ti2019.04-rc4 ti2019.04-rc5
Increase stack size for GP TTA_Arithmetical TA
On 64-bit platforms with 64-bit user TAs (QEMUv8, HiKey960), gp_8524
crashes with the following dump:
E/TC:0 0 User TA data-abort at address 0x40003fb0 (translation fault)
E/TC:0 0 esr 0x92000047 ttbr0 0x200000e19c000 ttbr1 0x00000000 cidr 0x0
E/TC:0 0 cpu #0 cpsr 0x20000100
E/TC:0 0 x0 0000000040004ce8 x1 0000000040004ce8
E/TC:0 0 x2 0000000040004d18 x3 0000000040004da0
E/TC:0 0 x4 0000000040004cd0 x5 0000000040004ef0
E/TC:0 0 x6 0000000000000100 x7 000000000e18da80
E/TC:0 0 x8 0000000000000021 x9 0000000000004c53
E/TC:0 0 x10 0000000000000041 x11 0000000000000052
E/TC:0 0 x12 00000000a71c5d59 x13 0000000040004f80
E/TC:0 0 x14 0000000000000000 x15 0000000000000000
E/TC:0 0 x16 000000000e138020 x17 0000000000000000
E/TC:0 0 x18 0000000000000000 x19 000000000e1a2fb0
E/TC:0 0 x20 0000000000000000 x21 000000000e17e4f0
E/TC:0 0 x22 00000000000005e0 x23 0000000000000000
E/TC:0 0 x24 0000000000000000 x25 0000000000000000
E/TC:0 0 x26 0000000000000000 x27 0000000000000000
E/TC:0 0 x28 0000000000000000 x29 0000000040004ca0
E/TC:0 0 x30 0000000040011708 elr 0000000040010100
E/TC:0 0 sp_el0 0000000040003fb0
E/TC:0 0 Status of TA 534d4152-5443-4c53-4152-4954484d4554 (0xe18da50) (active)
E/TC:0 0 arch: aarch64 load address: 0x0000000040005000 ctx-idr: 2
E/TC:0 0 stack: 0x0000000040004000 4096
E/TC:0 0 region 0: va 0x0000000040000000 pa 0x000000000e100000 size 0x002000 flags ---R-X
E/TC:0 0 region 1: va 0x0000000040002000 pa 0x000000000e190000 size 0x001000 flags ---RW-
E/TC:0 0 region 2: va 0x0000000040004000 pa 0x000000000e335000 size 0x001000 flags rw-RW-
E/TC:0 0 region 3: va 0x0000000040005000 pa 0x000000000e316000 size 0x014000 flags r-x--- [0] .ta_head .text .rodata .dynsym .rela.dyn .got .rela.got .dynamic .dynstr .hash
E/TC:0 0 region 4: va 0x0000000040019000 pa 0x000000000e32a000 size 0x00b000 flags rw---- [0] .data .bss
E/TC:0 0 region 5: va 0x0000000040025000 pa 0x0000000041102d80 size 0x001000 flags rw-RW-
E/TC:0 0 [0] 534d4152-5443-4c53-4152-4954484d4554 @ 0x0000000040005000 (optee_test/out/ta/GP_TTA_Arithmetical/534d4152-5443-4c53-4152-4954484d4554.elf)
E/TC:0 0 Call stack:
E/TC:0 0 0x0000000040010100 mbedtls_mpi_exp_mod at optee_os/lib/libmbedtls/mbedtls/library/bignum.c:1782
E/TC:0 0 0x0000000040011960 mbedtls_mpi_is_prime_ext at optee_os/lib/libmbedtls/mbedtls/library/bignum.c:2361
E/TC:0 0 0x0000000040011990 mbedtls_mpi_is_prime at optee_os/lib/libmbedtls/mbedtls/library/bignum.c:2380
E/TC:0 0 0x000000004000a4ec TEE_BigIntIsProbablePrime at optee_os/lib/libutee/tee_api_arith_mpi.c:771
E/TC:0 0 0x00000000400070dc CmdTEEBigIntIsProbablePrime at optee_test/ta/GP_TTA_Arithmetical/TTA_Arithmetical.c:1139
E/TC:0 0 0x0000000040007930 TA_InvokeCommandEntryPoint at optee_test/ta/GP_TTA_Arithmetical/TTA_Arithmetical.c:1425
E/TC:0 0 0x000000004000ac74 entry_invoke_command at optee_os/lib/libutee/arch/arm/user_ta_entry.c:191
E/TC:0 0 0x000000004000ad08 __utee_entry at optee_os/lib/libutee/arch/arm/user_ta_entry.c:219
E/TC:0 0 0x000000000e10d630 ???
The invalid address is just below the stack, which means the stack size is
insufficient. Let's increase it from 2 KiB to 3 KiB.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Joakim Bech <joakim.bech@linaro.org>
On 64-bit platforms with 64-bit user TAs (QEMUv8, HiKey960), gp_8524
crashes with the following dump:
E/TC:0 0 User TA data-abort at address 0x40003fb0 (translation fault)
E/TC:0 0 esr 0x92000047 ttbr0 0x200000e19c000 ttbr1 0x00000000 cidr 0x0
E/TC:0 0 cpu #0 cpsr 0x20000100
E/TC:0 0 x0 0000000040004ce8 x1 0000000040004ce8
E/TC:0 0 x2 0000000040004d18 x3 0000000040004da0
E/TC:0 0 x4 0000000040004cd0 x5 0000000040004ef0
E/TC:0 0 x6 0000000000000100 x7 000000000e18da80
E/TC:0 0 x8 0000000000000021 x9 0000000000004c53
E/TC:0 0 x10 0000000000000041 x11 0000000000000052
E/TC:0 0 x12 00000000a71c5d59 x13 0000000040004f80
E/TC:0 0 x14 0000000000000000 x15 0000000000000000
E/TC:0 0 x16 000000000e138020 x17 0000000000000000
E/TC:0 0 x18 0000000000000000 x19 000000000e1a2fb0
E/TC:0 0 x20 0000000000000000 x21 000000000e17e4f0
E/TC:0 0 x22 00000000000005e0 x23 0000000000000000
E/TC:0 0 x24 0000000000000000 x25 0000000000000000
E/TC:0 0 x26 0000000000000000 x27 0000000000000000
E/TC:0 0 x28 0000000000000000 x29 0000000040004ca0
E/TC:0 0 x30 0000000040011708 elr 0000000040010100
E/TC:0 0 sp_el0 0000000040003fb0
E/TC:0 0 Status of TA 534d4152-5443-4c53-4152-4954484d4554 (0xe18da50) (active)
E/TC:0 0 arch: aarch64 load address: 0x0000000040005000 ctx-idr: 2
E/TC:0 0 stack: 0x0000000040004000 4096
E/TC:0 0 region 0: va 0x0000000040000000 pa 0x000000000e100000 size 0x002000 flags ---R-X
E/TC:0 0 region 1: va 0x0000000040002000 pa 0x000000000e190000 size 0x001000 flags ---RW-
E/TC:0 0 region 2: va 0x0000000040004000 pa 0x000000000e335000 size 0x001000 flags rw-RW-
E/TC:0 0 region 3: va 0x0000000040005000 pa 0x000000000e316000 size 0x014000 flags r-x--- [0] .ta_head .text .rodata .dynsym .rela.dyn .got .rela.got .dynamic .dynstr .hash
E/TC:0 0 region 4: va 0x0000000040019000 pa 0x000000000e32a000 size 0x00b000 flags rw---- [0] .data .bss
E/TC:0 0 region 5: va 0x0000000040025000 pa 0x0000000041102d80 size 0x001000 flags rw-RW-
E/TC:0 0 [0] 534d4152-5443-4c53-4152-4954484d4554 @ 0x0000000040005000 (optee_test/out/ta/GP_TTA_Arithmetical/534d4152-5443-4c53-4152-4954484d4554.elf)
E/TC:0 0 Call stack:
E/TC:0 0 0x0000000040010100 mbedtls_mpi_exp_mod at optee_os/lib/libmbedtls/mbedtls/library/bignum.c:1782
E/TC:0 0 0x0000000040011960 mbedtls_mpi_is_prime_ext at optee_os/lib/libmbedtls/mbedtls/library/bignum.c:2361
E/TC:0 0 0x0000000040011990 mbedtls_mpi_is_prime at optee_os/lib/libmbedtls/mbedtls/library/bignum.c:2380
E/TC:0 0 0x000000004000a4ec TEE_BigIntIsProbablePrime at optee_os/lib/libutee/tee_api_arith_mpi.c:771
E/TC:0 0 0x00000000400070dc CmdTEEBigIntIsProbablePrime at optee_test/ta/GP_TTA_Arithmetical/TTA_Arithmetical.c:1139
E/TC:0 0 0x0000000040007930 TA_InvokeCommandEntryPoint at optee_test/ta/GP_TTA_Arithmetical/TTA_Arithmetical.c:1425
E/TC:0 0 0x000000004000ac74 entry_invoke_command at optee_os/lib/libutee/arch/arm/user_ta_entry.c:191
E/TC:0 0 0x000000004000ad08 __utee_entry at optee_os/lib/libutee/arch/arm/user_ta_entry.c:219
E/TC:0 0 0x000000000e10d630 ???
The invalid address is just below the stack, which means the stack size is
insufficient. Let's increase it from 2 KiB to 3 KiB.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Joakim Bech <joakim.bech@linaro.org>
GP: fix compile errors with calloc()
Fixes a few errors when xtest is compiled with GP tests enabled
(CFG_GP_PACKAGE_PATH pointing to the GP Initial Configuration Test
Suite files).
Fixes: e4ec9e4aca08 ("xtest: Explicitly initialize local variables")
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Fixes a few errors when xtest is compiled with GP tests enabled
(CFG_GP_PACKAGE_PATH pointing to the GP Initial Configuration Test
Suite files).
Fixes: e4ec9e4aca08 ("xtest: Explicitly initialize local variables")
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
xtest: Explicitly initialize local variables
This change initializes all local variables to prevent build issues
(warnings and/or errors) in OP-TEE test package. This change uses
= { } for non-scalar variables and = 0 for scalar variables when there
is no obvious value. This change falls back to memset() only when
neither = { } nor = 0 is applicable, here pthread_t typed variable
and variable size arrays.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
This change initializes all local variables to prevent build issues
(warnings and/or errors) in OP-TEE test package. This change uses
= { } for non-scalar variables and = 0 for scalar variables when there
is no obvious value. This change falls back to memset() only when
neither = { } nor = 0 is applicable, here pthread_t typed variable
and variable size arrays.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
TAs: explicitly initialize local variables
This change initializes all local variables to prevent build issues
(warnings and/or errors) in OP-TEE test package. This change uses
= { } for non-scalar variables and = 0 for scalar variables.
This change also removes some useless header files inclusion.
This change also fixes few bad indentations.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
This change initializes all local variables to prevent build issues
(warnings and/or errors) in OP-TEE test package. This change uses
= { } for non-scalar variables and = 0 for scalar variables.
This change also removes some useless header files inclusion.
This change also fixes few bad indentations.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
regression 1008: adjust TA corruption test for CFG_ULIBS_SHARED=y
When TAs are linked against shared versions of libutee etc., the
size of the main binary is reduced significantly. This causes test
1008.4 to fail, because the size of the TA drops from ~121 KiB down
to ~9 KiB which is smaller than the offset supplied to
load_corrupt_ta(). Use a smaller offest to fix the issue.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
When TAs are linked against shared versions of libutee etc., the
size of the main binary is reduced significantly. This causes test
1008.4 to fail, because the size of the TA drops from ~121 KiB down
to ~9 KiB which is smaller than the offset supplied to
load_corrupt_ta(). Use a smaller offest to fix the issue.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
docs: Remove current docs and link to the new location
All current documentation has been transferred to a new git called
optee_docs [1]. The output from optee_docs will be rendered using Sphinx
and hosted at optee.readthedocs.io [2]. The new documentation git will
also be part of the regular OP-TEE releases. For completeness, it will
also be included in our manifests making up a full OP-TEE developer
setup.
[1] https://github.com/OP-TEE/optee_docs
[2] https://optee.readthedocs.io
Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
All current documentation has been transferred to a new git called
optee_docs [1]. The output from optee_docs will be rendered using Sphinx
and hosted at optee.readthedocs.io [2]. The new documentation git will
also be part of the regular OP-TEE releases. For completeness, it will
also be included in our manifests making up a full OP-TEE developer
setup.
[1] https://github.com/OP-TEE/optee_docs
[2] https://optee.readthedocs.io
Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
benchmark_1000: fix compilation against musl (uint)
Compiling against musl-libc fails with the following error:
| .../host/xtest/benchmark_1000.c: In function 'show_test_result':
| .../host/xtest/benchmark_1000.c:102:2: error: unknown type name 'uint'; did you mean 'int'?
| uint i;
| ^~~~
| int
| ...host/xtest/benchmark_1000.c:108:16: error: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Werror=sign-compare]
| for (i = 0; i < size; i++) {
| ^
etc.
Convert to using more standard size_t
Signed-off-by: André Draszik <andre.draszik@jci.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Compiling against musl-libc fails with the following error:
| .../host/xtest/benchmark_1000.c: In function 'show_test_result':
| .../host/xtest/benchmark_1000.c:102:2: error: unknown type name 'uint'; did you mean 'int'?
| uint i;
| ^~~~
| int
| ...host/xtest/benchmark_1000.c:108:16: error: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Werror=sign-compare]
| for (i = 0; i < size; i++) {
| ^
etc.
Convert to using more standard size_t
Signed-off-by: André Draszik <andre.draszik@jci.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
build: ignore declaration-after-statement warnings
| Makefile:37: recipe for target 'xtest' failed
| make: *** [xtest] Error 2
| make: *** Waiting for unfinished jobs....
| arith_taf.c: In function 'get_handle':
| arith_taf.c:56:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| int h = handle_get(&hdb, ptr);
| ^~~
| arith_taf.c: In function 'ta_entry_arith_new_var':
| arith_taf.c:82:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| size_t len = TEE_BigIntSizeInU32(params[0].value.a);
| ^~~~~~
| arith_taf.c: In function 'ta_entry_arith_new_fmm_var':
| arith_taf.c:129:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| size_t len = TEE_BigIntFMMSizeInU32(params[0].value.a);
| ^~~~~~
| arith_taf.c: In function 'ta_entry_arith_free_handle':
| arith_taf.c:150:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| void *ptr = put_handle(params[0].value.a & ~HT_MASK);
| ^~~~
| arith_taf.c: In function 'ta_entry_arith_from_octet_string':
| arith_taf.c:165:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a);
| ^~~~~~~~~~
| arith_taf.c: In function 'ta_entry_arith_from_s32':
| arith_taf.c:181:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a);
| ^~~~~~~~~~
etc.
Signed-off-by: André Draszik <andre.draszik@jci.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
| Makefile:37: recipe for target 'xtest' failed
| make: *** [xtest] Error 2
| make: *** Waiting for unfinished jobs....
| arith_taf.c: In function 'get_handle':
| arith_taf.c:56:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| int h = handle_get(&hdb, ptr);
| ^~~
| arith_taf.c: In function 'ta_entry_arith_new_var':
| arith_taf.c:82:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| size_t len = TEE_BigIntSizeInU32(params[0].value.a);
| ^~~~~~
| arith_taf.c: In function 'ta_entry_arith_new_fmm_var':
| arith_taf.c:129:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| size_t len = TEE_BigIntFMMSizeInU32(params[0].value.a);
| ^~~~~~
| arith_taf.c: In function 'ta_entry_arith_free_handle':
| arith_taf.c:150:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| void *ptr = put_handle(params[0].value.a & ~HT_MASK);
| ^~~~
| arith_taf.c: In function 'ta_entry_arith_from_octet_string':
| arith_taf.c:165:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a);
| ^~~~~~~~~~
| arith_taf.c: In function 'ta_entry_arith_from_s32':
| arith_taf.c:181:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a);
| ^~~~~~~~~~
etc.
Signed-off-by: André Draszik <andre.draszik@jci.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
fix compilation against musl (inttypes)
Compiling against musl-libc fails with the following error:
| arith_taf.c: In function 'lookup_handle':
| arith_taf.c:38:29: error: expected ')' before 'PRIx32'
| EMSG("Invalid handle 0x%" PRIx32, handle);
| ^~~~~~
and similar for PRIx32 PRIu32 PRId32 etc.
Add the needed include to get the definition of those
macros.
Signed-off-by: André Draszik <andre.draszik@jci.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Compiling against musl-libc fails with the following error:
| arith_taf.c: In function 'lookup_handle':
| arith_taf.c:38:29: error: expected ')' before 'PRIx32'
| EMSG("Invalid handle 0x%" PRIx32, handle);
| ^~~~~~
and similar for PRIx32 PRIu32 PRId32 etc.
Add the needed include to get the definition of those
macros.
Signed-off-by: André Draszik <andre.draszik@jci.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
sock_server: fix compilation against musl (sys/errno.h)
Compiling against musl-libc fails with the following error:
| In file included from .../host/xtest/sock_server.c:24:
| .../usr/include/sys/errno.h:1:2: error: #warning redirecting incorrect #include <sys/errno.h> to <errno.h> [-Werror=cpp]
| #warning redirecting incorrect #include <sys/errno.h> to <errno.h>
| ^~~~~~~
Just remove the needless include.
Signed-off-by: André Draszik <andre.draszik@jci.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Compiling against musl-libc fails with the following error:
| In file included from .../host/xtest/sock_server.c:24:
| .../usr/include/sys/errno.h:1:2: error: #warning redirecting incorrect #include <sys/errno.h> to <errno.h> [-Werror=cpp]
| #warning redirecting incorrect #include <sys/errno.h> to <errno.h>
| ^~~~~~~
Just remove the needless include.
Signed-off-by: André Draszik <andre.draszik@jci.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
xtest: add --stats applet
Adds the --stats applet to interact with the pseudo TA "stats".
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds the --stats applet to interact with the pseudo TA "stats".
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: 4002: run MAC tests in multiple increments
The .in_incr field of struct xtest_mac_case is currently used for
a single step, that is, update() is called to process in_incr byte,
then the rest of the input buffer is passed to final().
This commit allows to run the CBC MAC update() several times in chunks
of in_incr bytes, then the remaining bytes in the input buffer
(<= in_incr) are passed to final().
All MAC tests that have a non-zero increment (.in_incr) are now run
twice: first in two steps, then in multiple steps of in_incr size.
This is a test case for [1].
Link: [1] https://github.com/OP-TEE/optee_os/pull/2779
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
The .in_incr field of struct xtest_mac_case is currently used for
a single step, that is, update() is called to process in_incr byte,
then the rest of the input buffer is passed to final().
This commit allows to run the CBC MAC update() several times in chunks
of in_incr bytes, then the remaining bytes in the input buffer
(<= in_incr) are passed to final().
All MAC tests that have a non-zero increment (.in_incr) are now run
twice: first in two steps, then in multiple steps of in_incr size.
This is a test case for [1].
Link: [1] https://github.com/OP-TEE/optee_os/pull/2779
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
ta/cryp_taf: correct return value
ta_entry_copy_object_attributes() should faithfully returns
TEE_CopyObjectAttributes1()'s value instead of always overwriting it with
TEE_SUCCESS.
Signed-off-by: Oliver Chiang <rockerfeynman@gmail.com>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
ta_entry_copy_object_attributes() should faithfully returns
TEE_CopyObjectAttributes1()'s value instead of always overwriting it with
TEE_SUCCESS.
Signed-off-by: Oliver Chiang <rockerfeynman@gmail.com>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
cmake: locate files WRT to project home directory
Build system can't find file_to_c.py and certificate files, because
CMakeLists.txt have an assumption about those files locations. So,
when you try to use separate build directory, relative path in
CMakeLists.txt is not working as expected.
It is better to use CMAKE_CURRENT_SOURCE_DIR instead of assuming that
mentioned files can be reached from the build directory.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Build system can't find file_to_c.py and certificate files, because
CMakeLists.txt have an assumption about those files locations. So,
when you try to use separate build directory, relative path in
CMakeLists.txt is not working as expected.
It is better to use CMAKE_CURRENT_SOURCE_DIR instead of assuming that
mentioned files can be reached from the build directory.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
regression 6000: fix uninitialized local variables
Reported by GCC 8.2.0 with traces like:
.../build/optee_test/host/xtest/regression_6000.c:495:8: error: ‘count’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
(void)ADBG_EXPECT_BUFFER(c, &data_00[5], 5, out, count);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../build/optee_test/host/xtest/regression_6000.c:465:11: note: ‘count’ was declared here
uint32_t count;
^~~~~
.../build/optee_test/host/xtest/regression_6000.c:192:23: error: ‘obj’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
op.params[0].value.a = obj;
~~~~~~~~~~~~~~~~~~~~~^~~~~
.../build/optee_test/host/xtest/regression_6000.c:463:11: note: ‘obj’ was declared here
uint32_t obj;
^~~
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reported by GCC 8.2.0 with traces like:
.../build/optee_test/host/xtest/regression_6000.c:495:8: error: ‘count’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
(void)ADBG_EXPECT_BUFFER(c, &data_00[5], 5, out, count);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../build/optee_test/host/xtest/regression_6000.c:465:11: note: ‘count’ was declared here
uint32_t count;
^~~~~
.../build/optee_test/host/xtest/regression_6000.c:192:23: error: ‘obj’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
op.params[0].value.a = obj;
~~~~~~~~~~~~~~~~~~~~~^~~~~
.../build/optee_test/host/xtest/regression_6000.c:463:11: note: ‘obj’ was declared here
uint32_t obj;
^~~
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
regression 4100: fix uninitialized local variable
Reported by GCC 8.2.0 with traces like:
.../build/optee_test/host/xtest/regression_4100.c:884:2: error: ‘cres’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
ADBG_EXPECT_COMPARE_SIGNED(c, cres, ==, cmp_res);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../build/optee_test/host/xtest/regression_4100.c:869:10: note: ‘cres’ was declared here
int32_t cres;
^~~~
.../build/optee_test/host/xtest/regression_4100.c:857:2: error: ‘cres’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
ADBG_EXPECT_COMPARE_SIGNED(c, cres, ==, cmp_res);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../build/optee_test/host/xtest/regression_4100.c:835:10: note: ‘cres’ was declared here
int32_t cres;
^~~~
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reported by GCC 8.2.0 with traces like:
.../build/optee_test/host/xtest/regression_4100.c:884:2: error: ‘cres’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
ADBG_EXPECT_COMPARE_SIGNED(c, cres, ==, cmp_res);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../build/optee_test/host/xtest/regression_4100.c:869:10: note: ‘cres’ was declared here
int32_t cres;
^~~~
.../build/optee_test/host/xtest/regression_4100.c:857:2: error: ‘cres’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
ADBG_EXPECT_COMPARE_SIGNED(c, cres, ==, cmp_res);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../build/optee_test/host/xtest/regression_4100.c:835:10: note: ‘cres’ was declared here
int32_t cres;
^~~~
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
regression 4000: fix uninitialized local variable
Reported by GCC 8.2.0 with trace:
.../build/optee_test/host/xtest/regression_4000.c:4090:24: error: ‘ptx_hash_size’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (!ADBG_EXPECT_TEEC_SUCCESS(c,
^~~~~~~~~~~~~
.../build/optee_test/host/xtest/regression_4000.c:3658:9: note: ‘ptx_hash_size’ was declared here
size_t ptx_hash_size;
^~~~~~~~~~~~~
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reported by GCC 8.2.0 with trace:
.../build/optee_test/host/xtest/regression_4000.c:4090:24: error: ‘ptx_hash_size’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (!ADBG_EXPECT_TEEC_SUCCESS(c,
^~~~~~~~~~~~~
.../build/optee_test/host/xtest/regression_4000.c:3658:9: note: ‘ptx_hash_size’ was declared here
size_t ptx_hash_size;
^~~~~~~~~~~~~
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
xtest --aes-perf: add -u option to process buffer in several steps
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
improve xtest summary message
"0 test cases were skipped" instead of "0 test case was skipped" after successful run
Signed-off-by: Markus S. Wamser <markus.wamser@mixed-mode.de>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
"0 test cases were skipped" instead of "0 test case was skipped" after successful run
Signed-off-by: Markus S. Wamser <markus.wamser@mixed-mode.de>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
regression: split 4007 into key types
Splits regression case 4007 into
- 4007_symmetric for symmetric keys
- 4007_rsa for RSA keys, which also is complemented with 3072 and 4096 keys
- 4007_dh for Diffie-Hellman keys
- 4007_ecc for ECC keys
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Splits regression case 4007 into
- 4007_symmetric for symmetric keys
- 4007_rsa for RSA keys, which also is complemented with 3072 and 4096 keys
- 4007_dh for Diffie-Hellman keys
- 4007_ecc for ECC keys
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression 4011: correct potential overflow
Fix issues reported by GCC 8.2.0.
build/optee_test/host/xtest/regression_4000.c: In function ‘xtest_tee_test_4011’:
build/optee_test/host/xtest/regression_4000.c:5029:3: error: ‘memmove’ pointer overflow between offset [0, 8] and size [4294967295, 2147483647] accessing array ‘tmp’ with type ‘uint8_t[1024]’ {aka ‘unsigned char[1024]’} [-Werror=array-bounds]
memmove(tmp + n + i, tmp + m, tmp_size - m);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build/optee_test/host/xtest/regression_4000.c:4927:10: note: array ‘tmp’ declared here
uint8_t tmp[1024];
^~~
build/optee_test/host/xtest/regression_4000.c:5029:3: error: ‘memmove’ specified size 4294967295 exceeds maximum object size 2147483647 [-Werror=stringop-overflow=]
memmove(tmp + n + i, tmp + m, tmp_size - m);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Reported-by: Simon Hughes <simon.hughes@arm.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Fix issues reported by GCC 8.2.0.
build/optee_test/host/xtest/regression_4000.c: In function ‘xtest_tee_test_4011’:
build/optee_test/host/xtest/regression_4000.c:5029:3: error: ‘memmove’ pointer overflow between offset [0, 8] and size [4294967295, 2147483647] accessing array ‘tmp’ with type ‘uint8_t[1024]’ {aka ‘unsigned char[1024]’} [-Werror=array-bounds]
memmove(tmp + n + i, tmp + m, tmp_size - m);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build/optee_test/host/xtest/regression_4000.c:4927:10: note: array ‘tmp’ declared here
uint8_t tmp[1024];
^~~
build/optee_test/host/xtest/regression_4000.c:5029:3: error: ‘memmove’ specified size 4294967295 exceeds maximum object size 2147483647 [-Werror=stringop-overflow=]
memmove(tmp + n + i, tmp + m, tmp_size - m);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Reported-by: Simon Hughes <simon.hughes@arm.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
xtest: prevent unexpected build warning with strncpy
This change modifies adbg_run.c to prevent a false positive
warning reported by GCC 8.2 on usage of strncpy():
build/optee_test/host/xtest/adbg/src/adbg_run.c: In function ‘Do_ADBG_AppendToSuite’:
build/optee_test/host/xtest/adbg/src/adbg_run.c:103:3: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
strncpy(p, Source_p->SuiteID_p, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build/optee_test/host/xtest/adbg/src/adbg_run.c:88:9: note: length computed here
size = strlen(Source_p->SuiteID_p);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
From [1]:
Using strncpy Safely
In general, it is not possible to avoid string truncation by strncpy
except by sizing the destination to be at least a byte larger than
the length of the source string. With that approach, however, using
strncpy becomes unnecessary and the function can be avoided in favor
of other APIs such as strcpy or (less preferably) memcpy. Much has
been written about the problems with strncpy and we recommend to
avoid it whenever possible. It is, however, worth keeping in mind
that unlike other standard string-handling functions, strncpy always
writes exactly as many characters as specified by the third argument;
if the source string is shorter, the function fills the remaining
bytes with NULs.
This change prefers using a snprintf() as used in the alternate
instruction block of the strncpy() call.
[1] https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Simon Hughes <simon.hughes@arm.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
This change modifies adbg_run.c to prevent a false positive
warning reported by GCC 8.2 on usage of strncpy():
build/optee_test/host/xtest/adbg/src/adbg_run.c: In function ‘Do_ADBG_AppendToSuite’:
build/optee_test/host/xtest/adbg/src/adbg_run.c:103:3: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
strncpy(p, Source_p->SuiteID_p, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build/optee_test/host/xtest/adbg/src/adbg_run.c:88:9: note: length computed here
size = strlen(Source_p->SuiteID_p);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
From [1]:
Using strncpy Safely
In general, it is not possible to avoid string truncation by strncpy
except by sizing the destination to be at least a byte larger than
the length of the source string. With that approach, however, using
strncpy becomes unnecessary and the function can be avoided in favor
of other APIs such as strcpy or (less preferably) memcpy. Much has
been written about the problems with strncpy and we recommend to
avoid it whenever possible. It is, however, worth keeping in mind
that unlike other standard string-handling functions, strncpy always
writes exactly as many characters as specified by the third argument;
if the source string is shorter, the function fills the remaining
bytes with NULs.
This change prefers using a snprintf() as used in the alternate
instruction block of the strncpy() call.
[1] https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Simon Hughes <simon.hughes@arm.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: 6010: add rename conflict case (with close)
Adds a test case for issue https://github.com/OP-TEE/optee_os/issues/2707.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds a test case for issue https://github.com/OP-TEE/optee_os/issues/2707.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
ta/os_test: remove mpa testbench
Removes the MPA test suite "testbench" built into the os_test TA. The
test suite is made obsolete by the recently added 41xx cases.
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Hikey)
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Removes the MPA test suite "testbench" built into the os_test TA. The
test suite is made obsolete by the recently added 41xx cases.
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Hikey)
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: add 41xx arithmetic tests
Adds a new 41xx series of for arithmetic tests. The test cases in
os_test TA in the tb_*.c and testframework.c files has been converted to
xtest format. The tests are now performed on TEE Internal API instead of
directly on the libmpa interace.
A few cases has been dropped, for instance random divisions. GCD and
FMM cases added.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds a new 41xx series of for arithmetic tests. The test cases in
os_test TA in the tb_*.c and testframework.c files has been converted to
xtest format. The tests are now performed on TEE Internal API instead of
directly on the libmpa interace.
A few cases has been dropped, for instance random divisions. GCD and
FMM cases added.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
ta/crypt: add arithmetic TAF wrappers
Adds TAF wrappers for GP TEE arithmetical API
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds TAF wrappers for GP TEE arithmetical API
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: 4006: add test for RSASSA no ASN.1
This test checks the TEE_ALG_RSASSA_PKCS1_V1_5 extension, that allows to
sign data without including the hash OID in the signature. The test
vector data is copied from one of the already present vectors, with the
hash OID manually removed in the signature.
Link: <https://github.com/OP-TEE/optee_os/pull/2524>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Gabor Szekely <szvgabor@gmail.com>
This test checks the TEE_ALG_RSASSA_PKCS1_V1_5 extension, that allows to
sign data without including the hash OID in the signature. The test
vector data is copied from one of the already present vectors, with the
hash OID manually removed in the signature.
Link: <https://github.com/OP-TEE/optee_os/pull/2524>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Gabor Szekely <szvgabor@gmail.com>
cmake: component rely on C support
Without specifing optee_client source expects only C source file
support cmake may attempt to look for resources as g++. When
building with environments that do not provide such tools as when
building from native buildroot ofr a qemu target, optee_client
fails to build. This change ensure a minimal C support allows to
build optee_client with cmake.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Without specifing optee_client source expects only C source file
support cmake may attempt to look for resources as g++. When
building with environments that do not provide such tools as when
building from native buildroot ofr a qemu target, optee_client
fails to build. This change ensure a minimal C support allows to
build optee_client with cmake.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
regression: add case 1020 (lockdep)
Test the "lockdep" algorithm. This simply triggers a special test
pseudo-TA.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Test the "lockdep" algorithm. This simply triggers a special test
pseudo-TA.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Android.mk: add required header files to LOCAL_ADDITIONAL_DEPENDENCIES
Using $(LOCAL_PATH)/host/xtest/regression_8100.c as a target is not
allowed by AOSP document "Build System Changes for Android.mk Writers" [1]
("2. The target is a real file, but it's outside the output directories").
Fixes the following build error:
external/optee_test/Android.mk:71: error: writing to readonly directory: "external/optee_test/host/xtest/regression_8100.c"
Link: [1] https://android.googlesource.com/platform/build/+/4c9399d9889e/Changes.md#phony_targets
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
[jf: edit commit message]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Using $(LOCAL_PATH)/host/xtest/regression_8100.c as a target is not
allowed by AOSP document "Build System Changes for Android.mk Writers" [1]
("2. The target is a real file, but it's outside the output directories").
Fixes the following build error:
external/optee_test/Android.mk:71: error: writing to readonly directory: "external/optee_test/host/xtest/regression_8100.c"
Link: [1] https://android.googlesource.com/platform/build/+/4c9399d9889e/Changes.md#phony_targets
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
[jf: edit commit message]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Android.mk : Fix compilation for build outside of source
Trying to specify Android build location outside of souce directory's
default 'out' using OUT_DIR_COMMON_BASE env variable, results in the
following error
"....
build/core/binary.mk:1480: error: external/optee_test/Android.mk:
xtest: C_INCLUDES must be under the source or output directories:
"
Fix the error by moving host_include/ from LOCAL_C_INCLUDES to LOCAL_CFLAGS
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Tested-by: Victor Chong <victor.chong@linaro.org> (hikey620)
Acked-by: Victor Chong <victor.chong@linaro.org>
[jf: wrap commit text]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Trying to specify Android build location outside of souce directory's
default 'out' using OUT_DIR_COMMON_BASE env variable, results in the
following error
"....
build/core/binary.mk:1480: error: external/optee_test/Android.mk:
xtest: C_INCLUDES must be under the source or output directories:
"
Fix the error by moving host_include/ from LOCAL_C_INCLUDES to LOCAL_CFLAGS
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Tested-by: Victor Chong <victor.chong@linaro.org> (hikey620)
Acked-by: Victor Chong <victor.chong@linaro.org>
[jf: wrap commit text]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
regression_*.c: move ADBG_CASE_DEFINE()
Moves all ADBG_CASE_DEFINE() to right after the function implementing
the test case.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Moves all ADBG_CASE_DEFINE() to right after the function implementing
the test case.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Android.mk: make xtest installed in the vendor partition
and use ta libs in the vendor partition,
so that we could make optee work with Treble enabled builds too
Acked-by: Victor Chong <victor.chong@linaro.org>
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
and use ta libs in the vendor partition,
so that we could make optee work with Treble enabled builds too
Acked-by: Victor Chong <victor.chong@linaro.org>
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Replace 32-bit libcrypto.a with version compiled for Cortex-A9 (no udiv)
Re-build OpenSSL's libcrypto.a without hardware divide (udiv). Fixes the
following crash observed on Cortex-A9 platforms:
(gdb) r
Program terminated with signal SIGILL, Illegal instruction.
#0 0x00054c30 in lh_insert ()
(gdb) x/i 0x00054c30
0x54c30 <lh_insert+22>: udiv r3, r3, r2
Build commands:
git clone https://github.com/openssl/openssl.git
cd openssl
git checkout OpenSSL_1_0_2o
./Configure linux-generic32 -mcpu=cortex-a9 no-shared \
--cross-compile-prefix=arm-linux-gnueabihf-
make build_libcrypto
Reported-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Andrew F. Davis <afd@ti.com>
Re-build OpenSSL's libcrypto.a without hardware divide (udiv). Fixes the
following crash observed on Cortex-A9 platforms:
(gdb) r
Program terminated with signal SIGILL, Illegal instruction.
#0 0x00054c30 in lh_insert ()
(gdb) x/i 0x00054c30
0x54c30 <lh_insert+22>: udiv r3, r3, r2
Build commands:
git clone https://github.com/openssl/openssl.git
cd openssl
git checkout OpenSSL_1_0_2o
./Configure linux-generic32 -mcpu=cortex-a9 no-shared \
--cross-compile-prefix=arm-linux-gnueabihf-
make build_libcrypto
Reported-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Andrew F. Davis <afd@ti.com>
xest: OpenSSL may be provided by the system
Introduce build directive OPTEE_OPENSSL_EXPORT in GNU makefile
to get OpenSSL from the target rather than using the provided builds
of the library.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Introduce build directive OPTEE_OPENSSL_EXPORT in GNU makefile
to get OpenSSL from the target rather than using the provided builds
of the library.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
xtest: Makefile: fix OpenSSL dependency on GP test suite support
CFG_GP_PACKAGE_PATH is not expected to store 'y' but a path, if
defined. This change corrects the test on CFG_GP_PACKAGE_PATH regarding
OpenSSL depedency.
Fixes: 43d58a5fce8f ("xtest: Makefile: link against OpenSSL if MBed TLS is enabled in TA")
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
CFG_GP_PACKAGE_PATH is not expected to store 'y' but a path, if
defined. This change corrects the test on CFG_GP_PACKAGE_PATH regarding
OpenSSL depedency.
Fixes: 43d58a5fce8f ("xtest: Makefile: link against OpenSSL if MBed TLS is enabled in TA")
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
regression: 4003: add AES CBC test
Test case for issue https://github.com/OP-TEE/optee_os/issues/2355.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Test case for issue https://github.com/OP-TEE/optee_os/issues/2355.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
ta: os_test_lib: add aosp support
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
regression: 4003: use bigger plain text in AES CTR test
The AES CTR test added in the parent commit results in the accelerated
crypto code being called with 3 blocks of data (48 bytes), which revealed
a bug in the 32-bit version of ce_aes_ctr_encrypt() [1].
Add some more data to exercise a similar loop in the 64-bit version of
ce_aes_ctr_encrypt(). The loop deals with 4 blocks of data.
Link: [1] https://github.com/OP-TEE/optee_os/issues/2305
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
The AES CTR test added in the parent commit results in the accelerated
crypto code being called with 3 blocks of data (48 bytes), which revealed
a bug in the 32-bit version of ce_aes_ctr_encrypt() [1].
Add some more data to exercise a similar loop in the 64-bit version of
ce_aes_ctr_encrypt(). The loop deals with 4 blocks of data.
Link: [1] https://github.com/OP-TEE/optee_os/issues/2305
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
regression: 4003: add AES CTR test
Test case for issue https://github.com/OP-TEE/optee_os/issues/2305.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Test case for issue https://github.com/OP-TEE/optee_os/issues/2305.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
regression: add case 1019
Test the dynamically linked TA feature if CFG_TA_DYNLINK=y. Android is not
supported at the moment (xtest 1019 will do nothing).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU make & cmake)
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Test the dynamically linked TA feature if CFG_TA_DYNLINK=y. Android is not
supported at the moment (xtest 1019 will do nothing).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU make & cmake)
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
regression_1000.c: remove useless code
TEEC_ERROR_TARGET_DEAD is defined in tee_client_api.h so there is no
need to check for its existence.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
TEEC_ERROR_TARGET_DEAD is defined in tee_client_api.h so there is no
need to check for its existence.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Remove host/lib/armv{7,8}/libcrypto.a
The old copies of libcrypto.a are not used anymore. Remove them.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
The old copies of libcrypto.a are not used anymore. Remove them.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
xtest: use imported OpenSSL
This commit modifies the xtest Makefiles to deal with the cases where
xtest needs to use OpenSSL:
- When the GlobalPlatform tests are enabled (CFG_GP_PACKAGE_PATH is set),
- When the MbedTLS tests are enabled (CFG_TA_MBEDTLS=y).
For the first case, it is the "make patch" target that takes care of
copying the header files under host/xtest/for_gp/include/openssl.
For the second case however, the copy does not occur and only the -I flag
is added by [1], resulting in the following error:
cc1: error: for_gp/include: No such file or directory [-Werror=missing-include-dirs]
Address this problem by using the imported copy of OpenSSL.
The CMake and Android builds are not modified.
Fixes: [1] 43d58a5fce8f ("xtest: Makefile: link against OpenSSL if MBed TLS is enabled in TA")
Fixes: https://github.com/OP-TEE/optee_test/issues/285
Reported-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> (poplar)
This commit modifies the xtest Makefiles to deal with the cases where
xtest needs to use OpenSSL:
- When the GlobalPlatform tests are enabled (CFG_GP_PACKAGE_PATH is set),
- When the MbedTLS tests are enabled (CFG_TA_MBEDTLS=y).
For the first case, it is the "make patch" target that takes care of
copying the header files under host/xtest/for_gp/include/openssl.
For the second case however, the copy does not occur and only the -I flag
is added by [1], resulting in the following error:
cc1: error: for_gp/include: No such file or directory [-Werror=missing-include-dirs]
Address this problem by using the imported copy of OpenSSL.
The CMake and Android builds are not modified.
Fixes: [1] 43d58a5fce8f ("xtest: Makefile: link against OpenSSL if MBed TLS is enabled in TA")
Fixes: https://github.com/OP-TEE/optee_test/issues/285
Reported-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> (poplar)
Add host/openssl/lib/{arm,aarch64}/libcrypto.a
Adds 32-bit and 64-bit builds of libcrypto.a (OpenSSL version 1.2.0o).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds 32-bit and 64-bit builds of libcrypto.a (OpenSSL version 1.2.0o).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Import OpenSSL 1.2.0o header files into host/openssl/include
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Move host/LICENSE to host/xtest/LICENSE
The GPL v2 license covers the xtest code (host/xtest), not the OpenSSL
crypto libraries (host/lib/*). Therefore, move the LICENSE file down into
host/xtest.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
The GPL v2 license covers the xtest code (host/xtest), not the OpenSSL
crypto libraries (host/lib/*). Therefore, move the LICENSE file down into
host/xtest.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: 4006: add test case for 4096-bit RSA
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: 4006: add test case for 3072-bit RSA
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
crypto: add test case for seeding RNG pool
Add test case for testing system pTA functionality for seeding RNG pool.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Add test case for testing system pTA functionality for seeding RNG pool.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
xtest: Makefile: link against OpenSSL if MBed TLS is enabled in TA
Commit 950ea1cda6d3 ("regression: add case 8103") introduces a test that
needs OpenSSL to verify a certificate generated by a TA with Mbed TLS. It
updates xtest's CMakeLists.txt to link against OpenSSL when found, but the
regular Makefile is not updated.
This commit adds support for the new test to the non-CMake build by
linking xtest against the OpenSSL static library when CFG_TA_MBEDTLS=y.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Commit 950ea1cda6d3 ("regression: add case 8103") introduces a test that
needs OpenSSL to verify a certificate generated by a TA with Mbed TLS. It
updates xtest's CMakeLists.txt to link against OpenSSL when found, but the
regular Makefile is not updated.
This commit adds support for the new test to the non-CMake build by
linking xtest against the OpenSSL static library when CFG_TA_MBEDTLS=y.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
regression: add case 8103
Adds regression case 8103 which uses the TAF TA_CRYPT_CMD_MBED_SIGN_CERT
to sign a certificate using a CSR. Output is the X.509 certificate and a
certificate chain used to verify the certificate.
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU)
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds regression case 8103 which uses the TAF TA_CRYPT_CMD_MBED_SIGN_CERT
to sign a certificate using a CSR. Output is the X.509 certificate and a
certificate chain used to verify the certificate.
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU)
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
ta/crypt: add TA_CRYPT_CMD_MBED_SIGN_CERT
Adds the TAF TA_CRYPT_CMD_MBED_SIGN_CERT which uses mbedTLS to sign a
certificate.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds the TAF TA_CRYPT_CMD_MBED_SIGN_CERT which uses mbedTLS to sign a
certificate.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Initialize openssl if linked with it
Early when xtest is initializing initialize OpenSSL if xtest is linked
with OpenSSL.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Early when xtest is initializing initialize OpenSSL if xtest is linked
with OpenSSL.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: add case 8102
Adds regression case 8102 which uses the TAF
TA_CRYPT_CMD_MBED_CHECK_CERT to verify a certificate chain.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds regression case 8102 which uses the TAF
TA_CRYPT_CMD_MBED_CHECK_CERT to verify a certificate chain.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
cert: add some test certificates
Adds some test certificates for the regression 81xx cases.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds some test certificates for the regression 81xx cases.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Add scripts/file_to_c.py
Adds scripts/file_to_c.py which declares an uint8_t array with the
hexadecimal content of a file.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds scripts/file_to_c.py which declares an uint8_t array with the
hexadecimal content of a file.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
ta/crypt: add TA_CRYPT_CMD_MBED_CHECK_CERT
Adds the TAF TA_CRYPT_CMD_MBED_CHECK_CERT which uses mbedTLS to check a
certificate chain.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds the TAF TA_CRYPT_CMD_MBED_CHECK_CERT which uses mbedTLS to check a
certificate chain.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: add case 8101
Adds regression case 8101 which calls mbedTLS self tests if
available.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds regression case 8101 which calls mbedTLS self tests if
available.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
ta/crypt: add TA_CRYPT_CMD_MBED_SELF_TESTS
Adds the TAF TA_CRYPT_CMD_MBED_SELF_TESTS which calls mbedTLS self tests if
compiled with CFG_TA_MBEDTLS_SELF_TEST
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds the TAF TA_CRYPT_CMD_MBED_SELF_TESTS which calls mbedTLS self tests if
compiled with CFG_TA_MBEDTLS_SELF_TEST
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
ta/crypt: increase stack size
Increases stack size due to anticipated stack usage by mbedTLS.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Increases stack size due to anticipated stack usage by mbedTLS.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
xtest storage: check that we can't use object_id from shared memory
According to the GP spec V1.1, the object_id in create/open/rename
functions is not allowed to reside in the shared memory.
This change checks that when a TA uses a SHM buffer to carry the
object_id parameter for create/open/rename function do rejects the
request. It is expected that the TA dies on such conditions.
Suggested-by: Zeng Tao <prime.zeng@hisilicon.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
According to the GP spec V1.1, the object_id in create/open/rename
functions is not allowed to reside in the shared memory.
This change checks that when a TA uses a SHM buffer to carry the
object_id parameter for create/open/rename function do rejects the
request. It is expected that the TA dies on such conditions.
Suggested-by: Zeng Tao <prime.zeng@hisilicon.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
ta: don't include host_include/conf.mk
Don't include host_include/conf.mk when building the TA as many
unrelated variables are propagated.
Relevant variables are already defined by the dev kit.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Don't include host_include/conf.mk when building the TA as many
unrelated variables are propagated.
Relevant variables are already defined by the dev kit.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
os_test: remove global mempool
Removes global variable mempool.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Removes global variable mempool.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
os_test: remove mempool dependency
Removes dependency to global variable mempool the testbench suite. The
bignum operations are called with the destination parameter different
from any of the operand parameters, making the memory pool redundant.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Removes dependency to global variable mempool the testbench suite. The
bignum operations are called with the destination parameter different
from any of the operand parameters, making the memory pool redundant.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: add case 1018
Adds regression case 1018 to test memref paramters out of bounds of
supplied shared memory reference.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds regression case 1018 to test memref paramters out of bounds of
supplied shared memory reference.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: add case 1017
Adds regression case 1017 to test coalesced memref parameters.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds regression case 1017 to test coalesced memref parameters.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: 4003: add AES CTR test case
Adds a test case for AES CTR with a buffer big enough to trigger the
regression fixed by https://github.com/OP-TEE/optee_os/pull/2243.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds a test case for AES CTR with a buffer big enough to trigger the
regression fixed by https://github.com/OP-TEE/optee_os/pull/2243.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Cmake support for xtest only (not TAs)
This introduces support for building the host part (what's running in
linux user space) of xtest using CMake. TAs are as before built using TA
dev kit.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
This introduces support for building the host part (what's running in
linux user space) of xtest using CMake. TAs are as before built using TA
dev kit.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression 6000: fix buffer part compared in 6010 test.
Second half of output buffer was compared in regression test 6010,
whereas first part was filled. Now compare correct part.
Signed-off-by: Mélanie Favre <melanie.favre@provenrun.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Second half of output buffer was compared in regression test 6010,
whereas first part was filled. Now compare correct part.
Signed-off-by: Mélanie Favre <melanie.favre@provenrun.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
xtest storage: can't use object_id from shared memory
According to the GP spec V1.1, the object_id in create/open/rename
functions is not allowed to reside in the shared memory. This change
insures the test TAs use local buffers to store the target file ID.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Zeng Tao <prime.zeng@hisilicon.com>
Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (Qemu, GP)
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
According to the GP spec V1.1, the object_id in create/open/rename
functions is not allowed to reside in the shared memory. This change
insures the test TAs use local buffers to store the target file ID.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Zeng Tao <prime.zeng@hisilicon.com>
Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (Qemu, GP)
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
regression: 4003: merge *4003_xts() and *4003_no_xts()
AES XTS tests were kept separate from the other cipher tests for
historical reasons. Merge them together.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
AES XTS tests were kept separate from the other cipher tests for
historical reasons. Merge them together.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
regression 1010: fix wrong printf format specifier
Fix wrong format specifier, which causes build errors:
error: format '%d' expects argument of type 'int', but argument 4 has type
'size_t {aka long unsigned int}' [-Werror=format=]
"Invalid memory access %u with %d bytes memref",
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Fix wrong format specifier, which causes build errors:
error: format '%d' expects argument of type 'int', but argument 4 has type
'size_t {aka long unsigned int}' [-Werror=format=]
"Invalid memory access %u with %d bytes memref",
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
regression 1010: crash TA with SHM memref passed as parameter
This adds few test cases in regression test 1010 to check TA crash
when the TA is provided a memref as invocation parameter. These
tests aims at checking the dump of memref parameter state in sane
when core detect TA crash and dumps the TA state for debug purpose.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
This adds few test cases in regression test 1010 to check TA crash
when the TA is provided a memref as invocation parameter. These
tests aims at checking the dump of memref parameter state in sane
when core detect TA crash and dumps the TA state for debug purpose.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Android.mk: workaround missing-field-initializers error
Without -Wno-missing-field-initializers, GCC 4.9 generates below
errors, so add it to Android.mk. While we're at it, also add
-Wno-format-zero-length to sync with host/xtest/Makefile.
external/optee_test/host/xtest/regression_5000.c:485:40: error: missing field 'session' initializer [-Werror,-Wmissing-field-initializers]
struct xtest_session connection = { c };
^
external/optee_test/host/xtest/regression_2000.c:46:22: error: missing field 'paramTypes' initializer [-Werror,-Wmissing-field-initializers]
TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
^
external/optee_test/host/xtest/xtest_helpers.h:43:40: note: expanded from macro 'TEEC_OPERATION_INITIALIZER'
^
external/optee_test/host/xtest/regression_2000.c:272:29: error: missing field 'session_id' initializer [-Werror,-Wmissing-field-initializers]
TEEC_Session session = { 0 };
^
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Without -Wno-missing-field-initializers, GCC 4.9 generates below
errors, so add it to Android.mk. While we're at it, also add
-Wno-format-zero-length to sync with host/xtest/Makefile.
external/optee_test/host/xtest/regression_5000.c:485:40: error: missing field 'session' initializer [-Werror,-Wmissing-field-initializers]
struct xtest_session connection = { c };
^
external/optee_test/host/xtest/regression_2000.c:46:22: error: missing field 'paramTypes' initializer [-Werror,-Wmissing-field-initializers]
TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
^
external/optee_test/host/xtest/xtest_helpers.h:43:40: note: expanded from macro 'TEEC_OPERATION_INITIALIZER'
^
external/optee_test/host/xtest/regression_2000.c:272:29: error: missing field 'session_id' initializer [-Werror,-Wmissing-field-initializers]
TEEC_Session session = { 0 };
^
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
xtest 6007: close and re-open object
Update regression test 6007 to close and re-open the persistent object
after truncation and extension.
Reproducer for issue https://github.com/OP-TEE/optee_os/issues/2094.
Suggested-by: Kevin Peng <kevinp@marvell.com>
[jf: add close/open to test_file_hole(), too]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Update regression test 6007 to close and re-open the persistent object
after truncation and extension.
Reproducer for issue https://github.com/OP-TEE/optee_os/issues/2094.
Suggested-by: Kevin Peng <kevinp@marvell.com>
[jf: add close/open to test_file_hole(), too]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Move ta_storage.h to common location
Since ta_storage.h is used by several TAs move it into a common
location.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Since ta_storage.h is used by several TAs move it into a common
location.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: 1006: test passing a NULL reference with 0 size
Test case for OP-TEE issue #2105 [1]: passing a NULL memref.buffer is
acceptable as long as memref.size is zero (GP Internal Core API
specification v1.1.2 section 4.9.4).
Link: [1] https://github.com/OP-TEE/optee_os/issues/2105
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU)
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Test case for OP-TEE issue #2105 [1]: passing a NULL memref.buffer is
acceptable as long as memref.size is zero (GP Internal Core API
specification v1.1.2 section 4.9.4).
Link: [1] https://github.com/OP-TEE/optee_os/issues/2105
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU)
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
3 years ago4003: add aes-ctr corner case 3.0.0 3.0.0-rc1 ti2018.00 ti2018.00-rc1 ti2018.00-rc2 ti2018.00-rc3 ti2018.00-rc4 ti2018.00-rc5 ti2018.01 ti2018.01-rc1 ti2018.01-rc2 ti2018.01-rc3 ti2018.01-rc4 ti2018.02-rc1 ti2018.02-rc2 ti2018.02-rc3
4003: add aes-ctr corner case
Adds a AES-CTR corner case to expose a problem in LTC with hardware
accelerated AES encryption.
The fix for the problem is provided in:
https://github.com/OP-TEE/optee_os/pull/2086
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds a AES-CTR corner case to expose a problem in LTC with hardware
accelerated AES encryption.
The fix for the problem is provided in:
https://github.com/OP-TEE/optee_os/pull/2086
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reduce loop count in regression_1012
Reduce the loop count in xtest 1012 from 1000 to 3 in order to minimize
debug traces. There is no point in using a higher value in this
functional test.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reduce the loop count in xtest 1012 from 1000 to 3 in order to minimize
debug traces. There is no point in using a higher value in this
functional test.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
regression 1008: test with corrupt BSTA
Updates case 1008 to corrupt bootstrap TAs instead.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Victor Chong <victor.chong@linaro.org> (hikey aosp)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Updates case 1008 to corrupt bootstrap TAs instead.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Victor Chong <victor.chong@linaro.org> (hikey aosp)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression 1008: remove load_fake_ta() test
Removes the load_fake_ta() test, it's not applicable with bootstrap TAs.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Removes the load_fake_ta() test, it's not applicable with bootstrap TAs.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: remove 9xxx test series
Removes the 9xxx test series as there's new internal tests in OP-TEE
testing this instead. Also when TAs are stored in secure storage all the
file these tests depends on will changed in an even more unpredictable
way.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Removes the 9xxx test series as there's new internal tests in OP-TEE
testing this instead. Also when TAs are stored in secure storage all the
file these tests depends on will changed in an even more unpredictable
way.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
xtest: add --install-tas argument
Adds --install-tas argument which will install all bootstrap TAs
(/lib/optee_armtz/*.bsta) in the OP-TEE TA database.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds --install-tas argument which will install all bootstrap TAs
(/lib/optee_armtz/*.bsta) in the OP-TEE TA database.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: add case 1003 for mutex
Adds regression case 1003 for read/write mutex testing.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds regression case 1003 for read/write mutex testing.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: 4005: add NIST aes-gcm vectors
Adds NIST AES-GCM test vectors to regression case 4005 with
CFG_GCM_NIST_VECTORS=y. Only the first test in each group is
used if CFG_GCM_NIST_VECTORS_LIMITED=y.
With CFG_GCM_NIST_VECTORS=y the size of the xtest binary grows with more
than 10 MiB, unless CFG_GCM_NIST_VECTORS_LIMITED=y is given, then only
by ~1 MiB.
Without CFG_GCM_NIST_VECTORS=y, CFG_GCM_NIST_VECTORS_LIMITED has no
effect.
Android not supported.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds NIST AES-GCM test vectors to regression case 4005 with
CFG_GCM_NIST_VECTORS=y. Only the first test in each group is
used if CFG_GCM_NIST_VECTORS_LIMITED=y.
With CFG_GCM_NIST_VECTORS=y the size of the xtest binary grows with more
than 10 MiB, unless CFG_GCM_NIST_VECTORS_LIMITED=y is given, then only
by ~1 MiB.
Without CFG_GCM_NIST_VECTORS=y, CFG_GCM_NIST_VECTORS_LIMITED has no
effect.
Android not supported.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
regression: 4005: improve test coverage
Improves test coverage:
* in vect3 by feeding one full block and one almost full block
* in vect4 by feeding the first two blocks as complete blocks
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Improves test coverage:
* in vect3 by feeding one full block and one almost full block
* in vect4 by feeding the first two blocks as complete blocks
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
xtest/Makefile: remove extra '@'
Due to an extra '@', 'make V=1' won't print the link command for xtest.
Fix that.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Due to an extra '@', 'make V=1' won't print the link command for xtest.
Fix that.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Android.mk: change to use OPTEE_BIN instead of BUILD_OPTEE_OS
To workaround the problem reported as following
when build OP-TEE with AOSP master:
external/optee_test/Android.mk: error: xtest: LOCAL_ADDITIONAL_DEPENDENCIES must only contain paths (not module names)
change to use $(OPTEE_BIN) defined in optee_os/mk/aosp_optee.mk
which is path like:
out/target/product/hikey/optee/arm-plat-hikey/core/tee.bin
as dependency for xtest instead of using the target of BUILD_OPTEE_OS
Reviewed-by: Victor Chong <victor.chong@linaro.org>
Tested by: Victor Chong <victor.chong@linaro.org> (hikey aosp)
Tested-by: Yongqin Liu <yongqin.liu@linaro.org> (hikey aosp master)
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
To workaround the problem reported as following
when build OP-TEE with AOSP master:
external/optee_test/Android.mk: error: xtest: LOCAL_ADDITIONAL_DEPENDENCIES must only contain paths (not module names)
change to use $(OPTEE_BIN) defined in optee_os/mk/aosp_optee.mk
which is path like:
out/target/product/hikey/optee/arm-plat-hikey/core/tee.bin
as dependency for xtest instead of using the target of BUILD_OPTEE_OS
Reviewed-by: Victor Chong <victor.chong@linaro.org>
Tested by: Victor Chong <victor.chong@linaro.org> (hikey aosp)
Tested-by: Yongqin Liu <yongqin.liu@linaro.org> (hikey aosp master)
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
xtest storage: add case 6019 for storage independence
The TA's storage should be independent of each other. What ever
TA #2 do should not affect TA #1's stroage.
Signed-off-by: Jianhui Li <airbak.li@hisilicon.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
The TA's storage should be independent of each other. What ever
TA #2 do should not affect TA #1's stroage.
Signed-off-by: Jianhui Li <airbak.li@hisilicon.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
xtest storage: add a test case of creation of already existing object
Regression xtest 6012 already tests creation and recreation of a
persistent object. This change adds a test in 6012 to re-create the
existing object without setting the overwrite attribute. Creation
should fail but the object should not be altered and later open
should succeed.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Regression xtest 6012 already tests creation and recreation of a
persistent object. This change adds a test in 6012 to re-create the
existing object without setting the overwrite attribute. Creation
should fail but the object should not be altered and later open
should succeed.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
xtest: deprecated bass_return_code
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
xtest: regression 1xxx: at least warn if test pseudo TA not found
Following tests depends on pseudo TAs in the TEE core but xtest is
not expected to report an error if the pTAs are not found.
This change adds some verbosity to help one to understand to test
was skipped and restricts allowed error status to item-not-found.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Following tests depends on pseudo TAs in the TEE core but xtest is
not expected to report an error if the pTAs are not found.
This change adds some verbosity to help one to understand to test
was skipped and restricts allowed error status to item-not-found.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
xtest 1014: minor beautification
Keep a 80char/line alignment.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Keep a 80char/line alignment.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds AES-GCM performance test in aes-perf
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
3 years agoxtest:sdp: fix a xtest crash if TEE is built without test pTA 2.6.0 ti2017.05 ti2017.05-rc4 ti2017.06 ti2017.06-rc1 ti2017.06-rc2 ti2017.06-rc3 ti2017.06-rc4
xtest:sdp: fix a xtest crash if TEE is built without test pTA
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
xtest:sdp: support old ION API if new API fails
Implement the old ION API using ion0_ or ION0_ as prefix.
Routine allocate_ion_buffer() attempts to allocate using the new
API. If the 1st request (query heap types) fails, try the old API.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey 4.9/4.12)
Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (Qemus 4.9/4.12)
Implement the old ION API using ion0_ or ION0_ as prefix.
Routine allocate_ion_buffer() attempts to allocate using the new
API. If the 1st request (query heap types) fails, try the old API.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey 4.9/4.12)
Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (Qemus 4.9/4.12)
xtest/sdp: sync with ION udpates from linux kernel 4.12
Userland should query ION for the ID of the target heap.
Ioctls ION_IOC_FREE and ION_IOC_SHARE are still defined in the uapi
but no more supported by the kernel driver. Ioctl ION_IOC_ALLOC
returns returns a generic dmabuf file descriptor that references
the target buffer.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey)
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Userland should query ION for the ID of the target heap.
Ioctls ION_IOC_FREE and ION_IOC_SHARE are still defined in the uapi
but no more supported by the kernel driver. Ioctl ION_IOC_ALLOC
returns returns a generic dmabuf file descriptor that references
the target buffer.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey)
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
regression: add case 1002
Adds regression case 1002 to test passing a memory buffer to a Pseudo
TA.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds regression case 1002 to test passing a memory buffer to a Pseudo
TA.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
xtest: add -DTA_DIR to meet different requirement
TA_DIR default value is "/lib/optee_armtz", it should be
able to be changed for different requirement.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jianhui Li <airbak.li@hisilicon.com>
TA_DIR default value is "/lib/optee_armtz", it should be
able to be changed for different requirement.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jianhui Li <airbak.li@hisilicon.com>