From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [PATCH] KVM: X86: Add missing KVM_AMD dependency Date: Fri, 5 Oct 2018 15:03:25 -0700 Message-ID: <20181005220325.GA24365@roeck-us.net> References: <1538765165-19177-1-git-send-email-linux@roeck-us.net> <749a21f9-ad88-af0e-bed7-b505ac57568d@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Radim =?utf-8?B?S3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Brijesh Singh , Borislav Petkov To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <749a21f9-ad88-af0e-bed7-b505ac57568d@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Fri, Oct 05, 2018 at 10:41:55PM +0200, Paolo Bonzini wrote: > 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 > > Cc: Borislav Petkov > > Signed-off-by: Guenter Roeck > > 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. > Unfortunately it doesn't. It disables KVM_AMD_SEV, but that doesn't prevent the calls. > Maybe this works as well? I haven't tested it yet: > I am sure there are many possible solutions. I would personally prefer one that enforces KVM_AMD=m with CRYPTO_DEV_CCP_DD=m, but that is just me. Thanks, Guenter > 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