Skip to content

Commit

Permalink
don't drop guard until cr3 was updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Freax13 committed Nov 13, 2024
1 parent 05cb8ec commit c5fce39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tee/kernel/src/memory/pagetable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ impl Pagetables {
if needs_flush {
flush_state_guard.needs_flush.set(ap_index, false);
}
drop(flush_state_guard);

if update_required || needs_flush {
if let Some(pcid_allocation) = allocations.pcid_allocation.as_ref() {
Expand All @@ -472,10 +471,11 @@ impl Pagetables {
Cr3::write(allocations.pml4, Cr3Flags::empty());
}
}
}
drop(flush_state_guard);

if update_required {
*guard = Some(allocations.clone());
}
if update_required {
*guard = Some(allocations.clone());
}

let guard = RefMut::map(guard, |a| a.as_mut().unwrap());
Expand Down

0 comments on commit c5fce39

Please sign in to comment.