Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14899818rwb; Mon, 28 Nov 2022 06:08:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf7hVW/OkA2PfYiDgQ33T+i4L8gaQGtLSylyun3HxaLJpIqNk1Nz74uto3bjNnoIwSP4QJ1t X-Received: by 2002:a05:6402:5:b0:459:cdb:92ad with SMTP id d5-20020a056402000500b004590cdb92admr30844081edu.77.1669644530076; Mon, 28 Nov 2022 06:08:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669644530; cv=none; d=google.com; s=arc-20160816; b=OtAD8irs66SipXffW2trhnuBKAgOI9ejD4l2KNakxnGhi16ih1rx54Gn5q7AX5vhnV J8YRZEQBLSpacOMezX2nycRj4NDxrQ5GZRw5KgDfi8lDsi69qkYb/O1zPfM3cwutCVQ5 0cC/2GhWlXC5F+meYppL2/ey3Onp50iaUrueyY1qjDJ4gXAYpL9XgXfzqg5foP7wEWOk eWh2ZLbFoThpg5HaZriHNw+msTW/rb/7MF4wAAmr0QTGrwNlGOdpH9B+0zzRPfdr8OsF ShKvglYr6mu/1JdqWUzJLlzMkEAOmh46Jlx2MgP2clAGAxq1/D0NcvZu0wkJlZfsgQNO qdNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=KQcpOA4V11EXNrxS5nHlKDVdF9XDuHnhnKU0CEb1Oes=; b=GKfjacckLJhyER5djwe+3HFAWU23w5Ro0w8Q7DHaMol2LMhZJ82E8+0YghLI80OZgI t9X/q5amKDUCGZO3huZAKp//iJ91O85Ht5zjlGhem57nu/v2q3wzA6oKHFUKpi8TiQ5I aGeI5Yb/iUmE2mi7Wafo9SIArANAoUQoXOYaD3Kg0sHj4ezyvrKyaKys0ISGxraiFVqk gggkBuyu7h+TBXtdjPfzcbx3omngTCS7A+zHoxy8zVtaL1WM01MkIUZd9z6KX2tb4Ebz i+O8oUhSGpMJG+zh4DaIwKMThouDafBUgGIblHQA0X9duVAR/oUjwI0bgz0HXjtuP1lO Fiig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=oNyCR4Ot; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=C4PCw4tt; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw14-20020a1709066a0e00b007806c141214si8706795ejc.153.2022.11.28.06.08.08; Mon, 28 Nov 2022 06:08:50 -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=@arndb.de header.s=fm3 header.b=oNyCR4Ot; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=C4PCw4tt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231720AbiK1NzF (ORCPT + 99 others); Mon, 28 Nov 2022 08:55:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231147AbiK1NzC (ORCPT ); Mon, 28 Nov 2022 08:55:02 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1DC8D66; Mon, 28 Nov 2022 05:55:00 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 5A65B5C0175; Mon, 28 Nov 2022 08:55:00 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Mon, 28 Nov 2022 08:55:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1669643700; x=1669730100; bh=KQcpOA4V11 EXNrxS5nHlKDVdF9XDuHnhnKU0CEb1Oes=; b=oNyCR4OtmVBeFtiRZAUp6Ly3/0 49eqo8kBIYTm2G+DA9S3a8t4rYeBnPTT9iIt1PxJRxFBawR8+gxdAFoAHOvdV2ND XCnuyUeyF7NFRNrZ08IQMxpORXpj8riuU4L5+6JuJ0Q7Hbu3kV84f/qxKOw+4j2+ xA6dxBtvnBh6CUbrTCwJJ58tvFPTAkJ64Waai18zwdR3tfJAQyh05yFVH9T7kLLh oere6Le73Xul6vmrQa+3mPGLm52v0yAsj+hdKl30hixpraIPFIV8Q2lV8O94OKn1 nOJ/c78VTk1jAskPuMVK2jhot4LmkuRCLBN48W4sucerhQDc2IU4AO2DU+bg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1669643700; x=1669730100; bh=KQcpOA4V11EXNrxS5nHlKDVdF9XD uHnhnKU0CEb1Oes=; b=C4PCw4tt5+3rl7gaf8IhBxTQbzecepZ6NfbPkZAPOpvC GBQfrNUx3aFGt+rAZzSbDT0FY6rT+Ph5jmvwBpls67HlpT0Bq28cU8zxRlY9CkIg YrHIIqbtOcyFlyMyhsCHCYdcRB8p4n5BIrYqYgOILtoLYiafj3i8ltiSQ8hFWcwT smn+Ovwts0DjhE2Yq8tm43G/re3vIIWpI1BZaJDtuIkwsploYqemH4WRTUN1tEMN wRVeZo8inTu3tYsjRR8dPZcChJu4JJPLPsptgRtILfPSl1xrhCqExAjrTdfGqRau 6TopQ5m3Gopf6Dnm5C9v5KGbWwbDabKobsVUxxdo3A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrjedvgdehkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0A1FAB60086; Mon, 28 Nov 2022 08:54:59 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: <8f25aa1e-cb42-4ef0-a1ff-93dcf8651213@app.fastmail.com> In-Reply-To: References: <20221124165536.1631325-1-Jason@zx2c4.com> <20221124165536.1631325-2-Jason@zx2c4.com> <87bkouyd90.ffs@tglx> Date: Mon, 28 Nov 2022 14:54:39 +0100 From: "Arnd Bergmann" To: "Jason A . Donenfeld" , "Thomas Gleixner" Cc: 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 Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 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. Arnd