Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15262837rwb; Mon, 28 Nov 2022 09:33:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf7GKjYpPW9amgmh45fPA/w8dwjoRvIgDPiSXN/ivG7QCzG0LC0Q9R+giCY4HM4R+Bnynjxv X-Received: by 2002:a05:6402:41:b0:467:3ea2:3ec4 with SMTP id f1-20020a056402004100b004673ea23ec4mr49132386edu.351.1669656819721; Mon, 28 Nov 2022 09:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669656819; cv=none; d=google.com; s=arc-20160816; b=WmxdEiLWyD7W5hqvKLDSL8EkLeJvuTNGKgjw9hbvDgvDLiWIocc59KmH+aHyhzGOkx ZReuaM3WHcljt69brhhgX6QQKD718qqn13KWchh4CpMMxgsutVxUIw3UdKCfkJnHikOM WEnfxyxz8+KTV5aB+fiwQyDUB4cNgZlL5pfJQ/M4mLgYCPDMpYZA3vtYajXGQ5evdmCH gNZd5BRGlzLYExcCT3i5halN4RVBmZr9rw2J+864WQuAz23BMpW4LcNnlQX3vGuwJw0J NCEwwrKRl2lIDIQbiYVWklLS4+nFcixs+iHiEZWUkijfaz1EzNaAtbZt3DvUmSNLeJ/k RzFA== 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=zx+xERd2IzI+idUZ4FTTj35GNfBVVHdMcem2M32A5rM=; b=Hxz34CCYsRvNt0mWcT9D26pHtvyDXQ2umuFlvbZ16EtZayrMS2uFUq2Q27kMojSgNo oN18KafsFMV2Hob8slnH0+/wh99gKVW6Xb6g47Y1Gl+b2u45aWs3wvwkewpqD4pHR6Vc ZlKMHU5v/W+Om414VUhqjnJIWx6x1eS4Vv7XhfDDbjav+bOCp5+VjCqkdRWKdMQwv2dl OO5CcTc8rw4maex5Ej3lfsiI7V+bQjlnrJI8fLFMwBHamNK2/oq8LJAHUqjWP0vvKl1H kkuhH2t+9scOxVcpfYNmsc3iqskOre7WeRz8KnnHIq/+7++ErwN3gUL4OCC6Ot7lKEPR U0mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=lgJAHmRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 hg2-20020a1709072cc200b007ae9abf1994si10878864ejc.837.2022.11.28.09.33.18; Mon, 28 Nov 2022 09:33:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=lgJAHmRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S232920AbiK1RRg (ORCPT + 84 others); Mon, 28 Nov 2022 12:17:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232901AbiK1RR3 (ORCPT ); Mon, 28 Nov 2022 12:17:29 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F8C26AEC; Mon, 28 Nov 2022 09:17:28 -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 4B6F7B80E74; Mon, 28 Nov 2022 17:17:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4B3AC433D6; Mon, 28 Nov 2022 17:17:24 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="lgJAHmRg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1669655843; 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=zx+xERd2IzI+idUZ4FTTj35GNfBVVHdMcem2M32A5rM=; b=lgJAHmRg2fviMIGsKiHeOq7t5Opiaxy9sLeRGvooCfpC14Ba2i2UirnTWC1TWN9LNqTWhG rAqareEvPn8JYyokXvOEY0/F4scn16gSLgMItFYXjfu7to/dCLFcmNEoBxomLwHdsMIs5t I+UW36utDQAg5MqAIbJi5i7GOwFrFig= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id b9d4e8ea (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 28 Nov 2022 17:17:22 +0000 (UTC) Date: Mon, 28 Nov 2022 18:17:16 +0100 From: "Jason A. Donenfeld" To: Arnd Bergmann 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 , Christian Brauner Subject: Re: [PATCH v7 1/3] random: add vgetrandom_alloc() syscall Message-ID: References: <20221124165536.1631325-1-Jason@zx2c4.com> <20221124165536.1631325-2-Jason@zx2c4.com> <87bkouyd90.ffs@tglx> <8f25aa1e-cb42-4ef0-a1ff-93dcf8651213@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8f25aa1e-cb42-4ef0-a1ff-93dcf8651213@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-kernel@vger.kernel.org Hi Arnd, On Mon, Nov 28, 2022 at 02:54:39PM +0100, Arnd Bergmann wrote: > On Sun, Nov 27, 2022, at 21:18, Jason A. Donenfeld wrote: > >> > >> config GENERIC_VDSO_RANDOM_WHATEVER > >> bool > >> select VGETRANDOM_ALLOC > >> > >> This gives a clear Kconfig dependency instead of the random > >> ADVISE_SYSCALLS select. > > > > That's much better indeed. I was trying to straddle the two conventions > > of `#define __ARCH_...` for syscalls and a Kconfig for vDSO functions, > > but doing it all together as you've suggested is nicer. > > > > I'll try to figure this out, though so far futzing around suggests there > > might have to be both, because of unistd.h being a userspace header. > > That is, include/uapi/asm-generic/unistd.h typically needs a `#if > > __ARCH_WANT..., #define ...` in it. I'll give it a spin and you'll see > > for v8. At the very least it should get rid of the more awkward > > `select ADVISE_SYSCALLS if X86_64` part, and will better separate the > > arch code from non-arch code. > > I think you should not need an __ARCH_WANT_SYS_* symbol for this, > the only place we actually need them for is the asm-generic/unistd.h > header which is still used on a couple of architectures (I have > an experimental series for replacing it with a generic syscall.tbl > file, but it's not ready for 6.2). In most cases, the __ARCH_WANT_SYS_* > symbols are only used for syscalls that are part of the table for > old architectures but get skipped on newer targets that always had > a replacement syscalls (e.g. getrlimit getting replaced by prlimit64) > > I think we should just reserve the syscall number for all architectures > right away and #define the __NR_* macro. libc will generally need > a runtime check anyway, and defining it now avoids the problem of > the tables getting out of sync. > > The Kconfig symbol is fine in this case. Oh, great, okay. I'll get rid of the __ARCH stuff entirely then. I jumped the gun and posted v8 earlier today, but I'll include this in a v9, whenever it makes sense to send that. So when reading v8, just assume all he __ARCH_WANT_SYS_* business has been removed. Jason