mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-04 13:41:31 +00:00
hvm work
This commit is contained in:
@ -9,7 +9,7 @@ use log::{debug, trace};
|
||||
use nix::errno::Errno;
|
||||
use slice_copy::copy;
|
||||
use xencall::sys::{
|
||||
E820Entry, VcpuGuestContext, E820_MAX, E820_RAM, E820_UNUSABLE, MMUEXT_PIN_L4_TABLE,
|
||||
x8664VcpuGuestContext, E820Entry, VcpuGuestContextAny, E820_MAX, E820_RAM, E820_UNUSABLE, MMUEXT_PIN_L4_TABLE
|
||||
};
|
||||
|
||||
use crate::{
|
||||
@ -839,7 +839,7 @@ impl BootSetupPlatform for X86PvPlatform {
|
||||
.ok_or(Error::MemorySetupFailed("start_info_segment missing"))?;
|
||||
let pg_pfn = page_table_segment.pfn;
|
||||
let pg_mfn = domain.phys.p2m[pg_pfn as usize];
|
||||
let mut vcpu = VcpuGuestContext::default();
|
||||
let mut vcpu = x8664VcpuGuestContext::default();
|
||||
vcpu.user_regs.rip = domain.image_info.virt_entry;
|
||||
vcpu.user_regs.rsp =
|
||||
domain.image_info.virt_base + (boot_stack_segment.pfn + 1) * self.page_size();
|
||||
@ -861,7 +861,9 @@ impl BootSetupPlatform for X86PvPlatform {
|
||||
vcpu.kernel_ss = vcpu.user_regs.ss as u64;
|
||||
vcpu.kernel_sp = vcpu.user_regs.rsp;
|
||||
trace!("vcpu context: {:?}", vcpu);
|
||||
domain.call.set_vcpu_context(domain.domid, 0, &vcpu).await?;
|
||||
domain.call.set_vcpu_context(domain.domid, 0, VcpuGuestContextAny {
|
||||
value: vcpu,
|
||||
}).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user