File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
src/hyperlight_host/src/hypervisor/hyperlight_vm Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,6 @@ impl HyperlightVm {
292292 let mut rflags = 1 << 1 ; // RFLAGS.1 is RES1
293293 if self . pending_tlb_flush {
294294 rflags |= 1 << 6 ; // set ZF if we need a tlb flush done before anything else executes
295- self . pending_tlb_flush = false ;
296295 }
297296 // set RIP and RSP, reset others
298297 let regs = CommonRegisters {
@@ -319,13 +318,20 @@ impl HyperlightVm {
319318 . set_fpu ( & CommonFpu :: default ( ) )
320319 . map_err ( DispatchGuestCallError :: SetupRegs ) ?;
321320
322- self . run (
323- mem_mgr,
324- host_funcs,
325- #[ cfg( gdb) ]
326- dbg_mem_access_fn,
327- )
328- . map_err ( DispatchGuestCallError :: Run )
321+ let result = self
322+ . run (
323+ mem_mgr,
324+ host_funcs,
325+ #[ cfg( gdb) ]
326+ dbg_mem_access_fn,
327+ )
328+ . map_err ( DispatchGuestCallError :: Run ) ;
329+
330+ // Clear the TLB flush flag only after run() returns. The guest
331+ // may have been cancelled before it executed the flush.
332+ self . pending_tlb_flush = false ;
333+
334+ result
329335 }
330336
331337 /// Resets the following vCPU state:
You can’t perform that action at this time.
0 commit comments