Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp9291753rwb; Thu, 24 Nov 2022 10:31:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf6iZRR1z6+4du97spzCI/aE3Eqf1GPHyvLc8wqZvjuHaRUgFUanyp3C+xSGATDtoooLOCxa X-Received: by 2002:a17:90a:b38b:b0:214:1328:ac8f with SMTP id e11-20020a17090ab38b00b002141328ac8fmr36488489pjr.198.1669314709437; Thu, 24 Nov 2022 10:31:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669314709; cv=none; d=google.com; s=arc-20160816; b=YvmjDgn/oSouE9E3caOI053nNJUi41gfN6ZzftKPnVUYmKIvUokoc9hwZIe0UglYUs x+5cT1FXEET19+U26ok7lKoogFgc4b7GImSHanZqxoaUtW8txrr3pyB/yTNWG/m98c+k /oFOmbesbm4CXAxBLCQ1BE9fBNlL8sOor0k1r8kXALu+BFPbMk/QfamJPzILv8uUy/y2 WAjv1RbV+It3gCpHARNQlHC1pRATJsNZw/NoDMO/ZEWb1J/9Ntr9fYzPCJFRTgtbz6DI mUwuRjBoL8oYqpUiSPVIE/3+2Zy/zSyV0bq+GgyXGN7gtEX8m6dexv3EDbKwAc8y60Dm BsfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=IpcYeSmHsaI8K2LovDOfT4h7PbcZHTbv0rkXtUlxBys=; b=fPyRYCgEWIXsIn57mxeAt4C6jH4cvM9BpT03W3EsA2hW4bluj2DHd3CMWuOV3XExye 11/Pgplty0hUHGr0CIRZcofk7Awg3WyVolyKCZWRdsQQGj506uq9+67A0jTF80E4uSw7 8icd8pjmT20c8X/uCN87zLr88cMOzp40TTeyLpIBxxiYX6xKWfEv2XGJ5M37N5p+4YDb UX1B0rs53ri701EzZpeGEDWRjA/pNyH2EQP/b6gHwg2lbu8NHgQKER/yJ5onSgaOaMuB RNfjM+VhHrzLRmPyZKtINIjZICgOF6Y2uVVetQkkybyhee56npwMPahUnr6ECe1vAeGw QUHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mxXZ8xLh; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a170902904400b0017e20ec5490si1505945plz.301.2022.11.24.10.31.37; Thu, 24 Nov 2022 10:31:49 -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=@kernel.org header.s=k20201202 header.b=mxXZ8xLh; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbiKXRzI (ORCPT + 87 others); Thu, 24 Nov 2022 12:55:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbiKXRyy (ORCPT ); Thu, 24 Nov 2022 12:54:54 -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 56A476550; Thu, 24 Nov 2022 09:54:07 -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 0CF51B8287B; 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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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 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.