From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46A09C77B73 for ; Wed, 24 May 2023 16:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WchazqOhYaOCiVWc1dTI4e1/96u4vHkTJ07O39b+4r4=; b=35QJq1dXrx96ll tySXuSIQqaWqO6lWjQA5hN5HXKuiuYISNxIvFKGHJuIq+gBzdtSh9I7cW+1vaL1JDkFAAH6047SBW iWWoCW1CXNNPYMveBtK0yrfVKjW8aCA8x0KR/n1J+6KUOe7QwgUCtnDGcDMUeF35OjyHcUHEH0kK1 aQ+r7s9szcM3NDgJC6esr5Ytnkp1UVblPk4w22tHVzMIwN2ZKUWVLCXgx8cwuZ2h+yStkzOVyKpKp HRvQGlvQZjUpvtszBxyE8XyaUy99X6dwr9ABsjTVmk7BRwSzqSuGK1zj3zObAY9ke40h6rSg2otKl BjwTNTcES2MTqkpJZ2Yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1r79-00DyRh-09; Wed, 24 May 2023 16:13:27 +0000 Received: from sinikuusama2.dnainternet.net ([83.102.40.152]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1r74-00DyOg-20 for linux-riscv@lists.infradead.org; Wed, 24 May 2023 16:13:26 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230524_091322_912296_2CC2B688 X-CRM114-Status: GOOD ( 15.72 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-riscv" Errors-To: lin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maWcgd2l0aCBubyAKcnVudGltZSBjb25maWd1cmF0aW9uLgoK LS0gClLDqW1pIERlbmlzLUNvdXJtb250Cmh0dHA6Ly93d3cucmVtbGFiLm5ldC8KCgoKCl9fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCmxpbnV4LXJpc2N2IG1h aWxpbmcgbGlzdApsaW51eC1yaXNjdkBsaXN0cy5pbmZyYWRlYWQub3JnCmh0dHA6Ly9saXN0cy5p bmZyYWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vbGludXgtcmlzY3YK From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8B39C77B7C for ; Wed, 24 May 2023 16:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229457AbjEXQN3 convert rfc822-to-8bit (ORCPT ); Wed, 24 May 2023 12:13:29 -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 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" 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/