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

fix(interrupts): replace compiler fences with potentially-synchronizing assembly #440

Merged
merged 2 commits into from
Oct 13, 2023

Commits on Oct 13, 2023

  1. fix(interrupts): replace compiler fences with potentially-synchronizi…

    …ng assembly
    
    Compiler fences only synchronize with atomic instructions. When creating a thread-local critical section, we need to prevent reordering of any reads and writes across interrupt toggles, not just atomic ones. To achieve this, we omit `nomem` from `asm!`. Since then, the assembly might potentially perform synchronizing operations such as acquiring or releasing a lock, the compiler won't move any reads and writes through these assembly blocks.
    
    Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
    mkroening committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    bb1bdd4 View commit details
    Browse the repository at this point in the history
  2. fix(interrupts): add preserves_flags option

    `IF` from `EFLAGS` must not be restored upon exiting the asm block.
    https://doc.rust-lang.org/stable/reference/inline-assembly.html#rules-for-inline-assembly
    
    Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
    mkroening committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    745e7fc View commit details
    Browse the repository at this point in the history