From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbdINKY4 (ORCPT ); Thu, 14 Sep 2017 06:24:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:47216 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751824AbdINKYx (ORCPT ); Thu, 14 Sep 2017 06:24:53 -0400 Date: Thu, 14 Sep 2017 12:24:44 +0200 From: Borislav Petkov To: Brijesh Singh Cc: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, Thomas Gleixner , Joerg Roedel , "Michael S . Tsirkin" , Paolo Bonzini , =?utf-8?B?XCJSYWRpbSBLcsSNbcOhxZlcIg==?= , Tom Lendacky Subject: Re: [RFC Part2 PATCH v3 18/26] KVM: SVM: Add support for SEV LAUNCH_FINISH command Message-ID: <20170914102444.qki2okelkg3tbsdb@pd.tnic> References: <20170724200303.12197-1-brijesh.singh@amd.com> <20170724200303.12197-19-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: <20170724200303.12197-19-brijesh.singh@amd.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 24, 2017 at 03:02:55PM -0500, Brijesh Singh wrote: > The command is used for finializing the SEV guest launch process. > > Signed-off-by: Brijesh Singh > --- > arch/x86/kvm/svm.c | 23 +++++++++++++++++++++++ > 1 file changed, 23 insertions(+) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 9b672eb..7a77197 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -6005,6 +6005,25 @@ static int sev_launch_measure(struct kvm *kvm, struct kvm_sev_cmd *argp) > return ret; > } > > +static int sev_launch_finish(struct kvm *kvm, struct kvm_sev_cmd *argp) > +{ > + struct sev_data_launch_finish *data; This one is a very good example why you should do this on the stack: this struct has a single u32 handle; member. The amount of operations to do kzalloc and kfree for a single u32 are simply not justified. -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --