@@ -662,27 +662,29 @@ impl Hypervisor for HypervWindowsDriver {
662662 WHV_RUN_VP_EXIT_REASON ( 8193i32 ) => {
663663 debug ! ( "HyperV Cancelled Details :\n {:#?}" , & self ) ;
664664 #[ cfg( gdb) ]
665- if debug_interrupt {
666- self . interrupt_handle
667- . debug_interrupt
668- . store ( false , Ordering :: Relaxed ) ;
669-
670- // If the vCPU was stopped because of an interrupt, we need to
671- // return a special exit reason so that the gdb thread can handle it
672- // and resume execution
673- HyperlightExit :: Debug ( VcpuStopReason :: Interrupt )
674- } else if !cancel_was_requested_manually {
675- // This was an internal cancellation
676- // The virtualization stack can use this function to return the control
677- // of a virtual processor back to the virtualization stack in case it
678- // needs to change the state of a VM or to inject an event into the processor
679- // see https://learn.microsoft.com/en-us/virtualization/api/hypervisor-platform/funcs/whvcancelrunvirtualprocessor#remarks
680- debug ! ( "Internal cancellation detected, returning Retry error" ) ;
681- // Track erroneous vCPU kick - internal cancellation not requested by user
682- metrics:: counter!( crate :: metrics:: METRIC_ERRONEOUS_VCPU_KICK ) . increment ( 1 ) ;
683- HyperlightExit :: Retry ( )
684- } else {
685- HyperlightExit :: Cancelled ( )
665+ {
666+ if debug_interrupt {
667+ self . interrupt_handle
668+ . debug_interrupt
669+ . store ( false , Ordering :: Relaxed ) ;
670+
671+ // If the vCPU was stopped because of an interrupt, we need to
672+ // return a special exit reason so that the gdb thread can handle it
673+ // and resume execution
674+ HyperlightExit :: Debug ( VcpuStopReason :: Interrupt )
675+ } else if !cancel_was_requested_manually {
676+ // This was an internal cancellation
677+ // The virtualization stack can use this function to return the control
678+ // of a virtual processor back to the virtualization stack in case it
679+ // needs to change the state of a VM or to inject an event into the processor
680+ // see https://learn.microsoft.com/en-us/virtualization/api/hypervisor-platform/funcs/whvcancelrunvirtualprocessor#remarks
681+ debug ! ( "Internal cancellation detected, returning Retry error" ) ;
682+ // Track erroneous vCPU kick - internal cancellation not requested by user
683+ metrics:: counter!( crate :: metrics:: METRIC_ERRONEOUS_VCPU_KICK ) . increment ( 1 ) ;
684+ HyperlightExit :: Retry ( )
685+ } else {
686+ HyperlightExit :: Cancelled ( )
687+ }
686688 }
687689
688690 #[ cfg( not( gdb) ) ]
0 commit comments