-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save/restore interrupt state during context switch (#1036)
Previously, there were no guarantees about the value of the interrupt flag when context switching. If the context switch was voluntary, i.e. a task called `schedule()` to yield the CPU, interrupts would most likely be enabled. If a task was preempted, interrupts would be disabled. This could result in a preempted task A switching to a task B that voluntarily yielded, causing task B to return from the call to `schedule()` with interrupts disabled, which usually isn't desirable. Now, this can no longer happen due to saving and restoring the state of interrupts for a task when context switching away from or to it, respectively. * On aarch64, this corresponds to the DAIF+NZCV bitflags of `PSTATE`. * On x86_64, this corresponds to the IF bit flag of the `RFLAGS` register. Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com> Co-authored-by: Nathan Royer <nathan.royer.pro@gmail.com> 349adf8
- Loading branch information
1 parent
a1710e6
commit 5de443a
Showing
22 changed files
with
64 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.