uabi.rst 3.1 KB

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