HomeFreeBSD

riscv: improve parsing of riscv,isa property strings

Description

riscv: improve parsing of riscv,isa property strings

This code was originally written under the assumption that the ISA
string would only contain single-letter extensions. The RISC-V
specification has extended its description of the format quite a bit,
allowing for much longer ISA strings containing multi-letter extension
names.

Newer versions of QEMU (7.1.0) will append to the riscv,isa property
indicating the presence of multi-letter standard extensions such as
Zfencei. This triggers a KASSERT about the expected length of the
string, preventing boot.

Increase the size of the isa array significantly, and teach the code
to parse (skip over) multi-letter extensions, and optional extension
version numbers. We currently ignore them completely, but this will
change in the future as we start supporting supervisor-level extensions.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36601

(cherry picked from commit 701923e2a4105be606c5263181b6eb6f546f1a84)

Details

Provenance
mhorneAuthored on Oct 28 2022, 4:28 PM
Differential Revision
D36601: riscv: improve parsing of riscv,isa property strings
Parents
rGaf1d86cfac25: ddb(4): document some missing commands
Branches
Unknown
Tags
Unknown