Enabling SEV for nested guests is not supported AFAIK, but using SEV itself on L1 VMs should be possible.
Enable SEV for the kvm_amd module on the host (make sure SME (but not TSME) is enabled in BIOS before) by adding the following line to your
kernel commandline:
Code:
mem_encrypt=on kvm_amd.sev=1
Then check if SEV was enabled:
Code:
cat /sys/module/kvm_amd/parameters/sev
# should print 1
Lastly, here's a little script asking QEMU if it knows about SEV (somewhat equivalent to 'virsh domcapabilities' for SEV):
Code:
#!/bin/bash
qemu-system-x86_64 -enable-kvm \
-chardev 'socket,id=qmp,path=/tmp/qmp.socket,server,nowait' \
-mon 'chardev=qmp,mode=control,pretty=on' &
sleep 0.5
echo '{ "execute": "qmp_capabilities" }
{ "execute": "query-sev-capabilities" }
{ "execute": "quit" }' \
| socat - /tmp/qmp.socket
sleep 0.5
pkill qemu-system-x86
The third reposnse (in { } braces) should contain information about SEV support.
If this reports success, you should be able to enable SEV by adding the following to your VM config (/etc/pve/qemu-server/<vmid>.conf):
Code:
args: -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=1 -machine memory-encryption=sev0
(make sure 'cbitpos' and 'reduced-phys-bits' correspond to the output from the script above)
Now, that's as far as the
theory goes. In practice, I have tried the above steps myself and was unable to progress past the second, since the 'sev' module parameter always stayed 0, even if specified manually on a 'modprobe'. This is a bit unexpected, as my workstation should in theory support it, but it seems like somewhere along the line something doesn't. Could be that the 5.4 kernel shipping with PVE is not new enough to get this to work...
TL;DR: We currently don't support SEV, but in *theory* it's possible to use for L1 guests. In practice, maybe not so much.