From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E9491E261F; Thu, 20 Mar 2025 15:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742482847; cv=none; b=Nn4jHyfcwgH777v4xHGx/6y4CHpM/9hkvPYOjD2sxowT2cuvwgyqztPLYOGaLdGb8CcO0VdALI+QaspvfwkublZNbqoESupq+XIuSW2BLWbfS8WgpnsekVrxY8zFeSbhff6y/OReErN5LdssK/MbRW1sPzSoh9ke6+sTaRFsRKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742482847; c=relaxed/simple; bh=Be//gNDiDHACoFa8CWsun5REmHLhpSALE5TV1KvhaHo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cjL6KgInsu2N7NclX+yRZcKU36/wGasX3xhgEYMyuuzbtsZabIUIW7YHckv75i8rAjQYTObzy/wIYX6KKNNCpzU4WAHS+ZB3CabfUNupK45AOkusSSLF5iA3guwgjzpYcWEGhzzqs+u+D3Oow03FnU3wbdRB0XAbkMTznJSbiBQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FCNV95CY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FCNV95CY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBD67C4CEDD; Thu, 20 Mar 2025 15:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742482847; bh=Be//gNDiDHACoFa8CWsun5REmHLhpSALE5TV1KvhaHo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FCNV95CYJB6Bg57IXbd3x/o8K32MRTrCsSeQZ87G+Z0JbyrSdLDz1kJxPaLcgu9RS btR0xNYoSH2hgn3ffBq9S1otafi7fqLQr/ZmEbGod7EHRn0pG4hk+JfXcN25qtqTxn oYSy89HuRit52h7YhA3gO9JSaW/ByPAZU3i3UJoDhogGSrMdmE/2TRA+DkIhIQMel+ 4DS2S7ZtIMsoz96N+fF6+937WUu48obBsW0xGD2KAOrPIFcAxY8RBkWiRhIlgJcqBY DKJtks/22C7BK6I7KTVGtaNAMIuM67psLSD3dATtQglklvVgdEivc6TbsGnzaZOUPF qq7zdvPDO4tgQ== Date: Thu, 20 Mar 2025 17:00:42 +0200 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: Stefano Garzarella , Tom Lendacky , Peter Huewe , x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , linux-integrity@vger.kernel.org, Dov Murik , Dionna Glaze , linux-coco@lists.linux.dev, James Bottomley , Claudio Carvalho , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Dave Hansen , Joerg Roedel Subject: Re: [PATCH v3 3/4] tpm: add SNP SVSM vTPM driver Message-ID: References: <20250311094225.35129-1-sgarzare@redhat.com> <20250311094225.35129-4-sgarzare@redhat.com> <1262fa5b-0822-b8d4-26c5-426ffa4e0265@amd.com> <20250319234422.GG126678@ziepe.ca> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250319234422.GG126678@ziepe.ca> On Wed, Mar 19, 2025 at 08:44:22PM -0300, Jason Gunthorpe wrote: > On Tue, Mar 18, 2025 at 05:18:53PM +0100, Stefano Garzarella wrote: > > > I see, thanks for the clarification! > > I saw that with devm_get_free_pages() I can easily allocate a > > resource-managed page, so I'll do that in v4. > > As a general note you should just use kmalloc these days, even for > PAGE_SIZE. It is efficient and OK. > > Having a struct that is PAGE_SIZE+1 is not efficient and will waste > a page of memory. That should be avoided .. Yeah, kzalloc() takes care of this magic. As said, kzalloc() vs alloc_page() is not an existential question for this patch set :-) I just would personally use alloc_page(). If nothing else, it does have some super cosmetic benefits e.g., thinner call stack (when needing to debug deep, which sometimes happens). > > Jason > BR, Jarkko