-
Notifications
You must be signed in to change notification settings - Fork 198
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
xtest: regression 1100: add OCALL tests #434
base: master
Are you sure you want to change the base?
Conversation
9811147
to
15dc3f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @HernanGatta ,
Thanks for your work on these tests. Please see my comments below.
FYI, I have tested this on QEMUv8 with Clang 9.0.1 out of curiosity, and all went well.
#define TA_UUID TA_OCALL_UUID | ||
|
||
#define TA_FLAGS (TA_FLAG_SINGLE_INSTANCE | \ | ||
TA_FLAG_MULTI_SESSION | \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MULTI_SESSION
flag should not be needed. I mean, I know it is, due to the way the test is written (I tried running without and test_ocall_during_session_open()
fails to open a session since the one initially created for the param tests is not closed yet).
I would recommend changing xtest_tee_test_1100()
slightly or splitting it in two so that we can make sure OCALLs work in single instance single session TAs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good point, I was also not happy with this. I'll work on it.
This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed pull request at any time. |
Removed the stale label |
This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed pull request at any time. |
Removed the stale label |
I added the label "enhancement", which should prevent the bot from marking this as stale if I configured it correctly. However, I noticed that I only did that change for |
@jbech-linaro good idea. I have added the enhancement label to the |
cf363b9
to
5de1f7b
Compare
host/xtest/xtest_test.c
Outdated
#ifdef WITH_GP_TESTS | ||
const TEEC_UUID gp_tta_ds_uuid = TA_TTA_DS_UUID; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase error, was removed by commit c1acd29 ("xtest: remove GP test TA UUID")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed, thank you!
With the erroneous GP lines removed:
|
5de1f7b
to
4956c7e
Compare
Thank you, and applied. I do still have the single instance question to resolve though, so do feel free to rescind the ack. |
No problem, we can take this later. |
Add 10 tests that check the behaviour of the OCALL functionality. The tests in question are detailed below: OCALL without parameters: ------------------------- Performs an OCALL without any parameters. OCALL with value parameters (in/inout/out/in): ---------------------------------------------- Performs an OCALL with value parameters and in parameter directions, verifying that the values are transferred correctly between normal world and secure world. OCALL with memref parameters (in/inout/out/in): ----------------------------------------------- Performs an OCALL with memref parameters and in parameter directions, verifying that the bufers are transferred correctly between normal world and secure world. Close session during OCALL: --------------------------- Performs an OCALL that closes the session through which the original function invocation was performed. Ascertains that the OCALL is cancelled and that the session is closed. Finalize context during OCALL: ------------------------------ Performs an OCALL that finalizes the context through which the original function invocation was performed. Ascertains that the OCALL is cancelled and that the session that was originally used to perform the function invocation is closed as a result of the context being finalized. NULL memref param: ------------------ Verifies that OCALLs can carry memref parameters with NULL buffers in all directions. NULL memref param (mixed params): --------------------------------- Verifies that OCALLs can carry memref parameters with NULL buffers alongside value and non-NULL memref parameters in various directions. NULL memref param (invalid params): ----------------------------------- Verifies that attempting to perform an OCALL with memref parameters with a NULL buffer and a non-zero size and with a non-NULL buffer and a zero size fails at the Internal Core API layer. OCALL during session open: -------------------------- Ascertains that the CA can receive an OCALL during session open. Finalize context during session open OCALL: ------------------------------------------- Performs an OCALL during session open that finalizes the context via which the session was being opened, verifies that the OCALL is cancelled, and that the session fails to open. Signed-off-by: Hernan Gatta <hegatta@microsoft.com> Acked-by: Jerome Forissier <jerome@forissier.org>
4956c7e
to
da00f36
Compare
Latest push is a rebase only. |
Add 10 tests that check the behaviour of the OCALL functionality. The tests
in question are detailed below:
OCALL without parameters:
Performs an OCALL without any parameters.
OCALL with value parameters (in/inout/out/in):
Performs an OCALL with value parameters and in parameter directions,
verifying that the values are transferred correctly between normal world
and secure world.
OCALL with memref parameters (in/inout/out/in):
Performs an OCALL with memref parameters and in parameter directions,
verifying that the bufers are transferred correctly between normal world
and secure world.
Close session during OCALL:
Performs an OCALL that closes the session through which the original
function invocation was performed. Ascertains that the OCALL is cancelled
and that the session is closed.
Finalize context during OCALL:
Performs an OCALL that finalizes the context through which the original
function invocation was performed. Ascertains that the OCALL is cancelled
and that the session that was originally used to perform the function
invocation is closed as a result of the context being finalized.
NULL memref param:
Verifies that OCALLs can carry memref parameters with NULL buffers in all
directions.
NULL memref param (mixed params):
Verifies that OCALLs can carry memref parameters with NULL buffers
alongside value and non-NULL memref parameters in various directions.
NULL memref param (invalid params):
Verifies that attempting to perform an OCALL with memref parameters with a
NULL buffer and a non-zero size and with a non-NULL buffer and a zero size
fails at the Internal Core API layer.
OCALL during session open:
Ascertains that the CA can receive an OCALL during session open.
Finalize context during session open OCALL:
Performs an OCALL during session open that finalizes the context via which
the session was being opened, verifies that the OCALL is cancelled, and
that the session fails to open.
Signed-off-by: Hernan Gatta hegatta@microsoft.com