Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14036200rwb; Sun, 27 Nov 2022 16:22:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf6lDWJgab2pXR4i+c55BoOtAkzsRES03f/sYu0zSJLWkXVo0Xkpy6eQq12SjxUI8ajokfEa X-Received: by 2002:a17:902:e544:b0:189:6c9c:259a with SMTP id n4-20020a170902e54400b001896c9c259amr11762411plf.157.1669594941202; Sun, 27 Nov 2022 16:22:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669594941; cv=none; d=google.com; s=arc-20160816; b=AkdBVnwRBuM4uxzsG70VV8J3K2/cd3SyPENxcLxR5JsaxrxcmxHPruajzZToIS5vs0 rLORanzwQn2grtBGeVCvuI/lrHiL3QeBQTC7wnzLQ2Ko4P9uhgYan8rMQAxvtwl+9pnb 2arVZDFfvFjePCpWDQ2A8dAILPnOjYlxYeHEyYIYPZ5i9zmUTwLiphCTfHrKwJ8PpmIm z3VJbzTvIMN3PTYvNOlpozUZM24xcLfxmHp/VWaaUTlg+Dp6VjiCHegBjSNoZ8jVmIxV JbZk77ILU7G9Q5IuZvA7m4KRDtIb0+/DdrXWVHvz9VntGWtSW5gWrxzcx2MNCgZZ/PrR 4wGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CGDNWDlrjoKkV18bX013f+9WmWZM0g+YAx70BBOO/2Q=; b=w1v/xPw4yJtowIrit+4ZjwVch01qM0ptORVGmsRV8pGBAY4iSKxMgzG2XI21Mv1J8b xvo/Tyo2KydZZFDkyfoE7pzLtVxvwScgfwZW5G8ktdeovU6M3W7+ZPADotuEuNKF9V2j 9jo0EZR2nNeudOz7SWATnHfkLMZAIrhs0QsSJaC4mpo8Kw6pCfQ+0ImSXBmImHap+ORR RhsKgou96tAaf6abWrwsCiF5WDfXUz0my27plQ5YExwQHg7gwmBvTYBtv4W/gH0fqLDY YGX2sZyp+0pxDdn5yMmLFBLIDhGJV911WDirsd8s70E9D/c1lVZ1gS/HaiHtU/OjXGjI FaIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=GjPO03ju; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc6-20020a17090b3b8600b00218e451806dsi11590053pjb.39.2022.11.27.16.22.00; Sun, 27 Nov 2022 16:22:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=GjPO03ju; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229650AbiK1ATt (ORCPT + 99 others); Sun, 27 Nov 2022 19:19:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229504AbiK1ATr (ORCPT ); Sun, 27 Nov 2022 19:19:47 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 391DC6141; Sun, 27 Nov 2022 16:19:47 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D20A9B80B1A; Mon, 28 Nov 2022 00:19:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17F08C43470; Mon, 28 Nov 2022 00:19:43 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="GjPO03ju" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1669594781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CGDNWDlrjoKkV18bX013f+9WmWZM0g+YAx70BBOO/2Q=; b=GjPO03juWqjidb6zzZMkl2qkH2uWs0O0x5Pxs3nWv0KJ+2r8iTUvJVFIBhmnACPzUtSIp/ 6/TTNYlJ0z7LKrrL7Jmhy1qQRy6fbyZPCOqySSAcAOn7g+G4XSRK689oPPz3kP++anYvyq 37HBzL4b4azCFC4Tdx9+TyNM4pjx6MM= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id d135daf3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 28 Nov 2022 00:19:40 +0000 (UTC) Date: Mon, 28 Nov 2022 01:19:36 +0100 From: "Jason A. Donenfeld" To: Samuel Neves Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-crypto@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, Greg Kroah-Hartman , Adhemerval Zanella Netto , Carlos O'Donell , Florian Weimer , Arnd Bergmann , Christian Brauner Subject: Re: [PATCH v7 3/3] x86: vdso: Wire up getrandom() vDSO implementation Message-ID: References: <20221124165536.1631325-1-Jason@zx2c4.com> <20221124165536.1631325-4-Jason@zx2c4.com> <874jumy6me.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 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 # for vgetrandom-chacha.S Thanks for the review and for the suggestion. Will do. Jason