-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Bluetooth: Host: fix stack overflow and improve timing performance for ECC emulation #82217
Bluetooth: Host: fix stack overflow and improve timing performance for ECC emulation #82217
Conversation
@sjanc if/when the CI is green, can you please launch AutoPTS? |
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.
nitpick... Nice if the commit title is "Bluetooth: Host: ...". Otherwise LGTM.
When BT_SEND_ECC_EMULATION and the platform uses Mbed TLS as PSA Crypto provider, we select the Cortex-M software optimized implementation of the secp256r1 curve algorithms. This is much faster than the standard support provided by Mbed TLS and it also reduces ROM footprint. Signed-off-by: Valerio Setti <[email protected]>
After the switch from TinyCrypt to PSA Crypto API as crypto backend, runtime crashes might happen on some platform due to BT_LONG_WQ's stack size not being large enough. This commit fixes this issue. Signed-off-by: Valerio Setti <[email protected]>
e3126db
to
6698bed
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.
Looks fine to me, assuming that CI and auto-pts are green.
And assuming that the tests are green, I think it would be good to fast-track merging this. Not sure if it'd be ok to add the Hotfix label, since this isn't fixing direct upstream CI breakage, but it is definitely unblocking other kinds of testing and potentially fixing downstream CI issues. |
This reverts commit 184c0f9. Reducing system heap memory to 1024 caused runtime failures on some platforms. This commit revert that change and return to the previous size. Signed-off-by: Valerio Setti <[email protected]>
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.
Approved as a quick fix.
But there should be a followup. The Bluetooth subsystem should not have to know about all kinds of implementations of crypto and when it's possible to enable them.
Instead Bluetooth should just declare a dependency on a particular API, and the crypto subsystem should figure out how to optimize that request. Something like select WANT_CRYPTO_SECP256R1
maybe?
0b912ec
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.
Changes look good, but I'll need to run some on-target tests first
#AutoPTS run zephyr nrf53 SM |
Scheduled PR #82217 (comment), board: nrf53, estimated start time: 10:53:12, test case count: 71, estimated duration: 0 Test cases to be runSM/CEN/PROT/BV-01-CSM/CEN/JW/BV-05-C SM/CEN/JW/BI-04-C SM/CEN/JW/BI-01-C SM/CEN/PKE/BV-01-C SM/CEN/PKE/BV-04-C SM/CEN/PKE/BI-01-C SM/CEN/PKE/BI-02-C SM/CEN/OOB/BV-01-C SM/CEN/OOB/BV-03-C SM/CEN/OOB/BV-09-C SM/CEN/OOB/BI-01-C SM/CEN/EKS/BV-01-C SM/CEN/EKS/BI-01-C SM/CEN/SIGN/BV-01-C SM/CEN/SIGN/BV-03-C SM/CEN/SIGN/BI-01-C SM/CEN/KDU/BV-04-C SM/CEN/KDU/BV-05-C SM/CEN/KDU/BV-06-C SM/CEN/KDU/BV-10-C SM/CEN/KDU/BV-11-C SM/CEN/KDU/BI-04-C SM/CEN/PIS/BV-02-C SM/CEN/PIS/BV-03-C SM/CEN/SCJW/BV-01-C SM/CEN/SCJW/BV-04-C SM/CEN/SCJW/BI-01-C SM/CEN/SCPK/BV-01-C SM/CEN/SCPK/BV-04-C SM/CEN/SCPK/BI-01-C SM/CEN/SCPK/BI-02-C SM/CEN/SCOB/BV-01-C SM/CEN/SCOB/BV-04-C SM/CEN/SCOB/BI-01-C SM/CEN/SCOB/BI-04-C SM/PER/PROT/BV-02-C SM/PER/JW/BV-02-C SM/PER/JW/BI-03-C SM/PER/JW/BI-02-C SM/PER/PKE/BV-02-C SM/PER/PKE/BV-05-C SM/PER/PKE/BI-03-C SM/PER/OOB/BV-02-C SM/PER/OOB/BV-04-C SM/PER/OOB/BV-10-C SM/PER/OOB/BI-02-C SM/PER/EKS/BV-02-C SM/PER/EKS/BI-02-C SM/PER/KDU/BV-01-C SM/PER/KDU/BV-02-C SM/PER/KDU/BV-03-C SM/PER/KDU/BV-07-C SM/PER/KDU/BV-08-C SM/PER/KDU/BV-09-C SM/PER/KDU/BI-02-C SM/PER/KDU/BI-03-C SM/PER/KDU/BI-04-C SM/PER/PIS/BV-01-C SM/PER/PIS/BV-02-C SM/PER/SCJW/BV-02-C SM/PER/SCJW/BV-03-C SM/PER/SCJW/BI-02-C SM/PER/SCPK/BV-02-C SM/PER/SCPK/BV-03-C SM/PER/SCPK/BI-03-C SM/PER/SCPK/BI-04-C SM/PER/SCOB/BV-02-C SM/PER/SCOB/BV-03-C SM/PER/SCOB/BI-02-C SM/PER/SCOB/BI-03-C |
A hotfix for the (unrelated) CI failure is here: #82222 |
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.
Everything works out of the box and the performs is on par with TC
Great work
AutoPTS Bot results: Failed tests (2)SM SM/CEN/KDU/BI-04-C FAILSM SM/PER/KDU/BI-04-C FAIL Successful tests (69)SM SM/CEN/EKS/BI-01-C PASSSM SM/CEN/EKS/BV-01-C PASS SM SM/CEN/JW/BI-01-C PASS SM SM/CEN/JW/BI-04-C PASS SM SM/CEN/JW/BV-05-C PASS SM SM/CEN/KDU/BV-04-C PASS SM SM/CEN/KDU/BV-05-C PASS SM SM/CEN/KDU/BV-06-C PASS SM SM/CEN/KDU/BV-10-C PASS SM SM/CEN/KDU/BV-11-C PASS SM SM/CEN/OOB/BI-01-C PASS SM SM/CEN/OOB/BV-01-C PASS SM SM/CEN/OOB/BV-03-C PASS SM SM/CEN/OOB/BV-09-C PASS SM SM/CEN/PIS/BV-02-C PASS SM SM/CEN/PIS/BV-03-C PASS SM SM/CEN/PKE/BI-01-C PASS SM SM/CEN/PKE/BI-02-C PASS SM SM/CEN/PKE/BV-01-C PASS SM SM/CEN/PKE/BV-04-C PASS SM SM/CEN/PROT/BV-01-C PASS SM SM/CEN/SCJW/BI-01-C PASS SM SM/CEN/SCJW/BV-01-C PASS SM SM/CEN/SCJW/BV-04-C PASS SM SM/CEN/SCOB/BI-01-C PASS SM SM/CEN/SCOB/BI-04-C PASS SM SM/CEN/SCOB/BV-01-C PASS SM SM/CEN/SCOB/BV-04-C PASS SM SM/CEN/SCPK/BI-01-C PASS SM SM/CEN/SCPK/BI-02-C PASS SM SM/CEN/SCPK/BV-01-C PASS SM SM/CEN/SCPK/BV-04-C PASS SM SM/CEN/SIGN/BI-01-C PASS SM SM/CEN/SIGN/BV-01-C PASS SM SM/CEN/SIGN/BV-03-C PASS SM SM/PER/EKS/BI-02-C PASS SM SM/PER/EKS/BV-02-C PASS SM SM/PER/JW/BI-02-C PASS SM SM/PER/JW/BI-03-C PASS SM SM/PER/JW/BV-02-C PASS SM SM/PER/KDU/BI-02-C PASS SM SM/PER/KDU/BI-03-C PASS SM SM/PER/KDU/BV-01-C PASS SM SM/PER/KDU/BV-02-C PASS SM SM/PER/KDU/BV-03-C PASS SM SM/PER/KDU/BV-07-C PASS SM SM/PER/KDU/BV-08-C PASS SM SM/PER/KDU/BV-09-C PASS SM SM/PER/OOB/BI-02-C PASS SM SM/PER/OOB/BV-02-C PASS SM SM/PER/OOB/BV-04-C PASS SM SM/PER/OOB/BV-10-C PASS SM SM/PER/PIS/BV-01-C PASS SM SM/PER/PIS/BV-02-C PASS SM SM/PER/PKE/BI-03-C PASS SM SM/PER/PKE/BV-02-C PASS SM SM/PER/PKE/BV-05-C PASS SM SM/PER/PROT/BV-02-C PASS SM SM/PER/SCJW/BI-02-C PASS SM SM/PER/SCJW/BV-02-C PASS SM SM/PER/SCJW/BV-03-C PASS SM SM/PER/SCOB/BI-02-C PASS SM SM/PER/SCOB/BI-03-C PASS SM SM/PER/SCOB/BV-02-C PASS SM SM/PER/SCOB/BV-03-C PASS SM SM/PER/SCPK/BI-03-C PASS SM SM/PER/SCPK/BI-04-C PASS SM SM/PER/SCPK/BV-02-C PASS SM SM/PER/SCPK/BV-03-C PASS |
These are expected results (the failing tests were also failing before the TC deprecation). |
This commit comments out some test AC cases that are failing in bsim. These will be investigated in PR zephyrproject-rtos#82199. Signed-off-by: Valerio Setti <[email protected]>
43dd9c1
@fabiobaltieri here's a follow-up for the results of
The ROM increase is half of what it was with #79931. Edit: if you also want to save RAM, you can set
|
@valeriosetti cool, thanks for the followup. |
This is also fixing breakage on Silabs boards, as discovered here: #81702 |
Added the Hotfix label, since I think this falls under what's defined here: https://docs.zephyrproject.org/latest/project/dev_env_and_tools.html#hotfix |
This PR fixes issues (1) and (3) reported here, i.e.
and also potentially reduce issue (4), i.e.