File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ pub enum VmInstructionError {
44
44
InvalidOperandToInveptInvvpid = 28 ,
45
45
}
46
46
47
- pub fn check_vm_insruction ( rflags : u64 , error : String ) -> Result < ( ) > {
47
+ pub fn check_vm_instruction ( rflags : u64 , error : & str ) -> Result < ( ) > {
48
48
let rflags = rflags:: RFlags :: from_bits_truncate ( rflags) ;
49
49
50
50
if rflags. contains ( RFlags :: FLAGS_CF ) {
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ impl VCpu {
171
171
/// Begin execution in the guest context for this core
172
172
pub fn launch ( & mut self ) -> Result < !> {
173
173
let rflags = unsafe { vmlaunch_wrapper ( ) } ;
174
- error:: check_vm_insruction ( rflags, "Failed to launch vm" . into ( ) ) ?;
174
+ error:: check_vm_instruction ( rflags, "Failed to launch vm" ) ?;
175
175
176
176
unreachable ! ( )
177
177
}
Original file line number Diff line number Diff line change @@ -333,9 +333,9 @@ fn vmcs_write(field: VmcsField, value: u64) -> Result<()> {
333
333
rflags
334
334
} ;
335
335
336
- error:: check_vm_insruction (
336
+ error:: check_vm_instruction (
337
337
rflags,
338
- format ! ( "Failed to write 0x{:x} to field {:?}" , value, field) ,
338
+ format ! ( "Failed to write 0x{:x} to field {:?}" , value, field) . as_str ( ) ,
339
339
)
340
340
}
341
341
@@ -369,7 +369,7 @@ fn vmcs_activate(vmcs: &mut Vmcs, _vmx: &vmx::Vmx) -> Result<()> {
369
369
rflags
370
370
} ;
371
371
372
- error:: check_vm_insruction ( rflags, "Failed to activate VMCS" . into ( ) )
372
+ error:: check_vm_instruction ( rflags, "Failed to activate VMCS" )
373
373
}
374
374
375
375
fn vmcs_clear ( vmcs_page : & mut Raw4kPage ) -> Result < ( ) > {
@@ -382,7 +382,7 @@ fn vmcs_clear(vmcs_page: &mut Raw4kPage) -> Result<()> {
382
382
: "volatile" ) ;
383
383
rflags
384
384
} ;
385
- error:: check_vm_insruction ( rflags, "Failed to clear VMCS" . into ( ) )
385
+ error:: check_vm_instruction ( rflags, "Failed to clear VMCS" )
386
386
}
387
387
388
388
pub struct Vmcs {
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ pub extern "C" fn vmexit_handler(state: *mut GuestCpuState) {
54
54
55
55
#[ no_mangle]
56
56
pub extern "C" fn vmresume_failure_handler ( rflags : u64 ) {
57
- error:: check_vm_insruction ( rflags, "Failed to vmresume" . into ( ) )
57
+ error:: check_vm_instruction ( rflags, "Failed to vmresume" )
58
58
. expect ( "vmresume failed" ) ;
59
59
}
60
60
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ impl Vmx {
52
52
rflags
53
53
} ;
54
54
55
- error:: check_vm_insruction ( rflags, "Failed to enable vmx" . into ( ) ) ?;
55
+ error:: check_vm_instruction ( rflags, "Failed to enable vmx" ) ?;
56
56
Ok ( Vmx {
57
57
_vmxon_region : vmxon_region,
58
58
} )
@@ -70,7 +70,7 @@ impl Vmx {
70
70
rflags
71
71
} ;
72
72
73
- error:: check_vm_insruction ( rflags, "Failed to disable vmx" . into ( ) )
73
+ error:: check_vm_instruction ( rflags, "Failed to disable vmx" )
74
74
}
75
75
76
76
pub fn revision ( ) -> u32 {
@@ -90,7 +90,7 @@ impl Vmx {
90
90
: "m" ( val) , "r" ( t) ) ;
91
91
rflags
92
92
} ;
93
- error:: check_vm_insruction ( rflags, "Failed to execute invept" . into ( ) )
93
+ error:: check_vm_instruction ( rflags, "Failed to execute invept" )
94
94
}
95
95
96
96
pub fn invvpid ( & self , mode : InvVpidMode ) -> Result < ( ) > {
@@ -112,7 +112,7 @@ impl Vmx {
112
112
: "m" ( val) , "r" ( t) ) ;
113
113
rflags
114
114
} ;
115
- error:: check_vm_insruction ( rflags, "Failed to execute invvpid" . into ( ) )
115
+ error:: check_vm_instruction ( rflags, "Failed to execute invvpid" )
116
116
}
117
117
}
118
118
You can’t perform that action at this time.
0 commit comments