Running confidential virtual machines with SEV-SNP/SVSM on AMD EPYC Milan nodes

AMD introduced Secure Encrypted Virtualization (SEV) in 2016 and has already seen several reincarnations - SEV-ES (encrypted state), and SEV-SNP (secure nested paging). In 2022, AMD introduced Secure Virtual Machine Service Module (SVSM) that can be used to implement secure services for a confidential guest. You can read more about SVSM in their official (draft) specification.

Hardware

AMD SEV-SNP and SVSM are avaible on AMD’s third generation EPYC processors (Milan). The list of milan processors are available in the Wikichip page.

Availability in the research cloud infrastructure

Both Cloudlab and Chameleon cloud that are widely used for academic research has servers equipped with AMD EPYC Milan processors that can be used for running confidential virtual machines with AMD SEV-SNP/SVSM.

Software stack

The official implementation of SVSM specification is available at https://github.com/AMDESE/linux-svsm

SVSM needs a modified Qemu, open virtual machine framework (OVMF), host and guest Linux kernel to operate. All these changes would be eventually upstreamed. Right now, they are hosted on AMD’s github.

Enabling SNP on Dell PowerEdge servers

Dell PowerEdge R6525 servers equipped with AMD Milan CPUs can be used to run SNP enabled confidential virtual machines with SVSM. Below are the steps to enable SNP on PowerEdge systems (This setup is tested under R6525 servers with both AMD EPYC Milan 7543 and 7763 processors).

1) Upgrade BIOS to the latest version (v2.8.4 as of Nov’22)

2) Modify the following BIOS options

3) After enabling, make sure the following model-specific registers (MSRs) have the same value across all CPUs (From https://www.amd.com/system/files/TechDocs/56860.pdf#page=66).

4) If everything is initialized correctly, then you should see the following messages on dmesg.

[   48.518199] SEV-SNP: RMP table physical address 0x0000000015e00000 - 0x00000000566fffff
...
[  178.878110] ccp 0000:22:00.1: sev enabled
[  182.989520] ccp 0000:22:00.1: SEV-SNP API:1.52 build:4
[  183.012703] SEV supported: 478 ASIDs
[  183.012704] SEV-ES and SEV-SNP supported: 31 ASIDs
...

Running SVSM

Follow the official documentation from linux-svsm repository for building SVSM and the necessary dependencies (Host kernel, Qemu, OVMF, Guest kernel).

When FEATURES=verbose is enabled, you can observe the serial log while booting an SNP guest.

> All 17 firmware config files read.
> Starting SMP for 0 APs:

Getting attestation report from SNP guest

If something is not working as expected, file an issue under the official github repository.