Skip to content

Commit 5d362ba

Browse files
committed
hvf: fix set_el2_enabled function signature
The second argument is a bool, not a pointer to a bool. Signed-off-by: Sergio Lopez <[email protected]>
1 parent 8c1d473 commit 5d362ba

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/hvf/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub struct HvfNestedBindings {
210210
hv_vm_config_get_el2_supported:
211211
libloading::Symbol<'static, unsafe extern "C" fn(*mut bool) -> hv_return_t>,
212212
hv_vm_config_set_el2_enabled:
213-
libloading::Symbol<'static, unsafe extern "C" fn(hv_vm_config_t, *mut bool) -> hv_return_t>,
213+
libloading::Symbol<'static, unsafe extern "C" fn(hv_vm_config_t, bool) -> hv_return_t>,
214214
}
215215

216216
pub struct HvfVm {}
@@ -248,8 +248,7 @@ impl HvfVm {
248248
return Err(Error::NestedCheck);
249249
}
250250

251-
let mut el2_enabled = true;
252-
let ret = unsafe { (bindings.hv_vm_config_set_el2_enabled)(config, &mut el2_enabled) };
251+
let ret = unsafe { (bindings.hv_vm_config_set_el2_enabled)(config, true) };
253252
if ret != HV_SUCCESS {
254253
return Err(Error::EnableEL2);
255254
}

0 commit comments

Comments
 (0)