Add pta self test for firmware handoff#7352
Conversation
d3a9cdb to
3e36539
Compare
|
For "core: kernel: fix bug in transfer_list_add" with the fixup: |
|
For commit "core: pta: add self tests for transfer list" with the fixups and Jens' comment addressed: |
| tl->alignment != TRANSFER_LIST_INIT_MAX_ALIGN || | ||
| tl->size != sizeof(*tl) || | ||
| tl->max_size != TEST_TL_MAX_SIZE || | ||
| tl->flags != TL_FLAGS_HAS_CHECKSUM) { |
There was a problem hiding this comment.
Also check transfer_list_verify_checksum()?
| $(eval $(call cfg-enable-all-depends,CFG_TRANSFER_LIST, \ | ||
| CFG_DT CFG_EXTERNAL_DT CFG_MAP_EXT_DT_SECURE)) | ||
|
|
||
| CFG_TRANSFER_LIST_TEST ?= $(CFG_TRANSFER_LIST) |
There was a problem hiding this comment.
A short description would be nice. Maybe tell that CFG_ENABLE_EMBEDDED_TESTS needs to be enabled to have the test embedded.
There was a problem hiding this comment.
I guess you mean CFG_TEE_CORE_EMBED_INTERNAL_TESTS?
I can replace it with:
CFG_TRANSFER_LIST_TEST ?= $(call cfg-all-enabled,CFG_TRANSFER_LIST \
CFG_TEE_CORE_EMBED_INTERNAL_TESTS)
and move it under the line:
# Enable core self tests and related pseudo TAs
CFG_TEE_CORE_EMBED_INTERNAL_TESTS ?= $(CFG_ENABLE_EMBEDDED_TESTS)
Then we don't need to add additional inline comments.
There was a problem hiding this comment.
I guess you mean CFG_TEE_CORE_EMBED_INTERNAL_TESTS?
Yes, sorry.
I can replace it with:
(...)
Sound good to me, still with a short description for CFG_TRANSFER_LIST_TEST, like:
# Embed transfer list support self test when enabled
2a51fbb to
a62e15a
Compare
|
All comments are addressed. |
jenswikl
left a comment
There was a problem hiding this comment.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
etienne-lms
left a comment
There was a problem hiding this comment.
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> for commit
"core: kernel: fix bug in transfer_list_add()".
Nitpicking comment/question for commit "core: pta: add self tests for transfer list". Otherwise LGTM.
| tl_e = transfer_list_add(tl, tag_id, data_size, data); | ||
| else | ||
| tl_e = transfer_list_add_with_align(tl, tag_id, data_size, data, | ||
| align); |
There was a problem hiding this comment.
Nitpicking: calling only transfer_list_add_with_align(..., align) should be enough.
There was a problem hiding this comment.
Here is just to test different API entries.
| new_te_next = transfer_list_next(tl, tl_e); | ||
|
|
||
| /* skip the inserted void entry if it exists */ | ||
| if (new_te_next->tag_id == TL_TAG_EMPTY) |
There was a problem hiding this comment.
Suggestion in case there are several empty slot + in case there is no next entry:
- if (new_te_next->tag_id == TL_TAG_EMPTY)
+ while (new_te_next && new_te_next->tag_id == TL_TAG_EMPTY)Bythe way, how come new_te_next is not NULL when this function is called by transfer_list_tests() at line 215 to change TEST_TE3_ID data size.
There was a problem hiding this comment.
Good question. When expanding the data region of an entry, it tries to end up with the address that fits the potential 'next' entry with the data alignment required, even when it is the last entry - That is the case you see in line 215, a void entry was added at the tail.
It is not bad but I think it is fair enough to check if it is the last one and avoid to filling the gap with the void entry.
I will add a small fix.
Fix the missing cast on the target address when doing memmove. Get the address of entry data via transfer_list_entry_data() instead of adding offset. Fixes: a122250 ("core: add transfer list API") Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
a62e15a to
ff5ac8c
Compare
|
All comments are addressed. |
transfer_list_set_data_size() appends a void entry for the following entries to meet the alignment requirement even when it is the last one, thus add a check before appending. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Add self tests for transfer list. Adapt CFG_TRANSFER_LIST with its dependencies and add CFG_TRANSFER_LIST_TEST. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
ff5ac8c to
08d576f
Compare
|
All tags are added. |
Fix a pointer casting bug in transfer_list_add().
Add self tests for transfer list.
Adapt CFG_TRANSFER_LIST with its dependencies and add CFG_TRANSFER_LIST_TEST.
Xtest entry is added at:
OP-TEE/optee_test#788
Build with Transfer List enabled is added at:
OP-TEE/build#821