Skip to content

Commit 5dc2313

Browse files
committed
gdb: weird thing with windows crashing from hv call
Signed-off-by: Doru Blânzeanu <[email protected]>
1 parent f2fa50b commit 5dc2313

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/hyperlight_host/src/hypervisor/windows_hypervisor_platform.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,14 +518,19 @@ impl VMProcessor {
518518
WHV_REGISTER_VALUE { Reg64: regs.dr7 },
519519
];
520520

521-
unsafe {
521+
let ret_val = unsafe {
522522
WHvSetVirtualProcessorRegisters(
523523
self.get_partition_hdl(),
524524
0,
525525
names.as_ptr(),
526526
LEN as u32,
527527
values.as_ptr(),
528-
)?
528+
)
529+
};
530+
531+
if ret_val.is_err() {
532+
println!("Failed to set debug registers: {:?}", ret_val);
533+
return Err(new_error!("Call to WHvSetVirtualProcessorRegisters failed"));
529534
}
530535

531536
Ok(())

0 commit comments

Comments
 (0)