KVM: SVM: document KVM_MEM_ENCRYPT_OP, let userspace detect if SEV is available
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 20 Mar 2020 17:34:50 +0000 (13:34 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 20 Mar 2020 17:47:52 +0000 (13:47 -0400)
commit2da1ed62d55c6cbebbdee924f6af4e87bb6666e5
tree6d56bcc69e4cdde9b8ba48197b5f11492f32cc9f
parentd33294541889b023068522270cd4153ddd8e4635
KVM: SVM: document KVM_MEM_ENCRYPT_OP, let userspace detect if SEV is available

Userspace has no way to query if SEV has been disabled with the
sev module parameter of kvm-amd.ko.  Actually it has one, but it
is a hack: do ioctl(KVM_MEM_ENCRYPT_OP, NULL) and check if it
returns EFAULT.  Make it a little nicer by returning zero for
SEV enabled and NULL argument, and while at it document the
ioctl arguments.

Cc: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Documentation/virt/kvm/amd-memory-encryption.rst
arch/x86/kvm/svm.c