[RFC] Toolchain interface for privilege spec related stuff.


Kito Cheng
 

Hi :

I am Kito Cheng, one of the RISC-V open source toolchain developer.
Recently RISC-V LLVM and RISC-V GNU toolchain community are discussing
how to version control the privilege spec stuff - which CSR and
instruction defined in privilege spec can be used.

The reason why we want an option control is the backward
compatibility, as we know privileges spec (unfortunately) has few
incompatible changes like sfence.vm is replaced by sfence.vma, hret is
removed, and several minor incompatible changes.

Current proposal is add a new command line option `-mpriv-spec=` to
control the version of privilege spec, it can be -mpriv-spec=1.9,
-mpriv-spec=1.10 or -mpriv-spec=1.11, and add -mpriv-spec=1.12 once
priv spec 1.12 ratified.

That will imply the version of machine-level ISA, supervisor ISA, and
maybe hypervisor extension if there is no ISA string allocated.

So there would be two command line interfaces for all privilege spec,

-march=: use -march to control if the extension has ISA string like
Svinval, that need to enabled by -march option like
-march=rv32i_svinval,

-mpriv-spec=: Other privilege stuffs are controlled by
`-mpriv-spec=` and their will having a default value in the toolchain,
the default value might different on different versions of the
toolchain.


Is it a reasonable interface to current privilege spec? or any comment
or suggestion on this proposal?

[1] https://github.com/riscv/riscv-toolchain-conventions/pull/16

Join tech-privileged@lists.riscv.org to automatically receive all group messages.