Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp9329797rwb; Thu, 24 Nov 2022 11:06:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf6WcKpJXqd+VR29+5aCme+BNbBJFgVKpItZAgPrjlwUqZyHKl8Un5skaw8NHSHZcqUzcDHC X-Received: by 2002:a17:902:ca14:b0:187:3fc8:986e with SMTP id w20-20020a170902ca1400b001873fc8986emr16571440pld.4.1669316777379; Thu, 24 Nov 2022 11:06:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669316777; cv=none; d=google.com; s=arc-20160816; b=VdgGQ6P1kKMzqJBCRJ+0dSh4jzXFRDOGveDoxLy+AP5PY1afrTpRcn6pv+2PVcFh2l FZNVTVC7JXC+XFWHBPhRxh5Sb+o9gVut0GVDZQad54PwtJ4gdxuVsx5AQuiQZPcClT1m To8czgF6uRBG+EjrSy/ZwagDSAA/plIRmdvltZsB3x7QhBqC/AIIMxM86bCLNkfdCUbc ZvkOwEYy6ztmxVXcWDCjfr8Th0+m2pfnRtaXtnFTMtvQEYUqVQWdQvrJsKgzeIBfPoT8 DPktH7fcFY/kzrPXb5aaRy5eFOQ/fxB3M1ZZD3VusvmNt5ejRUj/KzN6gVgLmGM7x9iT IfqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4j/3qr/essTH4o+9bQoOm2X2iPpGf3asbr9aUA3N9IA=; b=mwJE93fkFSiVdhMiz4HZTDxWsYx8dERXU0OM9eM5M3FVI8xR/HbCO1ZEJ1uCsdlnEX lVdq1Z9/eMV/hd6O6NnZISs7UfaUROWF6yhU+EdFbIORbgTvVwpQUqWbw4Z12p7/urNt PWRj914P/3S58Z3Cex7AasmVrm9zVxlo4b1dgFXa3VcY7dSuRXS0jjatIO5ATTlyFOim L1WvJFz84VkakJkuHR+dzYxPknuaOoVPdVw7/XOiaL/1oBH+l0cRvXjDJ+isfhxHTsCw 1wRT0UqJUIf4zYuLjeUbKKlWCECpSzgBvA3b9WAarfkfQWnruN7U9En+XfQM3YrhptDT QRZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=QRjBan++; 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 h19-20020aa796d3000000b005745ec81a33si1693995pfq.309.2022.11.24.11.06.05; Thu, 24 Nov 2022 11:06:17 -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=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=QRjBan++; 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 S229847AbiKXSJs (ORCPT + 86 others); Thu, 24 Nov 2022 13:09:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbiKXSJq (ORCPT ); Thu, 24 Nov 2022 13:09:46 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E878474ABB for ; Thu, 24 Nov 2022 10:09:44 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id i12so3589121wrb.0 for ; Thu, 24 Nov 2022 10:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4j/3qr/essTH4o+9bQoOm2X2iPpGf3asbr9aUA3N9IA=; b=QRjBan++vhp4SIL4Vu+DzdCCNXao+23zxmn9FfigQr+hfk1vazzX0CUFW+cwMyzbjT 0sptCE81q9kgZdoC19YsCqOVTco2Ba2k5+CmZhhmbj+wubJfeCv+jpDyVbV91692YMku 7Er8+XIiOrC1tfyeWB/WMTL/Tnq4jIOUh6MsikRo/nwwcKrWtblU0YRTvQt0/bbonQRy teP6PqXz6mznnL8jv/wM9xMvA7D27PC4uAEHsWF1GKJBa2BSSc2WvzkvO0t/sd1Un9uG b8BpxR/Al/oO2Tl8fHhQvBaZCoFejko0ceT/JYWth8vFdUKA/PfHoaLl/YttgiwHKiHM 0MtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4j/3qr/essTH4o+9bQoOm2X2iPpGf3asbr9aUA3N9IA=; b=HfFdiTpwykyIbilcS/wFcRLT4KOPfDMH9ZG5l0GnJp5AGg94qxFJz23JwZUirLrFJF 9svyXr8MLQGB2TJByn1pyd/QNXvJXOuMz0w7O5DMnd4DdBJ3Befmp4lUvyTxgsguQV2h MlqDtL/IeL2G18kQhjb1W00AHkN/x8z/8mMs4YEpnTGwItUBThwJ6ae0aDMdjWa4QXee M6HbkcaEfcOSRYO3YM+WDsaHKvxdioFbvDB/RaCOQG5mlgeUZWG18xEvhHyoRkBqKp9G m/tunzetSvRYNXI/ousCVpvMMizTMJwEdqrqY9C9Fu95pNbfmUuLc6CxAowXuoHtNQmX IxNQ== X-Gm-Message-State: ANoB5pnaI8E+9akh+JqOKtB59nTyxYb0vi5qucPXAmEEXZE5+8gM4fTS dQ47KKX3Shn40/DPaWMoBM9mKw== X-Received: by 2002:a5d:6389:0:b0:241:c5fe:f78a with SMTP id p9-20020a5d6389000000b00241c5fef78amr17181945wru.144.1669313383437; Thu, 24 Nov 2022 10:09:43 -0800 (PST) Received: from vermeer ([145.224.92.100]) by smtp.gmail.com with ESMTPSA id fn27-20020a05600c689b00b003cf75213bb9sm6771615wmb.8.2022.11.24.10.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 10:09:43 -0800 (PST) Date: Thu, 24 Nov 2022 19:09:39 +0100 From: Samuel Ortiz To: Conor Dooley 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 Subject: Re: [PATCH v3 2/3] RISC-V: uapi: add HWCAP for Bitmanip/Scalar Crypto Message-ID: References: <27d0de3e-1006-dd3a-0e91-ae8025ef8426@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <27d0de3e-1006-dd3a-0e91-ae8025ef8426@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 Thu, Nov 24, 2022 at 05:54:00PM +0000, Conor Dooley wrote: > 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. I *think* this is because Zihintpause, bitmap and crypto are ratified but not yet part of an official spec (non-draft) release? > 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! It does, thanks. It's a little confusing, I agree. Cheers, Samuel.