Skip to content

Commit

Permalink
amd-sev: Create KVM_X86_SNP_VM type
Browse files Browse the repository at this point in the history
KVM requires a VM intended to be run with SEV-SNP encryption to be
created with the KVM_X86_SNP_VM type.

Signed-off-by: Tyler Fanelli <[email protected]>
  • Loading branch information
tylerfanelli committed Dec 12, 2024
1 parent 9fde0d6 commit 3ae6bf9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vmm/src/linux/vstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,12 @@ impl Vm {

#[cfg(feature = "amd-sev")]
pub fn new(kvm: &Kvm, tee_config: &TeeConfig) -> Result<Self> {
const KVM_X86_SNP_VM: u64 = 4;

//create fd for interacting with kvm-vm specific functions
let vm_fd = kvm.create_vm().map_err(Error::VmFd)?;
let vm_fd = kvm
.create_vm_with_type(KVM_X86_SNP_VM)
.map_err(Error::VmFd)?;

let supported_cpuid = kvm
.get_supported_cpuid(KVM_MAX_CPUID_ENTRIES)
Expand Down

0 comments on commit 3ae6bf9

Please sign in to comment.