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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C245C433FE for ; Thu, 24 Nov 2022 17:54:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 90AA06B0071; Thu, 24 Nov 2022 12:54:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8BA936B0072; Thu, 24 Nov 2022 12:54:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A9F76B0073; Thu, 24 Nov 2022 12:54:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6AD466B0071 for ; Thu, 24 Nov 2022 12:54:08 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 40C2A1C6433 for ; Thu, 24 Nov 2022 17:54:08 +0000 (UTC) X-FDA: 80169084576.20.CAC387C Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf11.hostedemail.com (Postfix) with ESMTP id 9DE2B40010 for ; Thu, 24 Nov 2022 17:54:07 +0000 (UTC) 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 2A6C4B8289C; Thu, 24 Nov 2022 17:54:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9263AC433C1; Thu, 24 Nov 2022 17:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669312444; bh=He3Pd8IkhWybpRjkE2MQUgnr0yhm6m/2ss8+4XAeJEQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=mxXZ8xLhnUMUDo7BZKZ1qjitMkHand9xKrfnOrc1LhD0+YmIs0C+8lGkhpT+8uyIU Y3YUnrYy6puecAW7EvhucIYSZboj5N1Ho+dLMCq6h5QdvGh7ppDVPbJaYbIU/xAlpz rOUtJ9kp9c/eIKh3vFcKZ0iH2DL/Dahths77alCoXqdlsioTKus2T80QMnjgi5EIFQ 1fUSxEL0E6BKLRQtZ7wyhC2tbPe5W1o36jKYj7wajylsB5MiKaByqvmOvhbhR9r96K uiPo3ApkYRJZUSAvclVFiGNT8h+wM8FzY1YCCJD68dVY3DbXSBU2tq/Cmzs629VT+D gmS6TFWqytxUg== Message-ID: <27d0de3e-1006-dd3a-0e91-ae8025ef8426@kernel.org> Date: Thu, 24 Nov 2022 17:54:00 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v3 2/3] RISC-V: uapi: add HWCAP for Bitmanip/Scalar Crypto Content-Language: en-US To: Samuel Ortiz Cc: "Hongren (Zenithal) Zheng" , Palmer Dabbelt , Paul Walmsley , Albert Ou , Atish Patra , Anup Patel , Eric Biederman , Kees Cook , linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Michael Kerrisk , linux-man@vger.kernel.org, Jiatai He , Heiko Stuebner References: From: Conor Dooley In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669312447; a=rsa-sha256; cv=none; b=atJGdQoOTvQjyIyjJs+vQ23ueCOBXisp4h2SB/VOE9IiMbvejojYRjQl2l3eq+YqW96dep hc2jJK/jyWohJDPLr9Iwp7/CNx2iFFyBeynapiTFKmRreJjoj/fyHTk/O/rQymYOkrtnAv Cvw6/Nq0YWGHfDP9DlePBAy69yzonjI= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mxXZ8xLh; spf=pass (imf11.hostedemail.com: domain of conor@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=conor@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669312447; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IpcYeSmHsaI8K2LovDOfT4h7PbcZHTbv0rkXtUlxBys=; b=5Yb4qFvUe8qG5wy7a4VESnNDYNTRnVnfXZQqE7crRYEKyAjYKUyVFRCHvQaexD3BSj8SGT wupe7LcXbhExCRgyLpbiypf3V05hcyA5uU+RHxrxJW2/KumrkPxSVyhOgkH0Jiund1S4S7 lszrxzS9OhJMnYMnTsU77Jv3EtZk/j4= X-Rspamd-Queue-Id: 9DE2B40010 X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mxXZ8xLh; spf=pass (imf11.hostedemail.com: domain of conor@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=conor@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam07 X-Stat-Signature: dkberb8qg8r8izgxzi7zwzi4kwebihx7 X-HE-Tag: 1669312447-869067 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 24/11/2022 17:34, Samuel Ortiz wrote: > On Thu, Nov 24, 2022 at 05:20:37PM +0000, Conor Dooley wrote: >> On 24/11/2022 17:12, Samuel Ortiz wrote: >>> [You don't often get email from sameo@rivosinc.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] >>> >>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe >>> >>> On Thu, Nov 24, 2022 at 11:55:01AM +0000, Conor Dooley wrote: >>>> On Thu, Nov 24, 2022 at 11:47:30AM +0100, Samuel Ortiz wrote: >>>> >>>>> Patch #1 is definitely needed regardless of which interface we pick for >>>>> exposing the ISA strings to userspace. >>>> >>>> I took another look at #1, and I feel more confused about what >>>> constitutes canonical order than I did before! If you know better than >>>> I, and you probably do since you're interested in these 6 month old >>>> patches, some insight would be appreciated! >>> >>> Assuming we don't go with hwcap, I dont think the order of the >>> riscv_isa_ext_id enum matters that much? >> >> The chief put it in canonical order so that's good enough for me! >> >>> >>> iiuc we're building the cpuinfo string from the riscv_isa_ext_data >>> array, and I think the current code is incorrect: >>> >>> static struct riscv_isa_ext_data isa_ext_arr[] = { >>> __RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF), >>> __RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC), >>> __RISCV_ISA_EXT_DATA(svinval, RISCV_ISA_EXT_SVINVAL), >>> __RISCV_ISA_EXT_DATA(svpbmt, RISCV_ISA_EXT_SVPBMT), >>> __RISCV_ISA_EXT_DATA(zicbom, RISCV_ISA_EXT_ZICBOM), >>> __RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE), >>> __RISCV_ISA_EXT_DATA("", RISCV_ISA_EXT_MAX), >>> }; >>> >>> zicbom and zihintpause should come before supervisor level extensions. >>> I'm going to send a patch for that. >> >> idk, Palmer explicitly re-ordered this: >> https://lore.kernel.org/linux-riscv/20220920204518.10988-1-palmer@rivosinc.com/ >> >> By my reading of the isa manual, what Palmer did is correct as >> those are not "Additional Standard Extensions". /shrug > > Hmm, by their name (Z[a-b]+) they are Additional Standard Extensions. > What am I missing? Right, and this is where I get confused. Zam and Ztso *are* Additional Standard Extensions, I think we can agree on that one? For those extensions: \chapter{``Ztso'' Standard Extension for Total Store Ordering, v0.1} \chapter{``Zam'' Standard Extension for Misaligned Atomics, v0.1} They're also called out specifically in the table: https://github.com/riscv/riscv-isa-manual/blob/master/src/naming.tex#L147 For Zihintpause however: \chapter{``Zihintpause'' Pause Hint, Version 2.0} See what I mean? I looked at the specs for the bitmanip stuff and for crypto, which both never mention being standard. That table has the caption: > The table also defines the canonical order in which extension names > must appear in the name string, with top-to-bottom in table > indicating first-to-last in the name string. It only calls out Zicsr, Zifencei, Zam and Ztso are being permitted before Sdef, but as I said I am not a specs person, so perhaps some of the extensions in question are intended to go there but have not yet been merged into the isa manual doc. Zihintpause *is* in the isa manual though but not specifically called out. Anyways, hopefully that at least helps with my line of thinking! Conor.