Skip to content

Commit 7794d3f

Browse files
committed
Remove unused guest parameter
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent cdbf6eb commit 7794d3f

File tree

14 files changed

+13
-42
lines changed

14 files changed

+13
-42
lines changed

Cargo.lock

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/hyperlight_guest/src/entrypoint.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ use crate::guest_logger::init_logger;
2929
use crate::host_function_call::{outb, OutBAction};
3030
use crate::idtr::load_idt;
3131
use crate::{
32-
__security_cookie, HEAP_ALLOCATOR, MIN_STACK_ADDRESS, OS_PAGE_SIZE, OUTB_PTR,
33-
OUTB_PTR_WITH_CONTEXT, P_PEB, RUNNING_MODE,
32+
__security_cookie, HEAP_ALLOCATOR, MIN_STACK_ADDRESS, OUTB_PTR, OUTB_PTR_WITH_CONTEXT, P_PEB,
33+
RUNNING_MODE,
3434
};
3535

3636
#[inline(never)]
@@ -77,7 +77,7 @@ static INIT: Once = Once::new();
7777
// Note: entrypoint cannot currently have a stackframe >4KB, as that will invoke __chkstk on msvc
7878
// target without first having setup global `RUNNING_MODE` variable, which __chkstk relies on.
7979
#[no_mangle]
80-
pub extern "win64" fn entrypoint(peb_address: u64, seed: u64, ops: u64, max_log_level: u64) {
80+
pub extern "win64" fn entrypoint(peb_address: u64, seed: u64, max_log_level: u64) {
8181
if peb_address == 0 {
8282
panic!("PEB address is null");
8383
}
@@ -142,8 +142,6 @@ pub extern "win64" fn entrypoint(peb_address: u64, seed: u64, ops: u64, max_log_
142142
.expect("Failed to access HEAP_ALLOCATOR")
143143
.init(heap_start, heap_size);
144144

145-
OS_PAGE_SIZE = ops as u32;
146-
147145
(*peb_ptr).guest_function_dispatch_ptr = dispatch_function as usize as u64;
148146

149147
reset_error();

src/hyperlight_guest/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub(crate) static mut __security_cookie: u64 = 0;
9797
pub(crate) static mut P_PEB: Option<*mut HyperlightPEB> = None;
9898
pub static mut MIN_STACK_ADDRESS: u64 = 0;
9999

100-
pub static mut OS_PAGE_SIZE: u32 = 0;
101100
pub(crate) static mut OUTB_PTR: Option<extern "win64" fn(u16, u8)> = None;
102101
pub(crate) static mut OUTB_PTR_WITH_CONTEXT: Option<
103102
extern "win64" fn(*mut core::ffi::c_void, u16, u8),

src/hyperlight_host/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ cfg-if = { version = "1.0.0" }
2727
libc = { version = "0.2.170" }
2828
paste = "1.0"
2929
flatbuffers = "25.2.10"
30-
page_size = "0.6.0"
3130
termcolor = "1.2.0"
3231
bitflags = "2.9.0"
3332
lazy_static = "1.4.0"

src/hyperlight_host/src/hypervisor/hyperv_linux.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ impl Hypervisor for HypervLinuxDriver {
201201
&mut self,
202202
peb_addr: RawPtr,
203203
seed: u64,
204-
page_size: u32,
205204
outb_hdl: OutBHandlerWrapper,
206205
mem_access_hdl: MemAccessHandlerWrapper,
207206
hv_handler: Option<HypervisorHandler>,
@@ -215,8 +214,7 @@ impl Hypervisor for HypervLinuxDriver {
215214
// function args
216215
rcx: peb_addr.into(),
217216
rdx: seed,
218-
r8: page_size.into(),
219-
r9: self.get_max_log_level().into(),
217+
r8: self.get_max_log_level().into(),
220218

221219
..Default::default()
222220
};

src/hyperlight_host/src/hypervisor/hyperv_windows.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ impl Hypervisor for HypervWindowsDriver {
303303
&mut self,
304304
peb_address: RawPtr,
305305
seed: u64,
306-
page_size: u32,
307306
outb_hdl: OutBHandlerWrapper,
308307
mem_access_hdl: MemAccessHandlerWrapper,
309308
hv_handler: Option<HypervisorHandler>,
@@ -316,8 +315,7 @@ impl Hypervisor for HypervWindowsDriver {
316315
// function args
317316
rcx: peb_address.into(),
318317
rdx: seed,
319-
r8: page_size.into(),
320-
r9: self.get_max_log_level().into(),
318+
r8: self.get_max_log_level().into(),
321319
rflags: 1 << 1, // eflags bit index 1 is reserved and always needs to be 1
322320

323321
..Default::default()

src/hyperlight_host/src/hypervisor/hypervisor_handler.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ struct HvHandlerCommChannels {
184184
pub(crate) struct HvHandlerConfig {
185185
pub(crate) peb_addr: RawPtr,
186186
pub(crate) seed: u64,
187-
pub(crate) page_size: u32,
188187
pub(crate) dispatch_function_addr: Arc<Mutex<Option<RawPtr>>>,
189188
pub(crate) max_init_time: Duration,
190189
pub(crate) max_exec_time: Duration,
@@ -353,7 +352,6 @@ impl HypervisorHandler {
353352
let res = hv.initialise(
354353
configuration.peb_addr.clone(),
355354
configuration.seed,
356-
configuration.page_size,
357355
configuration.outb_handler.clone(),
358356
configuration.mem_access_handler.clone(),
359357
Some(hv_handler_clone.clone()),

src/hyperlight_host/src/hypervisor/inprocess.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,17 @@ impl<'a> Hypervisor for InprocessDriver<'a> {
7171
&mut self,
7272
_peb_addr: crate::mem::ptr::RawPtr,
7373
seed: u64,
74-
page_size: u32,
7574
_outb_handle_fn: super::handlers::OutBHandlerWrapper,
7675
_mem_access_fn: super::handlers::MemAccessHandlerWrapper,
7776
_hv_handler: Option<super::hypervisor_handler::HypervisorHandler>,
7877
#[cfg(gdb)] _dbg_mem_access_fn: DbgMemAccessHandlerWrapper,
7978
) -> crate::Result<()> {
80-
let entrypoint_fn: extern "win64" fn(u64, u64, u64, u64) =
79+
let entrypoint_fn: extern "win64" fn(u64, u64, u64) =
8180
unsafe { std::mem::transmute(self.args.entrypoint_raw as *const c_void) };
8281

8382
entrypoint_fn(
8483
self.args.peb_ptr_raw,
8584
seed,
86-
page_size as u64,
8785
log::max_level() as u64,
8886
);
8987

src/hyperlight_host/src/hypervisor/kvm.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ impl Hypervisor for KVMDriver {
700700
&mut self,
701701
peb_addr: RawPtr,
702702
seed: u64,
703-
page_size: u32,
704703
outb_hdl: OutBHandlerWrapper,
705704
mem_access_hdl: MemAccessHandlerWrapper,
706705
hv_handler: Option<HypervisorHandler>,
@@ -713,8 +712,7 @@ impl Hypervisor for KVMDriver {
713712
// function args
714713
rcx: peb_addr.into(),
715714
rdx: seed,
716-
r8: page_size.into(),
717-
r9: self.get_max_log_level().into(),
715+
r8: self.get_max_log_level().into(),
718716

719717
..Default::default()
720718
};

src/hyperlight_host/src/hypervisor/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ pub(crate) trait Hypervisor: Debug + Sync + Send {
126126
&mut self,
127127
peb_addr: RawPtr,
128128
seed: u64,
129-
page_size: u32,
130129
outb_handle_fn: OutBHandlerWrapper,
131130
mem_access_fn: MemAccessHandlerWrapper,
132131
hv_handler: Option<HypervisorHandler>,
@@ -344,7 +343,6 @@ pub(crate) mod tests {
344343
#[cfg(gdb)]
345344
dbg_mem_access_handler: dbg_mem_access_fn,
346345
seed: 1234567890,
347-
page_size: 4096,
348346
peb_addr: RawPtr::from(0x230000),
349347
dispatch_function_addr: Arc::new(Mutex::new(None)),
350348
max_init_time: Duration::from_millis(

0 commit comments

Comments
 (0)