-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Codesize exclude psa wrappers #7980
Codesize exclude psa wrappers #7980
Conversation
7a15203
to
02cc720
Compare
bd1d633
to
69d361f
Compare
@bensze01 The ABI-API checker is (reasonably) complaining that the driver wrapper API functions are no longer visible. However, they are internal, and this is an expected outcome from this PR. Unfortunately, that causes the CI to fail. Will we just have to bypass merge queues when it comes time to merge this PR, or can we make the ABI-API check "not fatal"? |
@tom-cosgrove-arm The ABi-API check is not fatal. The checks that have to pass for the merge queue are the ones that have the “Required” annotation. |
5313e2e
to
0633620
Compare
Makefile
Outdated
@@ -14,7 +14,7 @@ no_test: programs | |||
programs: lib mbedtls_test | |||
$(MAKE) -C programs | |||
|
|||
lib: | |||
lib: generated_files |
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.
In principle, this is a good thing: it's good to ensure that the generated files are up-to-date. However this is likely to cause problems for users who work in an environment where they can't re-generate the files (no python, or not the required python modules, or no host C compiler), and where the timestamps on the generated files aren't newer than the primary sources (because the timestamps is in the random order in which the files were copied).
This is more or less went wrong in https://jenkins-mbedtls.oss.arm.com/blue/organizations/jenkins/mbed-tls-pr-head/detail/PR-7980-head/12/pipeline/582 : in this case, the build environment doesn't support make generated_files
(although that's actually a bug in the makefile). Nothing would need to actually be rebuilt since the timestamps of generated files are newer than primary sources, but in this case, the failure happens before make
can check this.
I think the main issue (if make
runs ok but the code to generate the files might fail) can be resolved with order-only prerequisites. But it would have to be on generated_files
in the sub-makefiles: an order-only prerequisite doesn't make sense when the prerequisite is phony.
This is a rather complicated makefile change which should be done in its own pull request. Do you really need it here?
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.
Agreed, not in scope for this PR (but also agreed it's potentially a nice improvement for a separate PR, if you have some spare background time for it).
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.
Agree. I will revert it and file one issue #8163 about this case: https://jenkins-mbedtls.oss.arm.com/blue/organizations/jenkins/mbed-tls-pr-head/detail/PR-7980-head/12/pipeline/582 , in case we need one new PR to solve this.
@xkqian is this ready for review? Please mark as |
I will put it in review once it pass the CI. |
2aa64d2
to
4425867
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.
psa_crypto_driver_wrappers.c
should renamed to header file(.h
) . It is included in another file now, it might confuse others with .c
scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja
Outdated
Show resolved
Hide resolved
/* | ||
* Functions to delegate cryptographic operations to an available | ||
* and appropriate accelerator. | ||
* Warning: This file is now auto-generated. |
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.
Apparently this file is not generated? I don't understand why.
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.
Good point! Originally I find only there are 3 functions in this file, so just put them in the .c file, If we want to generate automatically, we should change the generate script and the the json schema, and maybe the document, that will be one big change. Anyway, I will re-work and try to generate it.
9c44da9
to
a7a247c
Compare
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
ca444b3
to
db3035b
Compare
Rebase done and wait for the CI result. |
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.
LGTM
$(GENERATED_WRAPPER_FILES): ../scripts/generate_driver_wrappers.py | ||
$(GENERATED_WRAPPER_FILES): ../scripts/data_files/driver_templates/psa_crypto_driver_wrappers.h.jinja | ||
$(GENERATED_WRAPPER_FILES): ../scripts/data_files/driver_templates/psa_crypto_driver_wrappers_no_static.c.jinja |
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.
$(gen_file_dep)
got lost here.
Description
When psa_crypto_driver_wrappers.c is created from psa_crypto_driver_wrappers.c.jinja but neither PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT nor PSA_CRYPTO_DRIVER_TEST are set, it should be possible to omit the entire wrapper function.
This PR will provide one prototype which can omit some wrapper functions, such as 2~3 functions.
PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")
provided, ornot required (Part of the epic code size)done, ornot required (Refine of code, 2.28 no needed)provided, ornot required(current test cases are enough)