lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221130234125.2722364-4-conor@kernel.org>
Date:   Wed, 30 Nov 2022 23:41:26 +0000
From:   Conor Dooley <conor@...nel.org>
To:     Palmer Dabbelt <palmer@...belt.com>,
        linux-riscv@...ts.infradead.org
Cc:     Conor Dooley <conor.dooley@...rochip.com>, ajones@...tanamicro.com,
        aou@...s.berkeley.edu, conor@...nel.org, corbet@....net,
        guoren@...nel.org, heiko@...ech.de, paul.walmsley@...ive.com,
        linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org
Subject: [PATCH v1 3/3] Documentation: riscv: add a section about ISA string ordering in /proc/cpuinfo

From: Conor Dooley <conor.dooley@...rochip.com>

The RISC-V specs are permissive in what they allow as the ISA string,
but how we output this to userspace in /proc/cpuinfo is quasi uAPI.

Formalise this as part of the uAPI, by documenting the list of rules
we use at this point in time.

Signed-off-by: Conor Dooley <conor.dooley@...rochip.com>
---
I've not "tested" these docs. The NIPA-esque pwbot should go and
test it AFAICT. If it doesn't, I'll go add that.
---
 Documentation/riscv/uabi.rst | 42 ++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/Documentation/riscv/uabi.rst b/Documentation/riscv/uabi.rst
index 21a82cfb6c4d..bc3c8ced644b 100644
--- a/Documentation/riscv/uabi.rst
+++ b/Documentation/riscv/uabi.rst
@@ -3,4 +3,46 @@
 RISC-V Linux User ABI
 =====================
 
+Misaligned accesses
+-------------------
+
 Misaligned accesses are supported in userspace, but they may perform poorly.
+
+ISA string ordering in /proc/cpuinfo
+------------------------------------
+
+The canonical order of ISA extension names in the ISA string is defined in
+chapter 27 of the unprivileged specification.
+The specification uses vague wording, such as should, when it comes to
+ordering, so for our purposes the following rules apply:
+
+#. Single-letter extensions come first, in "canonical order", so
+   "IMAFDQLCBKJTPVH".
+
+#. All multi-letter extensions will be separated from other multi-letter
+   extensions by an underscore.
+
+#. Additional standard extensions (starting with 'Z') will be sorted after
+   single-letter extensions and before any higher-privileged extensions.
+
+#. The first letter following the 'Z' conventionally indicates the most
+   closely related alphabetical extension category, IMAFDQLCBKJTPVH.
+   If multiple 'Z' extensions are named, they should be ordered first by
+   category, then alphabetically within a category.
+
+#. Standard supervisor-level extensions (starting with 'S') will be listed
+   after standard unprivileged extensions.  If multiple
+   supervisor-level extensions are listed, they will be ordered
+   alphabetically.
+
+#. Standard machine-level extensions (starting with 'Zxm') will be listed
+   after any lower-privileged, standard extensions.  If multiple
+   machine-level extensions are listed, they will be ordered
+   alphabetically.
+
+#. Non-standard extensions (starts with 'X') will be listed after all
+   standard extensions.
+
+An example string following the order is:
+   rv64imadc_zifoo_zigoo_zafoo_sbar_scar_zxmbaz_xqux_xrux
+
-- 
2.38.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ