pulp-platform / snitch_cluster

An energy-efficient RISC-V floating-point compute cluster.
https://pulp-platform.github.io/snitch_cluster/
Apache License 2.0
51 stars 52 forks source link

snRuntime: Mutexes might be uninitialized #19

Closed huettern closed 1 month ago

huettern commented 2 years ago

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 commented 1 year ago

@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 commented 1 year ago

@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: https://github.com/pulp-platform/snitch_cluster/blob/b5016fe6272e980fffa7166bc9c75c9fa436f22d/sw/snRuntime/src/start.c#L45-L56