Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15437463rwb; Mon, 28 Nov 2022 11:32:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf4lSABMWtGOoUePbBD3XKPHPbA8k/Q+V+RXZP3qCigsG4hp2VOMfeRgJXPEKGCXZs86XqUM X-Received: by 2002:a63:fe01:0:b0:477:bf35:acb1 with SMTP id p1-20020a63fe01000000b00477bf35acb1mr22930146pgh.439.1669663979589; Mon, 28 Nov 2022 11:32:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669663979; cv=none; d=google.com; s=arc-20160816; b=lVpSmJNwhddEU4WafgooNlH9ADm0YGPvwBcacDGupx+U07N9Jybyl0Dr706ycqfZsl NxDIyBmCNnVe8Ruxa4nmLQzXSHWtoik9UXYiFaJzpuVowObQSLbfKHkuFhu+3euakrl8 xHUqLySPjZEg7Id2iYgR+ddy9zvToATd1eQt2qR7Z+xwX9I6nP/GQh2BihcIlVpWCUnR e1d2YXaExByMsRDAvcPuucVwR1v/3elshSbGsVX58cIeYM8RAD4hJ3FrVYudHy0VSoX/ Zaz6/XwvOIkl3z8+Nk8F4Dm4oGYer37Z26fTe9I29apfBSiARhM+2CNZOwZ7RaPP8ShQ YJrQ== 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=oH13CIpQ/7n5BcQUws9hK24sibfqfJzuMBXnlvB67Q4=; b=DUpvP087GhMhDurniiTIqvaZPrAXrfIrljA/z57lsjdSjdgFDN4YKvOsmzl8olU4/Z /tYtP/whm1hDmau8b7NtkhJTcV4IB8TWeNb0UzFP8vAgN/jJjbk2WyZ5IEf8se6PHrHq 50v4Jm75QCAVGua0rvre3ItZNMc+kfiEcvuxH2yw6w5alKWPFhOuuYNA3tb2paSdiZTU +TazGAIGZtRtZ+abKOwpOpRl6P+R6Kgi0u3jZiN8fpFn6CMhm3U1ZTQt4NajOCfzi5t4 bnuke4qqd4HXhpaN5ft5lCOzFgDYXeI+RV7yXf54AXgiffEY0arlbHFgZFbtksWIrPvE xk9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=DpYMLOrZ; 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 s11-20020a65584b000000b0047712cb3fe3si12807233pgr.590.2022.11.28.11.32.41; Mon, 28 Nov 2022 11:32:59 -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=DpYMLOrZ; 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 S233600AbiK1TXz (ORCPT + 99 others); Mon, 28 Nov 2022 14:23:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233598AbiK1TXd (ORCPT ); Mon, 28 Nov 2022 14:23:33 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBE1C6350; Mon, 28 Nov 2022 11:23:27 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 888ED6141B; Mon, 28 Nov 2022 19:23:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CF66C433D7; Mon, 28 Nov 2022 19:23:25 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="DpYMLOrZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1669663402; 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=oH13CIpQ/7n5BcQUws9hK24sibfqfJzuMBXnlvB67Q4=; b=DpYMLOrZ793QCRyuTlQZN8qqEqS0HrsmmXwLJXR5bz/I+2EzFAN6zgzuziiNQ1ACLVDKSU xumueI67SFzmkHSLrNNqv/jNvMERoZYAVRw4+2heDbLejJ7rYRWj3zOZBbIJLj9uRcbO1g go7AJhYWsDuGtykFsUQekMM4/S4kL3M= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id b5fc3b82 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 28 Nov 2022 19:23:22 +0000 (UTC) Date: Mon, 28 Nov 2022 20:23:16 +0100 From: "Jason A. Donenfeld" To: Arnd Bergmann Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Thomas Gleixner , linux-crypto@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, Greg Kroah-Hartman , Adhemerval Zanella Netto , Carlos O'Donell , Florian Weimer , Christian Brauner , Samuel Neves Subject: Re: [PATCH v8 3/3] x86: vdso: Wire up getrandom() vDSO implementation Message-ID: References: <20221128111829.2477505-1-Jason@zx2c4.com> <20221128111829.2477505-4-Jason@zx2c4.com> <8f9326ba-f879-4b9e-9e5d-b65cad7cd726@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8f9326ba-f879-4b9e-9e5d-b65cad7cd726@app.fastmail.com> 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 Hi Arnd, On Mon, Nov 28, 2022 at 08:18:12PM +0100, Arnd Bergmann wrote: > On Mon, Nov 28, 2022, at 12:18, Jason A. Donenfeld wrote: > > Hook up the generic vDSO implementation to the x86 vDSO data page. Since > > the existing vDSO infrastructure is heavily based on the timekeeping > > functionality, which works over arrays of bases, a new macro is > > introduced for vvars that are not arrays. > > > > Also enable the vgetrandom_alloc() syscall, which the vDSO > > implementation relies on. > > > > The vDSO function requires a ChaCha20 implementation that does not write > > to the stack, yet can still do an entire ChaCha20 permutation, so > > provide this using SSE2, since this is userland code that must work on > > all x86-64 processors. > > > > Reviewed-by: Samuel Neves # for vgetrandom-chacha.S > > Signed-off-by: Jason A. Donenfeld > > --- > > arch/x86/Kconfig | 1 + > > arch/x86/entry/syscalls/syscall_64.tbl | 1 + > > I see that this enables the syscall in x86-64, while patch 1 > adds it to the eight architecures that use > include/uapi/asm-generic/unistd.h (with the __ARCH_WANT_* > guard at the moment, but you already said that will be removed) > > I think ideally the syscall.tbl and unistd.h changes should be done > in one patch for all architectures that doesn't mix it with > any other changes. In particular I think it should be separate > from the vdso changes, but could be in the patch that implements > the syscall. That's more or less how v7 was, but Thomas thought the x86 stuff should be separate. So for v8, the organization is: 1) generic syscall 2) generic vdso 3) x86 wiring The primary advantage is that future archs wanting to add this now can just look at commit (3) only, and make a similar commit for that new arch. If you think a different organization outweighs that advantage, can you spell out what division of patches you want, and I'll do that for v9? Or maybe this v8 is okay? Jason