Skip to content

Commit 407a2f4

Browse files
committed
Fix clippy warnings for unrelated work
Signed-off-by: Doru Blânzeanu <[email protected]>
1 parent 5d74e19 commit 407a2f4

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

src/hyperlight_host/src/hypervisor/surrogate_process.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,13 @@ impl Drop for SurrogateProcess {
8383
"Failed to return surrogate process to surrogate process manager when dropping : {:?}",
8484
e
8585
);
86-
return;
8786
}
8887
},
8988
Err(e) => {
9089
tracing::error!(
9190
"Failed to get surrogate process manager when dropping SurrogateProcess: {:?}",
9291
e
9392
);
94-
return;
9593
}
9694
}
9795
}

src/hyperlight_host/src/mem/layout.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,24 @@ impl SandboxMemoryLayout {
224224
pub(crate) const PML4_OFFSET: usize = 0x0000;
225225
/// The offset into the sandbox's memory where the Page Directory Pointer
226226
/// Table starts.
227+
#[cfg(feature = "init-paging")]
227228
pub(super) const PDPT_OFFSET: usize = 0x1000;
228229
/// The offset into the sandbox's memory where the Page Directory starts.
230+
#[cfg(feature = "init-paging")]
229231
pub(super) const PD_OFFSET: usize = 0x2000;
230232
/// The offset into the sandbox's memory where the Page Tables start.
233+
#[cfg(feature = "init-paging")]
231234
pub(super) const PT_OFFSET: usize = 0x3000;
232235
/// The address (not the offset) to the start of the page directory
236+
#[cfg(feature = "init-paging")]
233237
pub(super) const PD_GUEST_ADDRESS: usize = Self::BASE_ADDRESS + Self::PD_OFFSET;
234238
/// The address (not the offset) into sandbox memory where the Page
235239
/// Directory Pointer Table starts
240+
#[cfg(feature = "init-paging")]
236241
pub(super) const PDPT_GUEST_ADDRESS: usize = Self::BASE_ADDRESS + Self::PDPT_OFFSET;
237242
/// The address (not the offset) into sandbox memory where the Page
238243
/// Tables start
244+
#[cfg(feature = "init-paging")]
239245
pub(super) const PT_GUEST_ADDRESS: usize = Self::BASE_ADDRESS + Self::PT_OFFSET;
240246
/// The maximum amount of memory a single sandbox will be allowed.
241247
/// The addressable virtual memory with current paging setup is virtual address 0x0 - 0x40000000 (excl.),

src/hyperlight_host/src/mem/mgr.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@ impl SandboxMemoryManager<ExclusiveSharedMemory> {
340340
shared_mem.write_u64(offset, load_addr_u64)?;
341341
}
342342

343+
// The load method returns a LoadInfo which can also be a different type once the
344+
// `unwind_guest` feature is enabled.
345+
#[allow(clippy::let_unit_value)]
343346
let load_info = exe_info.load(
344347
load_addr.clone().try_into()?,
345348
&mut shared_mem.as_mut_slice()[layout.get_guest_code_offset()..],

src/hyperlight_host/src/sandbox/initialized_multi_use.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ impl MultiUseSandbox {
136136
/// `rgn.region_type` is ignored, since guest PTEs are not created
137137
/// for the new memory.
138138
///
139+
/// # Safety
139140
/// It is the caller's responsibility to ensure that the host side
140141
/// of the region remains intact and is not written to until this
141142
/// mapping is removed, either due to the destruction of the
@@ -161,6 +162,7 @@ impl MultiUseSandbox {
161162
/// Map the contents of a file into the guest at a particular address
162163
///
163164
/// Returns the length of the mapping
165+
#[allow(dead_code)]
164166
#[instrument(err(Debug), skip(self, _fp, _guest_base), parent = Span::current())]
165167
pub(crate) fn map_file_cow(&mut self, _fp: &Path, _guest_base: u64) -> Result<u64> {
166168
#[cfg(windows)]

0 commit comments

Comments
 (0)