I have SME, SEV, SEV-ES and SR-IOV working fine for some VMs so I thought I’d go all the way and enable SEV-SNP and get remote attestation working too - mainly for learning but I like the idea of the security isolation.
I’ve enabled every SEV/SEV-SNP option I can find in BIOS, or anything related, either to “auto” or “manual” with various different settings, but what ever I try so far, the relevant bit in the SEV status MSR never gets turned on.
I’m using virtee/sevctl
(GitHub - virtee/sevctl: Administrative utility for AMD SEV) to check the status:
# sevctl ok
[ PASS ] - AMD CPU
[ PASS ] - Microcode support
[ PASS ] - Secure Memory Encryption (SME)
[ PASS ] - Secure Encrypted Virtualization (SEV)
[ PASS ] - Encrypted State (SEV-ES)
[ FAIL ] - Secure Nested Paging (SEV-SNP)
[ SKIP ] - VM Permission Levels
[ SKIP ] - Number of VMPLs
[ PASS ] - Physical address bit reduction: 4
[ PASS ] - C-bit location: 51
[ PASS ] - Number of encrypted guests supported simultaneously: 253
[ PASS ] - Minimum ASID value for SEV-enabled, SEV-ES disabled guest: 100
[ PASS ] - SEV enabled in KVM: enabled
[ PASS ] - SEV-ES enabled in KVM: enabled
[ PASS ] - Reading /dev/sev: /dev/sev readable
[ PASS ] - Writing /dev/sev: /dev/sev writable
[ PASS ] - Page flush MSR: ENABLED
[ PASS ] - KVM supported: API version: 12
[ PASS ] - Memlock resource limit: Soft: 8388608 | Hard: 8388608
Error: One or more tests in sevctl-ok reported a failure
Determining the SNP status manually using the description of “3.2.1 System Configuration Register (SYSCFG)” from the AMD APM vol 2, yields the same result:
# echo "obase=2;$(rdmsr -d 0xc0010010)" | bc
10111101000000000000000000
→ bit 24 (SNPE
/ SecureNestedPagingEn) = 0
Kernel
Kernel version is 6.1.61-1-lts (Arch Linux).
kvm_amd
is loaded with options sev
, sev_es
, npt
, and nested
enabled.
Only line in dmesg that matches “snp” (case-insensitive) is:
[ 0.709397] AMD-Vi: Extended features (0x841f77e022094ace, 0x0): PPR X2APIC NX IA GA PC SNP
BIOS
BIOS settings (board: ASRock Rack ROMED8-2T), tried version 3.20 and 3.80 (latest) :
- CPU
- SVM Mode: enabled
- Chipset
- Above 4G Decoding: enabled
- SR-IOV Support: enabled
- CPU common options
- SEV ASID count: 253 ASIDs
- SEV-ES ASID space limit control: manual
- SEV-ES ASID space limit: 100
- SEV control: enable
- SNP memory (RMP table) coverage: (tried two options)
- auto
- enable (help text = “ENTIRE system memory is covered”)
- custom (which allows input of “Amount of memory to cover”, as hex * 1MiB, for which I entered “20000”, since 0x20000 * 1MiB = 128GiB = my RAM size).
- SMEE: enabled
- NBIO
- SEV-SNP support: enable
BIOS photos in case I missed something (sorry for the wonky camera):
Am I being silly and missing something?