fix support for pv

This commit is contained in:
Alex Zenla
2024-06-06 07:38:25 +00:00
parent c3515ebe48
commit 4e9850293f
3 changed files with 10 additions and 1 deletions

View File

@ -167,7 +167,7 @@ impl<I: BootImageLoader, P: BootSetupPlatform> BootSetup<I, P> {
cmdline: &str, cmdline: &str,
) -> Result<BootDomain> { ) -> Result<BootDomain> {
let total_pages = mem_mb << (20 - self.platform.page_shift()); let total_pages = mem_mb << (20 - self.platform.page_shift());
let image_info = self.image_loader.parse(true).await?; let image_info = self.image_loader.parse(self.platform.hvm()).await?;
let mut domain = BootDomain { let mut domain = BootDomain {
domid: self.domid, domid: self.domid,
call: self.call.clone(), call: self.call.clone(),
@ -266,6 +266,7 @@ pub trait BootSetupPlatform: Clone {
fn page_size(&self) -> u64; fn page_size(&self) -> u64;
fn page_shift(&self) -> u64; fn page_shift(&self) -> u64;
fn needs_early_kernel(&self) -> bool; fn needs_early_kernel(&self) -> bool;
fn hvm(&self) -> bool;
async fn initialize_early(&mut self, domain: &mut BootDomain) -> Result<()>; async fn initialize_early(&mut self, domain: &mut BootDomain) -> Result<()>;

View File

@ -453,6 +453,10 @@ impl BootSetupPlatform for X86PvPlatform {
false false
} }
fn hvm(&self) -> bool {
false
}
async fn initialize_early(&mut self, _: &mut BootDomain) -> Result<()> { async fn initialize_early(&mut self, _: &mut BootDomain) -> Result<()> {
Ok(()) Ok(())
} }

View File

@ -330,6 +330,10 @@ impl BootSetupPlatform for X86PvhPlatform {
false false
} }
fn hvm(&self) -> bool {
true
}
async fn initialize_early(&mut self, domain: &mut BootDomain) -> Result<()> { async fn initialize_early(&mut self, domain: &mut BootDomain) -> Result<()> {
{ {
let mut config: acpi_config = unsafe { MaybeUninit::zeroed().assume_init() }; let mut config: acpi_config = unsafe { MaybeUninit::zeroed().assume_init() };