lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z9wtmqGkqPPkXWqP@kernel.org>
Date: Thu, 20 Mar 2025 17:00:42 +0200
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Stefano Garzarella <sgarzare@...hat.com>,
	Tom Lendacky <thomas.lendacky@....com>,
	Peter Huewe <peterhuewe@....de>, x86@...nel.org,
	linux-kernel@...r.kernel.org, Borislav Petkov <bp@...en8.de>,
	linux-integrity@...r.kernel.org, Dov Murik <dovmurik@...ux.ibm.com>,
	Dionna Glaze <dionnaglaze@...gle.com>, linux-coco@...ts.linux.dev,
	James Bottomley <James.Bottomley@...senpartnership.com>,
	Claudio Carvalho <cclaudio@...ux.ibm.com>,
	Ingo Molnar <mingo@...hat.com>, "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	Joerg Roedel <jroedel@...e.de>
Subject: Re: [PATCH v3 3/4] tpm: add SNP SVSM vTPM driver

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ