1 .. SPDX-License-Identifier: GPL-2.0
6 ISA string ordering in /proc/cpuinfo
7 ------------------------------------
9 The canonical order of ISA extension names in the ISA string is defined in
10 chapter 27 of the unprivileged specification.
11 The specification uses vague wording, such as should, when it comes to ordering,
12 so for our purposes the following rules apply:
14 #. Single-letter extensions come first, in canonical order.
15 The canonical order is "IMAFDQLCBKJTPVH".
17 #. All multi-letter extensions will be separated from other extensions by an
20 #. Additional standard extensions (starting with 'Z') will be sorted after
21 single-letter extensions and before any higher-privileged extensions.
23 #. For additional standard extensions, the first letter following the 'Z'
24 conventionally indicates the most closely related alphabetical
25 extension category. If multiple 'Z' extensions are named, they will be
26 ordered first by category, in canonical order, as listed above, then
27 alphabetically within a category.
29 #. Standard supervisor-level extensions (starting with 'S') will be listed
30 after standard unprivileged extensions. If multiple supervisor-level
31 extensions are listed, they will be ordered alphabetically.
33 #. Standard machine-level extensions (starting with 'Zxm') will be listed
34 after any lower-privileged, standard extensions. If multiple machine-level
35 extensions are listed, they will be ordered alphabetically.
37 #. Non-standard extensions (starting with 'X') will be listed after all standard
38 extensions. If multiple non-standard extensions are listed, they will be
39 ordered alphabetically.
41 An example string following the order is::
43 rv64imadc_zifoo_zigoo_zafoo_sbar_scar_zxmbaz_xqux_xrux
45 "isa" and "hart isa" lines in /proc/cpuinfo
46 -------------------------------------------
48 The "isa" line in /proc/cpuinfo describes the lowest common denominator of
49 RISC-V ISA extensions recognized by the kernel and implemented on all harts. The
50 "hart isa" line, in contrast, describes the set of extensions recognized by the
51 kernel on the particular hart being described, even if those extensions may not
52 be present on all harts in the system.
54 In both lines, the presence of an extension guarantees only that the hardware
55 has the described capability. Additional kernel support or policy changes may be
56 required before an extension's capability is fully usable by userspace programs.
57 Similarly, for S-mode extensions, presence in one of these lines does not
58 guarantee that the kernel is taking advantage of the extension, or that the
59 feature will be visible in guest VMs managed by this kernel.
61 Inversely, the absence of an extension in these lines does not necessarily mean
62 the hardware does not support that feature. The running kernel may not recognize
63 the extension, or may have deliberately removed it from the listing.
68 Misaligned accesses are supported in userspace, but they may perform poorly.