Skip to content
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

kernel: init: option to zero noinit memory #48172

Conversation

cfriedt
Copy link
Member

@cfriedt cfriedt commented Jul 22, 2022

Add CONFIG_ZERO_NOINIT_MEMORY to explicitly zero memory regions marked __noinit at startup.

This is useful for systems with ECC memory.

Fixes #39598

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>
Copy link
Member

@stephanosio stephanosio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful for systems with ECC memory.

IMO, that should be handled by the memory subsystem/driver managing that particular ECC memory or by the SoC layer if the ECC memory is part of the SoC.

After all, not properly initialising the ECC-checked memory area (or initialising the ECC data based on the current random content of the ECC-checked memory area) is the memory driver's bug.

@cfriedt
Copy link
Member Author

cfriedt commented Jul 24, 2022

IMO, that should be handled by the memory subsystem/driver managing that particular ECC memory or by the SoC layer if the ECC memory is part of the SoC.

@stephanosio - Interesting. I'll look into the possibility of upstreaming the memory controller as well, but this change would be required in any event.

After all, not properly initialising the ECC-checked memory area (or initialising the ECC data based on the current random content of the ECC-checked memory area) is the memory driver's bug.

In this case, the ECC controller does not have a way to initialize from a random state so memory must be written at startup. Adding functionality like z_bss_zero() was also suggested previously.

#39599 (review)

Note: __noinit only applies to SRAM regions.

@stephanosio
Copy link
Member

AFAIK, we do not yet have such a subsystem/driver.

https://github.com/zephyrproject-rtos/zephyr/tree/main/drivers/memc

Adding functionality like z_bss_zero() was also suggested previously.

ECC memory initialisation is platform and/or memory controller-specific and should be handled by the SoC layer or the memory controller driver.

@github-actions
Copy link

This pull request 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 pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Sep 23, 2022
@github-actions github-actions bot closed this Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use of __noinit with ecc memory hangs system
2 participants