-
Notifications
You must be signed in to change notification settings - Fork 7.4k
fix potential speculative access that might trigger bus faults on Cortex-M7 #90305
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
fix potential speculative access that might trigger bus faults on Cortex-M7 #90305
Conversation
Due to erratum ERR011573, speculative accesses might be performed to normal memory unmapped in the MPU. This can be avoided by using MPU region 0 to cover all unmapped memory and make this region execute-never and inaccessible. Fixes zephyrproject-rtos#89852 Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com> Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Due to erratum 1013783-B, speculative accesses might be performed to normal memory unmapped in the MPU. This can be avoided by using MPU region 0 to cover all unmapped memory and make this region execute-never and inaccessible. Note that this applies when CPU Cortex-M7 implements MPU and D-cache. Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
|
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
/* Erratum 1013783-B (SDEN-1068427): use first region to prevent speculative access | ||
* in entire memory space | ||
*/ | ||
MPU_REGION_ENTRY("BACKGROUND", |
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.
nit: "UNMAPPED" would be a better name
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.
I didn’t get to address this due to the timezone difference, already merged :)
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.
small nit but rest LGTM, thanks.
Due to erratum 1013783-B, speculative accesses might be performed to normal memory unmapped in the MPU. This can be avoided by using MPU region 0 to cover all unmapped memory and make this region execute-never and inaccessible.
Note that this applies for all Cortex-M7 revisions implementing MPU and D-cache, so although the issue was reported for
mr_canhubk3
board that implements custom SoC MPU regions, I added the fix for any Cortex-M7 SoC having those features enabled.Fixes #89852