vmm: don't configure system if rsdp is not available

In case of CVM guest rsdp is set to none. Unwrapping it
make the vmm crashed. Don't call configure system if the
rsdb address is none.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam 2025-07-28 12:09:28 -07:00 committed by Wei Liu
parent 7c631b2d1b
commit 8e010f1aa3

View file

@ -2332,15 +2332,16 @@ impl Vm {
let rsdp_addr = self.create_acpi_tables();
#[cfg(not(target_arch = "riscv64"))]
// Configure shared state based on loaded kernel
entry_point
.map(|entry_point| {
// Safe to unwrap rsdp_addr as we know it can't be None when
// the entry_point is Some.
self.configure_system(rsdp_addr.unwrap(), entry_point)
})
.transpose()?;
{
#[cfg(not(feature = "sev_snp"))]
assert!(rsdp_addr.is_some());
// Configure shared state based on loaded kernel
if let Some(rsdp_adr) = rsdp_addr {
entry_point
.map(|entry_point| self.configure_system(rsdp_adr, entry_point))
.transpose()?;
}
}
#[cfg(target_arch = "riscv64")]
self.configure_system().unwrap();