mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: make RSDP address optional in configure_system
Change configure_system to take an Option<GuestAddress> since rsdp is wrapped into an option anyways (we use configure system to setup the mptables). Co-authored-by: Keith Adler <kadler@cloudflare.com> Signed-off-by: Keith Adler <kadler@cloudflare.com> Co-authored-by: Alex Orozco <aorozco@google.com> Signed-off-by: Alex Orozco <aorozco@google.com> Signed-off-by: Ruben Hakobyan <hruben@meta.com>
This commit is contained in:
committed by
Rob Bradford
parent
b545b2fc4e
commit
7d65187350
@@ -1676,7 +1676,11 @@ impl Vm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
fn configure_system(&mut self, rsdp_addr: GuestAddress, entry_addr: EntryPoint) -> Result<()> {
|
fn configure_system(
|
||||||
|
&mut self,
|
||||||
|
rsdp_addr: Option<GuestAddress>,
|
||||||
|
entry_addr: EntryPoint,
|
||||||
|
) -> Result<()> {
|
||||||
trace_scoped!("configure_system");
|
trace_scoped!("configure_system");
|
||||||
info!("Configuring system");
|
info!("Configuring system");
|
||||||
let mem = self.memory_manager.lock().unwrap().boot_guest_memory();
|
let mem = self.memory_manager.lock().unwrap().boot_guest_memory();
|
||||||
@@ -1687,7 +1691,6 @@ impl Vm {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let boot_vcpus = self.cpu_manager.lock().unwrap().boot_vcpus();
|
let boot_vcpus = self.cpu_manager.lock().unwrap().boot_vcpus();
|
||||||
let rsdp_addr = Some(rsdp_addr);
|
|
||||||
|
|
||||||
let serial_number = self
|
let serial_number = self
|
||||||
.config
|
.config
|
||||||
@@ -1739,7 +1742,7 @@ impl Vm {
|
|||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
fn configure_system(
|
fn configure_system(
|
||||||
&mut self,
|
&mut self,
|
||||||
_rsdp_addr: GuestAddress,
|
_rsdp_addr: Option<GuestAddress>,
|
||||||
_entry_addr: EntryPoint,
|
_entry_addr: EntryPoint,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let cmdline = Self::generate_cmdline(
|
let cmdline = Self::generate_cmdline(
|
||||||
@@ -2776,16 +2779,11 @@ impl Vm {
|
|||||||
let rsdp_addr = self.create_acpi_tables();
|
let rsdp_addr = self.create_acpi_tables();
|
||||||
|
|
||||||
#[cfg(not(target_arch = "riscv64"))]
|
#[cfg(not(target_arch = "riscv64"))]
|
||||||
{
|
// Configure shared state based on loaded kernel
|
||||||
#[cfg(not(any(feature = "sev_snp", feature = "tdx")))]
|
entry_point
|
||||||
assert!(rsdp_addr.is_some());
|
.map(|entry_point| self.configure_system(rsdp_addr, entry_point))
|
||||||
// Configure shared state based on loaded kernel
|
.transpose()?;
|
||||||
if let Some(rsdp_adr) = rsdp_addr {
|
|
||||||
entry_point
|
|
||||||
.map(|entry_point| self.configure_system(rsdp_adr, entry_point))
|
|
||||||
.transpose()?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(target_arch = "riscv64")]
|
#[cfg(target_arch = "riscv64")]
|
||||||
self.configure_system().unwrap();
|
self.configure_system().unwrap();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user