Skip to content

Issue DSB; ISB after changing FPU status to ensure completion #43

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

Closed
wants to merge 1 commit into from
Closed

Conversation

whitequark
Copy link
Contributor

@whitequark whitequark commented Jun 12, 2017

This is necessary according to ARM, I suppose if some VFP op got scheduled right after an inlined FPU enable it would be trouble.

@japaric
Copy link
Member

japaric commented Jun 14, 2017

This is necessary according to ARM

Could you add a comment with a link to the documentation that states this?

Are these instructions also required when disabling the FPU? If so, shouldn't they be called before disabling the FPU? Wondering if the pipeline may execute the CPACR write while some floating point op is in progress or something like that.

@whitequark
Copy link
Contributor Author

Actually now that I look again, Cortex-M4 TRM does not say that DSB/ISB are required:
screenshot_20170617_105917

@whitequark whitequark closed this Jun 17, 2017
@whitequark whitequark deleted the dsb-isb branch June 17, 2017 11:02
adamgreig pushed a commit that referenced this pull request Jan 12, 2022
Zero cost stack overflow protection, take 2
adamgreig pushed a commit that referenced this pull request Jan 12, 2022
this commit adds LLD support by removing all INFO sections. LLD kind of supports INFO in the form of
NOLOAD but when the linker script contains NOLOAD sections LLD emits a binary with false `size`
information: for example, it reported a fake increase of 20KB in .text and a fake increase of 1KB in
.bss when compiling a program that only allocates a single Box.

As the INFO sections are gone we can no longer support the stack overflow protection added in #43 so
all the other related changes, like making _stack_start overridable, have been removed as well.
If you want to continue using stack overflow protection you can stick to v0.3.x.

As the .debug_gdb_scripts output section has been removed from the linker script these changes will
only reliably support both LD and LLD if/when rust-lang/rust#49728 lands.

closes #53
reitermarkus pushed a commit to reitermarkus/cortex-m that referenced this pull request May 4, 2022
this commit adds LLD support by removing all INFO sections. LLD kind of supports INFO in the form of
NOLOAD but when the linker script contains NOLOAD sections LLD emits a binary with false `size`
information: for example, it reported a fake increase of 20KB in .text and a fake increase of 1KB in
.bss when compiling a program that only allocates a single Box.

As the INFO sections are gone we can no longer support the stack overflow protection added in rust-embedded#43 so
all the other related changes, like making _stack_start overridable, have been removed as well.
If you want to continue using stack overflow protection you can stick to v0.3.x.

As the .debug_gdb_scripts output section has been removed from the linker script these changes will
only reliably support both LD and LLD if/when rust-lang/rust#49728 lands.

closes rust-embedded#53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants