@@ -63,7 +63,9 @@ pub(crate) mod crashdump;
6363
6464use std:: fmt:: Debug ;
6565use std:: str:: FromStr ;
66- use std:: sync:: atomic:: { AtomicBool , AtomicU64 , Ordering } ;
66+ #[ cfg( any( kvm, mshv3) ) ]
67+ use std:: sync:: atomic:: AtomicU64 ;
68+ use std:: sync:: atomic:: { AtomicBool , AtomicU8 , Ordering } ;
6769use std:: sync:: { Arc , Mutex } ;
6870#[ cfg( any( kvm, mshv3) ) ]
6971use std:: time:: Duration ;
@@ -588,7 +590,7 @@ pub(super) struct LinuxInterruptHandle {
588590 ///
589591 /// CANCEL_BIT persists across vcpu exits/re-entries within a single `VirtualCPU::run()` call
590592 /// (e.g., during host function calls), but is cleared at the start of each new `VirtualCPU::run()` call.
591- state : AtomicU64 ,
593+ state : AtomicU8 ,
592594
593595 /// Thread ID where the vcpu is running.
594596 ///
@@ -608,10 +610,10 @@ pub(super) struct LinuxInterruptHandle {
608610
609611#[ cfg( any( kvm, mshv3) ) ]
610612impl LinuxInterruptHandle {
611- const RUNNING_BIT : u64 = 1 << 1 ;
612- const CANCEL_BIT : u64 = 1 << 0 ;
613+ const RUNNING_BIT : u8 = 1 << 1 ;
614+ const CANCEL_BIT : u8 = 1 << 0 ;
613615 #[ cfg( gdb) ]
614- const DEBUG_INTERRUPT_BIT : u64 = 1 << 2 ;
616+ const DEBUG_INTERRUPT_BIT : u8 = 1 << 2 ;
615617
616618 /// Get the running, cancel and debug flags atomically.
617619 ///
@@ -756,18 +758,18 @@ pub(super) struct WindowsInterruptHandle {
756758 ///
757759 /// CANCEL_BIT persists across vcpu exits/re-entries within a single `VirtualCPU::run()` call
758760 /// (e.g., during host function calls), but is cleared at the start of each new `VirtualCPU::run()` call.
759- state : AtomicU64 ,
761+ state : AtomicU8 ,
760762
761763 partition_handle : windows:: Win32 :: System :: Hypervisor :: WHV_PARTITION_HANDLE ,
762764 dropped : AtomicBool ,
763765}
764766
765767#[ cfg( target_os = "windows" ) ]
766768impl WindowsInterruptHandle {
767- const RUNNING_BIT : u64 = 1 << 1 ;
768- const CANCEL_BIT : u64 = 1 << 0 ;
769+ const RUNNING_BIT : u8 = 1 << 1 ;
770+ const CANCEL_BIT : u8 = 1 << 0 ;
769771 #[ cfg( gdb) ]
770- const DEBUG_INTERRUPT_BIT : u64 = 1 << 2 ;
772+ const DEBUG_INTERRUPT_BIT : u8 = 1 << 2 ;
771773}
772774
773775#[ cfg( target_os = "windows" ) ]
0 commit comments