fix: spinlock alignement issue in aarch64 causing so3 to crash#142
Merged
AndreCostaaa merged 6 commits intomainfrom Apr 4, 2025
Merged
Conversation
| @@ -218,11 +218,11 @@ long syscall_handle(syscall_args_t *a) | |||
| * Mainly used for debugging purposes (kernel mutex validation) at the moment ... */ | |||
|
|
|||
| case SYSCALL_MUTEX_LOCK: | |||
Contributor
There was a problem hiding this comment.
hmm. bad naming of arguments -> please use syscall_args instead of a
Contributor
|
So, the |
Contributor
Author
|
|
fb76d88 to
d6b2e65
Compare
daniel-rossier
approved these changes
Apr 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to fix #141
I first tried to make the
lockinsidespinlock_ta uint64_t and reordering the mutex arguments but that didn't work. I believe the problem is within thepcb_tstruct which causes the misalignment.I tried putting the
__attribute__((aligned(8)))inside thepcb_tstructure but that didn't help.So, I took it a step further and decided to put pcb mutex list in the heap so we can align it by calling as we control how the memory is aligned in the heap
I also took the liberty to:
mutex_lock/unlocksyscalls more robust by actually checking the mutex id instead of just indexing inside the list