[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0925dd9e-3588-38da-8dfb-0ac2ff568655@intel.com>
Date: Sun, 4 Jun 2023 15:02:32 -0700
From: "Chang S. Bae" <chang.seok.bae@...el.com>
To: Eric Biggers <ebiggers@...nel.org>
CC: <linux-kernel@...r.kernel.org>, <linux-crypto@...r.kernel.org>,
<dm-devel@...hat.com>, <elliott@....com>, <gmazyland@...il.com>,
<luto@...nel.org>, <dave.hansen@...ux.intel.com>,
<tglx@...utronix.de>, <bp@...en8.de>, <mingo@...nel.org>,
<x86@...nel.org>, <herbert@...dor.apana.org.au>, <ardb@...nel.org>,
<dan.j.williams@...el.com>, <bernie.keany@...el.com>,
<charishma1.gairuboyina@...el.com>,
<lalithambika.krishnakumar@...el.com>, <nhuck@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH v8 10/12] crypto: x86/aesni - Use the proper data type in
struct aesni_xts_ctx
On 6/4/2023 8:34 AM, Eric Biggers wrote:
>
> To re-iterate what I said on v6, the runtime alignment to a 16-byte boundary
> should happen when translating the raw crypto_skcipher_ctx() into the pointer to
> the aes_xts_ctx. It should not happen when accessing each individual field in
> the aes_xts_ctx.
>
> Yet, this code is still doing runtime alignment when accessing each individual
> field, as the second argument to aes_set_key_common() is 'void *raw_ctx' which
> aes_set_key_common() runtime-aligns to crypto_aes_ctx.
>
> We should keep everything consistent, which means making aes_set_key_common()
> take a pointer to crypto_aes_ctx and not do the runtime alignment.
Let me clarify what is the problem this patch tried to solve here. The
current struct aesni_xts_ctx is ugly. So, the main story is let's fix it
before using the code for AES-KL.
Then, the rework part may be applicable for code re-usability. That
seems to be okay to do here.
Fixing the runtime alignment entirely seems to be touching other code
than AES-XTS. Yes, that's ideal cleanup for consistency. But, it seems
to be less relevant in this series. I'd be happy to follow up on that
improvement though.
Thanks,
Chang
Powered by blists - more mailing lists