mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Brijesh Singh" <brijesh.singh@amd.com>,
	"Borislav Petkov" <bp@suse.de>
Subject: Re: [PATCH] KVM: X86: Add missing KVM_AMD dependency
Date: Fri, 5 Oct 2018 22:41:55 +0200	[thread overview]
Message-ID: <749a21f9-ad88-af0e-bed7-b505ac57568d@redhat.com> (raw)
In-Reply-To: <1538765165-19177-1-git-send-email-linux@roeck-us.net>

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

  reply	other threads:[~2018-10-05 20:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 18:46 Guenter Roeck
2018-10-05 20:41 ` Paolo Bonzini [this message]
2018-10-05 22:03   ` Guenter Roeck
2018-10-05 22:18     ` Paolo Bonzini
2018-10-06 20:43       ` Guenter Roeck
2018-10-08 11:27         ` Paolo Bonzini
2018-10-08 14:52           ` Singh, Brijesh
2018-10-08 17:32             ` Borislav Petkov
2018-10-09 16:26               ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=749a21f9-ad88-af0e-bed7-b505ac57568d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=brijesh.singh@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mingo@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®