Skip to content

Commit c7d5978

Browse files
authored
Move snapshot file + small reset_vcpu/apply_sregs refactor (#1456)
* Move sandbox snapshot.rs into snapshot module dir Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> * Extract HyperlightVm apply_sregs helper Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> --------- Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
1 parent 7b16d5b commit c7d5978

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

  • src/hyperlight_host/src

src/hyperlight_host/src/hypervisor/hyperlight_vm/x86_64.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,15 @@ impl HyperlightVm {
346346
self.vm.set_debug_regs(&CommonDebugRegs::default())?;
347347
self.vm.reset_xsave()?;
348348

349+
self.apply_sregs(cr3, sregs)
350+
}
351+
352+
/// Apply special registers and mark TLB for flush.
353+
pub(crate) fn apply_sregs(
354+
&mut self,
355+
cr3: u64,
356+
sregs: &CommonSpecialRegisters,
357+
) -> std::result::Result<(), RegisterError> {
349358
// Restore the full special registers from snapshot, but update CR3
350359
// to point to the new (relocated) page tables
351360
let mut sregs = *sregs;
File renamed without changes.

0 commit comments

Comments
 (0)