vmm: Don't set rsdp addr in case of SEV-SNP guest

Since the ACPI tables are generated inside the IGVM file in case of
SEV-SNP guest. So, we don't need to generate it inside the cloud
hypervisor.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Jinank Jain 2024-02-08 20:04:01 +05:30 committed by Bo Chen
parent d0be450b1b
commit eee31f1d41

View File

@ -2022,7 +2022,21 @@ impl Vm {
// Do earlier to parallelise with loading kernel
#[cfg(target_arch = "x86_64")]
let rsdp_addr = self.create_acpi_tables();
cfg_if::cfg_if! {
if #[cfg(feature = "sev_snp")] {
let sev_snp_enabled = self.config.lock().unwrap().is_sev_snp_enabled();
let rsdp_addr = if sev_snp_enabled {
// In case of SEV-SNP guest ACPI tables are provided via
// IGVM. So skip the creation of ACPI tables and set the
// rsdp addr to None.
None
} else {
self.create_acpi_tables()
};
} else {
let rsdp_addr = self.create_acpi_tables();
}
}
// Load kernel synchronously or if asynchronous then wait for load to
// finish.