vmm, hypervisor: Make the VMSA page type optional

KVM builds the VMSA internally, so the logic in igvm-loader passing a
VMSA page for KVM is misleading. The page is silently dropped later
in import_isolated_pages(). Only MSHV actually imports it.

Make PageTypeConfig::vmsa an Option that is None on KVM and push the
VMSA page only when it is set. As KVM no longer produces a VMSA page,
remove the now-dead skip in import_isolated_pages().

Signed-off-by: Ruben Hakobyan <hruben@meta.com>
This commit is contained in:
Ruben Hakobyan
2026-07-13 16:59:42 -07:00
committed by Rob Bradford
parent 3ddcf50149
commit 6d2d66bcd3
3 changed files with 12 additions and 18 deletions

View File

@@ -785,11 +785,6 @@ impl vm::Vm for KvmVm {
return Ok(());
}
assert_eq!(pfns.len(), uaddrs.len());
// VMSA pages are not supported by launch_update
// https://elixir.bootlin.com/linux/v6.11/source/arch/x86/kvm/svm/sev.c#L2377
if page_type == sev::SNP_PAGE_TYPE_VMSA {
return Ok(());
}
for i in 0..pfns.len() {
self.fd
.set_memory_attributes(kvm_memory_attributes {

View File

@@ -23,8 +23,6 @@ const KVM_SEV_INIT2: u32 = 22;
const KVM_SEV_SNP_LAUNCH_START: u32 = 100;
const KVM_SEV_SNP_LAUNCH_UPDATE: u32 = 101;
const KVM_SEV_SNP_LAUNCH_FINISH: u32 = 102;
// SNP_LAUNCH_UPDATE page types — linux/arch/x86/include/uapi/asm/sev-guest.h
pub const SNP_PAGE_TYPE_VMSA: u32 = 2;
// See AMD Spec Section 8.17 — SNP_LAUNCH_UPDATE
// The last 12 bits are metadata about the guest context