From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752262AbdKFK54 (ORCPT ); Mon, 6 Nov 2017 05:57:56 -0500 Received: from mail.skyhub.de ([5.9.137.197]:38210 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752042AbdKFK5z (ORCPT ); Mon, 6 Nov 2017 05:57:55 -0500 Date: Mon, 6 Nov 2017 11:57:37 +0100 From: Borislav Petkov To: Brijesh Singh Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Joerg Roedel , Tom Lendacky , x86@kernel.org Subject: Re: [Part2 PATCH v7 25/38] KVM: SVM: Add KVM_SEV_INIT command Message-ID: <20171106105737.fkv6hah4ynugyzym@pd.tnic> References: <20171101211623.71496-1-brijesh.singh@amd.com> <20171101211623.71496-26-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171101211623.71496-26-brijesh.singh@amd.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Joerg Roedel > Cc: Borislav Petkov > Cc: Tom Lendacky > Cc: x86@kernel.org > Cc: kvm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Brijesh Singh > --- > 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: 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); with that: Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.