-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
use of __noinit with ecc memory hangs system #39598
Comments
The `__noinit` option is useful for 1. preserving sram across reboots 2. reducing the size of `.bss` and speeding-up init However, some systems (such as those with ECC memory) can fault / hang when reading from previously unwritten memory. Default `CONFIG_NOINIT` to `y` to preserve existing behaviour. Fixes zephyrproject-rtos#39598 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Hi @cfriedt
Do you know exact places where it happens? I can't imagine the reason for shell / logging for reading from __noinit before writing to it. |
I can try to find some details (e.g. stack traces) but it may be confidential. Will try my best. Alternatively, it may be possible to try and trigger faults using MMU / MPU regions. |
Look at doing something similar to |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
Add `CONFIG_ZERO_NOINIT_MEMORY` to explicitly zero memory regions marked `__noinit` at startup. This is useful for systems with ECC memory. Fixes zephyrproject-rtos#39598 Signed-off-by: Christopher Friedt <cfriedt@fb.com>
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
The solution suggested in #48172 is that the solution should be part of a specific memory controller driver implementation. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
Describe the bug
The
__noinit
attribute is used primarily for the purposes listed below:.bss
Some configurations may also use
__noinit
to skip initialization of memory regions initialized by other application-specific hardware.There have been two identified areas where memory regions marked as
__noinit
are read-from before they are written-to - specifically, the shell and logging subsystems. Issuing a read before a write might be reasonable in certain scenarios, but for some systems with ECC-enabled memory controllers, a read operation before a write operation will cause the memory controller to issue a fault, hanging the system.To Reproduce
In the above cases, the system is completely hung before the boot banner was even printed.
Expected behavior
The system is not hung.
Impact
Showstopper
Logs and console output
There are no logs, nor is there any output on the console. It may be possible to find a stacktrace.
Environment (please complete the following information):
Additional context
This problem cannot be reproduced on non-ECC systems, and specifically, the ECC memory controller must also be configured to check SRAM memory regions. It is not obvious if there are any readily-available Zephyr community boards that include an ECC memory controller. This may highlight previously unknown race conditions, but those fixes may be considerably more involved. Therefore, the linked PR is mainly for mitigation purposes.
The text was updated successfully, but these errors were encountered: