Messages in this thread Patch in this message | | | Date | Mon, 6 Nov 2017 11:57:37 +0100 | From | Borislav Petkov <> | Subject | Re: [Part2 PATCH v7 25/38] KVM: SVM: Add KVM_SEV_INIT command |
| |
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:
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 <bp@suse.de>
-- Regards/Gruss, Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
| |