Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6041282rwd; Wed, 24 May 2023 09:59:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5bUleiEzcuG88csQq2NJ7FQBzLCwhphZVG/bUOoLHCIT2H8PFJ2vC2yKe8hldvJeFTxY8v X-Received: by 2002:a05:6a00:2352:b0:64f:40bc:74f3 with SMTP id j18-20020a056a00235200b0064f40bc74f3mr4262710pfj.13.1684947541732; Wed, 24 May 2023 09:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684947541; cv=none; d=google.com; s=arc-20160816; b=GcYQ18CfPhcGT+EeKH3YIK0GdUUqllVeSkXjgxpu3NtAzUaYcubrx0EeApSISqMcS4 AN9tDnnBM4o86BId1nWp2dZ94ZD1Q67WKgme+xLa/HqRr8WmVpkxUNNFEhJ310U0BBHS 0JhLqvK6zqd9HNWT1Pwdr2ssfFdOKV5PGFnf/HPUiqoYnBjMRcpGCtWbWjTq0IrojvcY 4Dwfx7BVpBXKQSylIH4wT4EgoOJiZOSOyxeqJmWqQ+QaoB7uqCMHbzL0rZmSsDPa4z0S 4Ex4JNTSvWpkNqbUeoCRUb51Ldw+gU/nz7cjvA3a1fDn0TzqHzWG6pVqhsASwJMYWaii TV4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from; bh=+0wKZ29HaQ55FfT2MI3fQrfE6iYiE92QxBQHp26yM9Q=; b=UvzE2IaqjCiwHlf3uv7v2OU/Zba4MbMdO2loSxAqfuu6hsPDDFob5N4DqjB1vRcO84 Lj6EteiPG5GOSD9lnEX10MG3aaSWSPKm9oDfgG5SzZPqodoN5MV8ScOOz0bqJyMiViUZ JuGOA/Bu6SUi0zKSDrhPrVnerMYzLyozQigbvuTwR+gy1zwemp6FPNq0QpIcR1Pc2JSE ccARJAAzlCh2rEyXBfqr0QrL3kxLcIduHNukcQEF1NLlo6ruVjqlWS/e2MtPkcrcCDJ3 9rLEvpp6PwG7G10Aopnycs5A9zCsAFhCEZW/JPrz4MPgzTxms8Fae7XAQ1J0kV8bewoz i36w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a637342000000b0052872c32995si8620897pgn.724.2023.05.24.09.58.47; Wed, 24 May 2023 09:59:01 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230473AbjEXQN2 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 24 May 2023 12:13:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbjEXQN1 (ORCPT ); Wed, 24 May 2023 12:13:27 -0400 Received: from sinikuusama2.dnainternet.net (sinikuusama2.dnainternet.net [83.102.40.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA5D0122 for ; Wed, 24 May 2023 09:13:23 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by sinikuusama2.dnainternet.net (Postfix) with ESMTP id CF793DE18; Wed, 24 May 2023 19:13:15 +0300 (EEST) X-Virus-Scanned: DNA Internet at dnainternet.net X-Spam-Score: 0.92 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR autolearn=ham autolearn_force=no version=3.4.6 Received: from sinikuusama2.dnainternet.net ([83.102.40.152]) by localhost (sinikuusama2.dnainternet.net [127.0.0.1]) (DNA Internet, port 10041) with ESMTP id Ce7PVoYQRckz; Wed, 24 May 2023 19:13:15 +0300 (EEST) Received: from luumupuu2.dnainternet.net (luumupuu2.dnainternet.net [83.102.40.55]) by sinikuusama2.dnainternet.net (Postfix) with ESMTP id 80A2AE355; Wed, 24 May 2023 19:13:15 +0300 (EEST) Received: from basile.localnet (87-92-194-88.rev.dnainternet.fi [87.92.194.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by luumupuu2.dnainternet.net (Postfix) with ESMTPS id 84DA22C60; Wed, 24 May 2023 19:13:10 +0300 (EEST) From: =?ISO-8859-1?Q?R=E9mi?= Denis-Courmont To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: andy.chiu@sifive.com, Palmer Dabbelt Subject: Re: [PATCH -next v20 20/26] riscv: Add prctl controls for userspace vector management Date: Wed, 24 May 2023 19:13:10 +0300 Message-ID: <2621691.14T4csFsIl@basile.remlab.net> Organization: Remlab In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="UTF-8" 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 Le keskiviikkona 24. toukokuuta 2023, 3.18.26 EEST Palmer Dabbelt a écrit : > > I don't think the value of an auxillary vector entry can change in an > > existing process nor that we need that. If an application starts with V > > disabled, you can keep the V bit clear even if V gets enabled later on; > > that won't break existing userspace code, which simply won't use vectors. > > > > What does break existing userspace is setting the V bit whilst vectors are > > disabled. > So maybe the right answer is to just not set V at all? That is one possibility that I can live, although it feels unnecessarily user- hostile compared to setting it only if the process _started_ with V enabled. > The > single-letter extensions are sort of defunct now, there's multi-letter > sub extensions for most things, but V got ratified with those > sub-extensions so we could just call it extra-ambiguous? Maybe; I must admit I have zero visibility to RVI inner workings. At least C, D and F bits could work for JIT use cases, I suppose. E and M are totally impractical to support. G, I, X and Z cannot are already wasted by the design, and I guess we will now waste all 16 others. But as for V, what is the user-space story for the prctl()? Who is intended to enablet V mode? If there is no clear story, it is all but guaranteed that random libraries will call it, and just _blindly_ assume that there is enough stack space for signal handling. If so, then there is not much point having a prctl() in the first place; might as well stick to just a kernel Kconfig with no runtime configuration. -- Rémi Denis-Courmont http://www.remlab.net/