Skip to content

Commit 94dc1ae

Browse files
committed
amd-sev: Create VM with KVM_X86_SNP_VM type
kvm_bindings does not yet expose the KVM_X86_SNP_VM value. Hard code the value until it is available in kvm_bindings. Taken from linux/arch/x86/include/uapi/asm/kvm.h Signed-off-by: Tyler Fanelli <[email protected]>
1 parent 3a6b263 commit 94dc1ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vmm/src/linux/vstate.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,9 @@ impl Vm {
463463
#[cfg(feature = "amd-sev")]
464464
pub fn new(kvm: &Kvm, tee_config: &TeeConfig) -> Result<Self> {
465465
//create fd for interacting with kvm-vm specific functions
466-
let vm_fd = kvm.create_vm().map_err(Error::VmFd)?;
466+
let vm_fd = kvm
467+
.create_vm_with_type(4 /* KVM_X86_SNP_VM */)
468+
.map_err(Error::VmFd)?;
467469

468470
let supported_cpuid = kvm
469471
.get_supported_cpuid(KVM_MAX_CPUID_ENTRIES)

0 commit comments

Comments
 (0)