From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752186AbeECMXp (ORCPT ); Thu, 3 May 2018 08:23:45 -0400 Received: from mail.bootlin.com ([62.4.15.54]:51292 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751401AbeECMXm (ORCPT ); Thu, 3 May 2018 08:23:42 -0400 Date: Thu, 3 May 2018 14:23:30 +0200 From: "'Antoine Tenart'" To: David Laight Cc: "'Antoine Tenart'" , "herbert@gondor.apana.org.au" , "davem@davemloft.net" , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "thomas.petazzoni@bootlin.com" , "maxime.chevallier@bootlin.com" , "gregory.clement@bootlin.com" , "miquel.raynal@bootlin.com" , "nadavh@marvell.com" , "oferh@marvell.com" , "igall@marvell.com" Subject: Re: [PATCH 01/10] crypto: aead - allow to allocate AEAD requests on the stack Message-ID: <20180503122330.GB3324@kwain> References: <20180502095725.31935-1-antoine.tenart@bootlin.com> <20180502095725.31935-2-antoine.tenart@bootlin.com> <02ad9eb93c494314a85db69886cf787a@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <02ad9eb93c494314a85db69886cf787a@AcuMS.aculab.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, On Wed, May 02, 2018 at 02:55:19PM +0000, David Laight wrote: > From: Antoine Tenart > > > > +#define AEAD_REQUEST_ON_STACK(name, tfm) \ > > + char __##name##_desc[sizeof(struct aead_request) + \ > > + crypto_aead_reqsize(tfm)] CRYPTO_MINALIGN_ATTR; \ > > + struct aead_request *name = (void *)__##name##_desc > > + > > This looks stunningly like a VLA. I was expecting this question :) The thing is this define looks *a lot* like the ones defined in other places in the crypto framework, such as SKCIPHER_REQUEST_ON_STACK and AHASH_REQUEST_ON_STACK. Those haven't been tackled down so far by the whole VLA removal so the idea was that the same solution will apply to the 3 of them (and then I'm not really adding a new one). If you do have a suggestion on how to fix the 3 of them, I'll be glad to make a patch for that, but I'm not sure there's an easy solution. And I don't think I saw a patch on the mailing list about those defines. Thanks, Antoine -- Antoine Ténart, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com