[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4P+mOFu2A9tj5/y@zx2c4.com>
Date: Mon, 28 Nov 2022 01:19:36 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Samuel Neves <sneves@....uc.pt>
Cc: Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
patches@...ts.linux.dev, linux-crypto@...r.kernel.org,
linux-api@...r.kernel.org, x86@...nel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Adhemerval Zanella Netto <adhemerval.zanella@...aro.org>,
Carlos O'Donell <carlos@...hat.com>,
Florian Weimer <fweimer@...hat.com>,
Arnd Bergmann <arnd@...db.de>,
Christian Brauner <brauner@...nel.org>
Subject: Re: [PATCH v7 3/3] x86: vdso: Wire up getrandom() vDSO implementation
On Sun, Nov 27, 2022 at 10:39:27PM +0000, Samuel Neves wrote:
> On Sun, Nov 27, 2022 at 10:13 PM Jason A. Donenfeld <Jason@...c4.com> wrote:
> >
> > Hi Thomas,
> >
> > On Sat, Nov 26, 2022 at 12:08:41AM +0100, Thomas Gleixner wrote:
> > > Jason!
> > >
> > > On Thu, Nov 24 2022 at 17:55, Jason A. Donenfeld wrote:
> > > > +++ b/arch/x86/entry/vdso/vgetrandom-chacha.S
> > > > +/*
> > > > + * Very basic SSE2 implementation of ChaCha20. Produces a given positive number
> > > > + * of blocks of output with a nonce of 0, taking an input key and 8-byte
> > > > + * counter. Importantly does not spill to the stack. Its arguments are:
> > >
> > > Basic or not.
> >
> > Heh, FYI I didn't mean "basic" here as in "doesn't need a review", but
> > just that it's a straightforward technique and doesn't do any
> > complicated multiblock pyrotechnics (which frankly aren't really
> > needed).
> >
> > > This needs a Reviewed-by from someone who understands SSE2
> > > and ChaCha20 before this can go anywhere near the x86 tree.
> >
> > No problem. I'll see to it that somebody qualified gives this a review.
> >
>
> I did look at this earlier. It looks fine. I would recommend changing
>
> + /* copy1,copy2 = key */
> + movdqu 0x00(key),copy1
> + movdqu 0x10(key),copy2
>
> to
>
> + /* copy1,copy2 = key */
> + movups 0x00(key),copy1
> + movups 0x10(key),copy2
>
> which has the same semantics, but saves a couple of code bytes. Likewise for
>
> + movdqu state0,0x00(output)
> + movdqu state1,0x10(output)
> + movdqu state2,0x20(output)
> + movdqu state3,0x30(output)
>
> Otherwise,
>
> Reviewed-by: Samuel Neves <sneves@....uc.pt> # for vgetrandom-chacha.S
Thanks for the review and for the suggestion. Will do.
Jason
Powered by blists - more mailing lists