@@ -125,9 +125,9 @@ pub enum KVMiMsrIndices {
125
125
SysenterCs = 0x174 ,
126
126
SysenterEsp = 0x175 ,
127
127
SysenterEip = 0x176 ,
128
- MsrEfer = 0xc0000080 ,
129
- MsrStar = 0xc0000081 ,
130
- MsrLstar = 0xc0000082 ,
128
+ MsrEfer = 0xc0000080u32 ,
129
+ MsrStar = 0xc0000081u32 ,
130
+ MsrLstar = 0xc0000082u32 ,
131
131
}
132
132
133
133
pub enum SocketType {
@@ -191,7 +191,7 @@ impl KvmMsrs {
191
191
let mut msrs = KvmMsrs {
192
192
internal_msrs : unsafe { Box :: from_raw ( internal_msrs) } ,
193
193
} ;
194
- let mut msrs_as_slice = msrs. as_slice_mut ( ) ;
194
+ let msrs_as_slice = msrs. as_slice_mut ( ) ;
195
195
msrs_as_slice[ 0 ] . index = KVMiMsrIndices :: SysenterCs as u32 ;
196
196
msrs_as_slice[ 1 ] . index = KVMiMsrIndices :: SysenterEsp as u32 ;
197
197
msrs_as_slice[ 2 ] . index = KVMiMsrIndices :: SysenterEip as u32 ;
@@ -479,7 +479,7 @@ impl KVMIntrospectable for KVMi {
479
479
return Err ( Error :: last_os_error ( ) ) ;
480
480
}
481
481
let ev_type = unsafe {
482
- let ev_u8 = ( * ev_ptr) . event . common . event . try_into ( ) . unwrap ( ) ;
482
+ let ev_u8 = ( * ev_ptr) . event . common . event . into ( ) ;
483
483
match KVMiInterceptType :: from_u32 ( ev_u8) . unwrap ( ) {
484
484
KVMiInterceptType :: PauseVCPU => KVMiEventType :: PauseVCPU ,
485
485
KVMiInterceptType :: Breakpoint => KVMiEventType :: Breakpoint {
@@ -500,10 +500,8 @@ impl KVMIntrospectable for KVMi {
500
500
} ,
501
501
502
502
KVMiInterceptType :: Cr => KVMiEventType :: Cr {
503
- cr_type : KVMiCr :: from_i32 (
504
- ( * ev_ptr) . event . __bindgen_anon_1 . cr . cr . try_into ( ) . unwrap ( ) ,
505
- )
506
- . unwrap ( ) ,
503
+ cr_type : KVMiCr :: from_i32 ( ( * ev_ptr) . event . __bindgen_anon_1 . cr . cr . into ( ) )
504
+ . unwrap ( ) ,
507
505
new : ( * ev_ptr) . event . __bindgen_anon_1 . cr . new_value ,
508
506
old : ( * ev_ptr) . event . __bindgen_anon_1 . cr . old_value ,
509
507
} ,
@@ -556,15 +554,15 @@ impl KVMIntrospectable for KVMi {
556
554
KVMiEventType :: PauseVCPU => {
557
555
let size = mem:: size_of :: < EventReplyCommon > ( ) ;
558
556
let rpl_ptr: * const c_void = & reply_common as * const _ as * const c_void ;
559
- ( self . libkvmi . reply_event ) ( self . dom , seq, rpl_ptr, size as usize )
557
+ ( self . libkvmi . reply_event ) ( self . dom , seq, rpl_ptr, size)
560
558
}
561
559
KVMiEventType :: Breakpoint {
562
560
gpa : _,
563
561
insn_len : _,
564
562
} => {
565
563
let size = mem:: size_of :: < EventReplyCommon > ( ) ;
566
564
let rpl_ptr: * const c_void = & reply_common as * const _ as * const c_void ;
567
- ( self . libkvmi . reply_event ) ( self . dom , seq, rpl_ptr, size as usize )
565
+ ( self . libkvmi . reply_event ) ( self . dom , seq, rpl_ptr, size)
568
566
}
569
567
KVMiEventType :: Pagefault {
570
568
gpa : _,
@@ -589,7 +587,7 @@ impl KVMIntrospectable for KVMi {
589
587
reply. pf . ctx_data = [ 0 ; 256 ] ;
590
588
let size = mem:: size_of :: < EventReplyPagefault > ( ) ;
591
589
let rpl_ptr: * const c_void = & reply as * const _ as * const c_void ;
592
- ( self . libkvmi . reply_event ) ( self . dom , seq, rpl_ptr, size as usize )
590
+ ( self . libkvmi . reply_event ) ( self . dom , seq, rpl_ptr, size)
593
591
}
594
592
KVMiEventType :: Cr {
595
593
cr_type : _,
@@ -609,7 +607,7 @@ impl KVMIntrospectable for KVMi {
609
607
reply. cr . new_val = new;
610
608
let size = mem:: size_of :: < EventReplyCr > ( ) ;
611
609
let rpl_ptr: * const c_void = & reply as * const _ as * const c_void ;
612
- ( self . libkvmi . reply_event ) ( self . dom , seq, rpl_ptr, size as usize )
610
+ ( self . libkvmi . reply_event ) ( self . dom , seq, rpl_ptr, size)
613
611
}
614
612
615
613
KVMiEventType :: Msr {
@@ -631,7 +629,7 @@ impl KVMIntrospectable for KVMi {
631
629
reply. msr . new_val = new;
632
630
let size = mem:: size_of :: < EventReplyMsr > ( ) ;
633
631
let rpl_ptr: * const c_void = & reply as * const _ as * const c_void ;
634
- ( self . libkvmi . reply_event ) ( self . dom , seq, rpl_ptr, size as usize )
632
+ ( self . libkvmi . reply_event ) ( self . dom , seq, rpl_ptr, size)
635
633
}
636
634
} ;
637
635
0 commit comments