Skip to content

Commit 10acbed

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 7c02c96 commit 10acbed

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
@@ -461,7 +461,9 @@ impl Vm {
461461
#[cfg(feature = "amd-sev")]
462462
pub fn new(kvm: &Kvm, tee_config: &TeeConfig) -> Result<Self> {
463463
//create fd for interacting with kvm-vm specific functions
464-
let vm_fd = kvm.create_vm().map_err(Error::VmFd)?;
464+
let vm_fd = kvm
465+
.create_vm_with_type(4 /* KVM_X86_SNP_VM */)
466+
.map_err(Error::VmFd)?;
465467

466468
let supported_cpuid = kvm
467469
.get_supported_cpuid(KVM_MAX_CPUID_ENTRIES)

0 commit comments

Comments
 (0)