Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751501AbdIMQhm (ORCPT ); Wed, 13 Sep 2017 12:37:42 -0400 Received: from mx2.suse.de ([195.135.220.15]:60739 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750992AbdIMQhl (ORCPT ); Wed, 13 Sep 2017 12:37:41 -0400 Date: Wed, 13 Sep 2017 18:37:29 +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 13/26] KVM: SVM: Add KVM_SEV_INIT command Message-ID: <20170913163729.pbzj7x6lhke6z2r5@pd.tnic> References: <20170724200303.12197-1-brijesh.singh@amd.com> <20170724200303.12197-14-brijesh.singh@amd.com> <20170913150636.fcjhbg7wdf2whmy2@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 629 Lines: 19 On Wed, Sep 13, 2017 at 11:23:26AM -0500, Brijesh Singh wrote: > I am okay with moving it on the stack but just to give context why > I went in this way. The physical address of data is given to the > device (in this case SEV FW). I was not sure if its okay to pass the > stack address to the device. Why would it not be ok? > Additionally, the FW spec requires us to zero all the fields -- so we > need to memset if we allocate it on the stack. What do you think kzalloc() does internally? :) -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --