diff mbox

[Part2,v7,25/38] KVM: SVM: Add KVM_SEV_INIT command

Message ID 20171106105737.fkv6hah4ynugyzym@pd.tnic (mailing list archive)
State New, archived
Headers show

Commit Message

Borislav Petkov Nov. 6, 2017, 10:57 a.m. UTC
On Wed, Nov 01, 2017 at 04:16:10PM -0500, Brijesh Singh wrote:
> The command initializes the SEV platform context and allocates a new ASID
> for this guest from the SEV ASID pool. The firmware must be initialized
> before we issue any guest launch commands to create a new memory encryption
> context.
> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: "Radim Krčmář" <rkrcmar@redhat.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Borislav Petkov <bp@suse.de>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Cc: x86@kernel.org
> Cc: kvm@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
> ---
>  arch/x86/include/asm/kvm_host.h |   7 +++
>  arch/x86/kvm/svm.c              | 130 +++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 136 insertions(+), 1 deletion(-)

...

> @@ -1167,10 +1187,18 @@ static __init int svm_hardware_setup(void)
>  	return r;
>  }
>  
> +static __exit void sev_hardware_unsetup(void)
> +{
> +	if (svm_sev_enabled())
> +		kfree(sev_asid_bitmap);
> +}

Just get rid of that silly function:


with that:

Reviewed-by: Borislav Petkov <bp@suse.de>

Comments

Brijesh Singh Nov. 6, 2017, 4:19 p.m. UTC | #1
On 11/06/2017 04:57 AM, Borislav Petkov wrote:
...

> 
> Just get rid of that silly function:
> 

Sure, will do.
diff mbox

Patch

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 1410e6b7e8d8..5f5c3ddad139 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1187,17 +1187,12 @@  static __init int svm_hardware_setup(void)
 	return r;
 }
 
-static __exit void sev_hardware_unsetup(void)
-{
-	if (svm_sev_enabled())
-		kfree(sev_asid_bitmap);
-}
-
 static __exit void svm_hardware_unsetup(void)
 {
 	int cpu;
 
-	sev_hardware_unsetup();
+	if (svm_sev_enabled())
+		kfree(sev_asid_bitmap);
 
 	for_each_possible_cpu(cpu)
 		svm_cpu_uninit(cpu);