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

snRuntime: Mutexes might be uninitialized #19

Open
huettern opened this issue Dec 2, 2021 · 2 comments
Open

snRuntime: Mutexes might be uninitialized #19

huettern opened this issue Dec 2, 2021 · 2 comments

Comments

@huettern
Copy link
Contributor

huettern commented Dec 2, 2021

crt0 currently doesn't init the .bss section. A mutex placed in .bss (e.g. clint_mutex in interrupt.c) is therefore in an uninitialized state leading to deadlocks. A fix to this should also conform to multi-cluster systems which are not participating in the cluster-wide barrier at the end of crt0.

@paulsc96 paulsc96 transferred this issue from pulp-platform/snitch Jul 11, 2023
@paulsc96
Copy link
Collaborator

@colluca Does this issue still apply? I don't see start.S initializing .bss; maybe a define-guarded init as for thread and cluster could be done.

@colluca
Copy link
Collaborator

colluca commented Jul 12, 2023

@colluca Does this issue still apply? I don't see start.S initializing .bss; maybe a define-guarded init as for thread and cluster could be done.

@paulsc96 This shouldn't apply anymore. BSS section is initialized here:

static inline void snrt_init_bss() {
extern volatile uint32_t __bss_start, __bss_end;
// Only one core needs to perform the initialization
if (snrt_cluster_idx() == 0 && snrt_is_dm_core()) {
volatile uint32_t* p;
for (p = (uint32_t*)(&__bss_start); p < (uint32_t*)(&__bss_end); p++) {
*p = 0;
}
}
}

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

No branches or pull requests

3 participants