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

Go back to backup/restore SpinLockIRQ system #191

Merged
merged 1 commit into from
Feb 22, 2019

Conversation

roblabla
Copy link
Member

See #190

This is not the final solution. API is still unsound, but it at least works when the invariants are upheld...

@todo
Copy link

todo bot commented Feb 21, 2019

Find sane design for SpinLockIRQ safety

Currently, SpinLockIRQ API is unsound. If the guards are dropped in the wrong order, it may cause IF to be reset too early.
Ideally, we would need a way to prevent the guard variable to be reassigned. AKA: prevent moving. Note that this is different from what the Pin API solves. The Pin API is about locking a variable in one memory location, but its binding may still be moved and dropped. Unfortunately, Rust does not have a way to express that a value cannot be reassigned.
Another possibility would be to switch to a callback API. This would solve the problem, but the scheduler would be unable to consume such locks. Maybe we could have an unsafe "scheduler_relock" function that may only be called from the scheduler?


https://github.com/roblabla42/KFS/blob/8eed485f3b8085f9df4fdb27d1c10e869e6d76cd/kernel/src/sync.rs#L53-L63


This comment was generated by todo based on a TODO comment in 8eed485 in #191. cc @roblabla.

Copy link
Member

@marysaka marysaka left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@Orycterope Orycterope left a comment

Choose a reason for hiding this comment

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

Nice

@Orycterope Orycterope merged commit ce3b912 into sunriseos:master Feb 22, 2019
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

Successfully merging this pull request may close these issues.

3 participants