Skip to content

Commit 30b24de

Browse files
committed
[hyperlight_host] mshv: dump core on unknown HV message
Usually, an unknown HV message is the result of a double fault or similar: something going wrong in the guest. This commit ensures that a core file is generated when this happens and the crashdump feature is enabled. Signed-off-by: Lucy Menon <[email protected]> [hyperlight_host] Expose MemoryRegion structure It is a convenient tuple of information to use when mapping a new region into the sandbox. Signed-off-by: Lucy Menon <[email protected]>
1 parent 21077d6 commit 30b24de

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/hyperlight_host/src/hypervisor/hyperv_linux.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,8 @@ impl Hypervisor for HypervLinuxDriver {
775775
}
776776
other => {
777777
crate::debug!("mshv Other Exit: Exit: {:#?} \n {:#?}", other, &self);
778+
#[cfg(crashdump)]
779+
let _ = crashdump::generate_crashdump(self);
778780
log_then_return!("unknown Hyper-V run message type {:?}", other);
779781
}
780782
},

src/hyperlight_host/src/mem/memory_region.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@ pub enum MemoryRegionType {
182182
#[derive(Debug, Clone, PartialEq, Eq)]
183183
pub struct MemoryRegion {
184184
/// the range of guest memory addresses
185-
pub(crate) guest_region: Range<usize>,
185+
pub guest_region: Range<usize>,
186186
/// the range of host memory addresses
187-
pub(crate) host_region: Range<usize>,
187+
pub host_region: Range<usize>,
188188
/// memory access flags for the given region
189-
pub(crate) flags: MemoryRegionFlags,
189+
pub flags: MemoryRegionFlags,
190190
/// the type of memory region
191-
pub(crate) region_type: MemoryRegionType,
191+
pub region_type: MemoryRegionType,
192192
}
193193

194194
pub(crate) struct MemoryRegionVecBuilder {

0 commit comments

Comments
 (0)