lkml.org 
[lkml]   [2018]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] KVM: X86: Add missing KVM_AMD dependency
From
Date
On 05/10/2018 20:46, Guenter Roeck wrote:
> Analysis shows that commit 59414c9892208 ("KVM: SVM: Add support for
> KVM_SEV_LAUNCH_START command") added a dependency of KVM_AMD on
> CRYPTO_DEV_CCP_DD if CRYPTO_DEV_SP_PSP is enabled: If CRYPTO_DEV_CCP_DD
> is built as module, KVM_AMD must be built as module as well.
>
> Fixes: 59414c9892208 ("KVM: SVM: Add support for KVM_SEV_LAUNCH_START command")
> Cc: Brijesh Singh <brijesh.singh@amd.com>
> Cc: Borislav Petkov <bp@suse.de>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

This should be handled by

config KVM_AMD_SEV
def_bool y
bool "AMD Secure Encrypted Virtualization (SEV) support"
depends on KVM_AMD && X86_64
depends on CRYPTO_DEV_SP_PSP && !(KVM_AMD=y && CRYPTO_DEV_CCP_DD=m)
---help---
Provides support for launching Encrypted VMs on AMD processors.

Maybe this works as well? I haven't tested it yet:

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 89c4c5aa15f1..55f10b17d044 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -441,9 +441,13 @@ static inline bool svm_sev_enabled(void)

static inline bool sev_guest(struct kvm *kvm)
{
+#ifdef CONFIG_KVM_AMD_SEV
struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;

return sev->active;
+#else
+ return false;
+#endif
}

static inline int sev_get_asid(struct kvm *kvm)
Thanks,

Paolo

\
 
 \ /
  Last update: 2018-10-05 22:43    [W:0.042 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site