Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QEMUv8/Xen: several GP tests fail on memref parameter check #4897

Closed
jforissier opened this issue Oct 1, 2021 · 2 comments
Closed

QEMUv8/Xen: several GP tests fail on memref parameter check #4897

jforissier opened this issue Oct 1, 2021 · 2 comments

Comments

@jforissier
Copy link
Contributor

Several test from the GP test suite are failing on QEMUv8 with Xen (Dom0):

optee/build $ export GP_PACKAGE=~/work/TEE_Initial_Configuration-Test_Suite_v2_0_0_2-2017_06_09.7z
optee/build $ make -j10 XEN_BOOT=y run
...
$ xtest gp_
...
gp_10081 FAILED first error at gp_10000.c:1653
gp_10082 FAILED first error at gp_10000.c:1673
gp_10083 FAILED first error at gp_10000.c:1693
gp_10155 FAILED first error at gp_10000.c:3346
gp_10156 FAILED first error at gp_10000.c:3366
gp_10157 FAILED first error at gp_10000.c:3386
gp_10229 FAILED first error at gp_10000.c:5039
gp_10230 FAILED first error at gp_10000.c:5059
gp_10231 FAILED first error at gp_10000.c:5079
gp_10303 FAILED first error at gp_10000.c:6732
gp_10304 FAILED first error at gp_10000.c:6752
gp_10305 FAILED first error at gp_10000.c:6772
gp_10632 FAILED first error at gp_10000.c:15608
gp_10633 FAILED first error at gp_10000.c:15629
gp_10634 FAILED first error at gp_10000.c:15650
gp_10706 FAILED first error at gp_10000.c:17375
gp_10707 FAILED first error at gp_10000.c:17396
gp_10708 FAILED first error at gp_10000.c:17417
gp_10780 FAILED first error at gp_10000.c:19142
gp_10781 FAILED first error at gp_10000.c:19163
gp_10782 FAILED first error at gp_10000.c:19184
gp_10854 FAILED first error at gp_10000.c:20909
gp_10855 FAILED first error at gp_10000.c:20930
gp_10856 FAILED first error at gp_10000.c:20951

For each failed test there is a TA log:

E/TA:  checkUpdateParameterMemref:195 Received buffer is not NULL but expected to be NULL.

...so it looks like all failures have the same root cause.

Version information:

optee $ repo forall -c 'V=$(git describe --tags --always --dirty); N=$(pwd | sed 's@.*/@@'); printf "%-21s %s\\n" $N $V'
build                 3.14.0-13-gc573039
buildroot             2021.08
edk2                  edk2-stable202105
berkeley-softfloat-3  b64af41
brotli                v1.0.7-17-g666c328
esaxx                 ca7cb33
libdivsufsort         2.0.1-14-g5f60d6f
openssl               OpenSSL_1_1_1j
boringssl             version_for_cocoapods_9.0-42-g2070f8ad9
krb5                  krb5-1.17.1-final
pyca-cryptography     2.3-65-g09403100
brotli                v1.0.7-17-g666c328
esaxx                 ca7cb33
libdivsufsort         2.0.1-14-g5f60d6f
oniguruma             v6.9.4_mark1
jansson               v2.13.1
cmocka                cmocka-1.1.5-23-g1cc9cde
linux                 f8e3503c8f36
mbedtls               mbedtls-2.26.0
optee_benchmark       3.14.0
optee_client          3.14.0-13-g98e0c1a
optee_examples        3.14.0-2-gff4b493
optee_os              3.14.0-105-ge4ca953c
optee_rust            v0.1.0-25-gdfd51b7
optee_test            3.14.0-9-ge4c33f4
qemu                  v6.0.0
trusted-firmware-a    v2.5
u-boot                v2021.04
xen                   RELEASE-4.14.1
@jenswi-linaro
Copy link
Contributor

It may be worth checking if the OP-TEE mediator in Xen is handling OPTEE_SMC_SEC_CAP_MEMREF_NULL.

@jforissier
Copy link
Contributor Author

It may be worth checking if the OP-TEE mediator in Xen is handling OPTEE_SMC_SEC_CAP_MEMREF_NULL.

Yes, that is indeed the problem. Support was introduced by commit d4fb5f166c2b ("optee: enable OPTEE_SMC_SEC_CAP_MEMREF_NULL capability") which is in the master branch bur not in release 4.14.1. So I am closing this issue.

jforissier added a commit to jforissier/optee_repo_build_files that referenced this issue Jun 27, 2022
Adds Xen upstream patch "optee: enable OPTEE_SMC_SEC_CAP_MEMREF_NULL
capability" in order to avoid failures in the GlobalPlatform test
suite [2]:

 optee/build $ export GP_PACKAGE=~/work/TEE_Initial_Configuration-Test_Suite_v2_0_0_2-2017_06_09.7z
 optee/build $ make -j10 XEN_BOOT=y run
 ...
 $ xtest gp_
 ...
 gp_10081 FAILED first error at gp_10000.c:1653
 gp_10082 FAILED first error at gp_10000.c:1673
 gp_10083 FAILED first error at gp_10000.c:1693
 gp_10155 FAILED first error at gp_10000.c:3346
 gp_10156 FAILED first error at gp_10000.c:3366
 gp_10157 FAILED first error at gp_10000.c:3386
 gp_10229 FAILED first error at gp_10000.c:5039
 gp_10230 FAILED first error at gp_10000.c:5059
 gp_10231 FAILED first error at gp_10000.c:5079
 gp_10303 FAILED first error at gp_10000.c:6732
 gp_10304 FAILED first error at gp_10000.c:6752
 gp_10305 FAILED first error at gp_10000.c:6772
 gp_10632 FAILED first error at gp_10000.c:15608
 gp_10633 FAILED first error at gp_10000.c:15629
 gp_10634 FAILED first error at gp_10000.c:15650
 gp_10706 FAILED first error at gp_10000.c:17375
 gp_10707 FAILED first error at gp_10000.c:17396
 gp_10708 FAILED first error at gp_10000.c:17417
 gp_10780 FAILED first error at gp_10000.c:19142
 gp_10781 FAILED first error at gp_10000.c:19163
 gp_10782 FAILED first error at gp_10000.c:19184
 gp_10854 FAILED first error at gp_10000.c:20909
 gp_10855 FAILED first error at gp_10000.c:20930
 gp_10856 FAILED first error at gp_10000.c:20951

For each failed test there is a TA log:

 E/TA:  checkUpdateParameterMemref:195 Received buffer is not NULL but expected to be NULL.

Link: [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=d4fb5f166c2b
Link: [2] OP-TEE/optee_os#4897
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
jforissier added a commit to jforissier/optee_repo_build_files that referenced this issue Jun 28, 2022
Adds Xen upstream patch "optee: enable OPTEE_SMC_SEC_CAP_MEMREF_NULL
capability" ([1] present in Xen 4.16.0) in order to avoid failures in
the GlobalPlatform test suite [2]:

 optee/build $ export GP_PACKAGE=~/work/TEE_Initial_Configuration-Test_Suite_v2_0_0_2-2017_06_09.7z
 optee/build $ make -j10 XEN_BOOT=y run
 ...
 $ xtest gp_
 ...
 gp_10081 FAILED first error at gp_10000.c:1653
 gp_10082 FAILED first error at gp_10000.c:1673
 gp_10083 FAILED first error at gp_10000.c:1693
 gp_10155 FAILED first error at gp_10000.c:3346
 gp_10156 FAILED first error at gp_10000.c:3366
 gp_10157 FAILED first error at gp_10000.c:3386
 gp_10229 FAILED first error at gp_10000.c:5039
 gp_10230 FAILED first error at gp_10000.c:5059
 gp_10231 FAILED first error at gp_10000.c:5079
 gp_10303 FAILED first error at gp_10000.c:6732
 gp_10304 FAILED first error at gp_10000.c:6752
 gp_10305 FAILED first error at gp_10000.c:6772
 gp_10632 FAILED first error at gp_10000.c:15608
 gp_10633 FAILED first error at gp_10000.c:15629
 gp_10634 FAILED first error at gp_10000.c:15650
 gp_10706 FAILED first error at gp_10000.c:17375
 gp_10707 FAILED first error at gp_10000.c:17396
 gp_10708 FAILED first error at gp_10000.c:17417
 gp_10780 FAILED first error at gp_10000.c:19142
 gp_10781 FAILED first error at gp_10000.c:19163
 gp_10782 FAILED first error at gp_10000.c:19184
 gp_10854 FAILED first error at gp_10000.c:20909
 gp_10855 FAILED first error at gp_10000.c:20930
 gp_10856 FAILED first error at gp_10000.c:20951

For each failed test there is a TA log:

 E/TA:  checkUpdateParameterMemref:195 Received buffer is not NULL but expected to be NULL.

Link: [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=d4fb5f166c2b
Link: [2] OP-TEE/optee_os#4897
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
jforissier added a commit to OP-TEE/build that referenced this issue Jun 28, 2022
Adds Xen upstream patch "optee: enable OPTEE_SMC_SEC_CAP_MEMREF_NULL
capability" ([1] present in Xen 4.16.0) in order to avoid failures in
the GlobalPlatform test suite [2]:

 optee/build $ export GP_PACKAGE=~/work/TEE_Initial_Configuration-Test_Suite_v2_0_0_2-2017_06_09.7z
 optee/build $ make -j10 XEN_BOOT=y run
 ...
 $ xtest gp_
 ...
 gp_10081 FAILED first error at gp_10000.c:1653
 gp_10082 FAILED first error at gp_10000.c:1673
 gp_10083 FAILED first error at gp_10000.c:1693
 gp_10155 FAILED first error at gp_10000.c:3346
 gp_10156 FAILED first error at gp_10000.c:3366
 gp_10157 FAILED first error at gp_10000.c:3386
 gp_10229 FAILED first error at gp_10000.c:5039
 gp_10230 FAILED first error at gp_10000.c:5059
 gp_10231 FAILED first error at gp_10000.c:5079
 gp_10303 FAILED first error at gp_10000.c:6732
 gp_10304 FAILED first error at gp_10000.c:6752
 gp_10305 FAILED first error at gp_10000.c:6772
 gp_10632 FAILED first error at gp_10000.c:15608
 gp_10633 FAILED first error at gp_10000.c:15629
 gp_10634 FAILED first error at gp_10000.c:15650
 gp_10706 FAILED first error at gp_10000.c:17375
 gp_10707 FAILED first error at gp_10000.c:17396
 gp_10708 FAILED first error at gp_10000.c:17417
 gp_10780 FAILED first error at gp_10000.c:19142
 gp_10781 FAILED first error at gp_10000.c:19163
 gp_10782 FAILED first error at gp_10000.c:19184
 gp_10854 FAILED first error at gp_10000.c:20909
 gp_10855 FAILED first error at gp_10000.c:20930
 gp_10856 FAILED first error at gp_10000.c:20951

For each failed test there is a TA log:

 E/TA:  checkUpdateParameterMemref:195 Received buffer is not NULL but expected to be NULL.

Link: [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=d4fb5f166c2b
Link: [2] OP-TEE/optee_os#4897
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants