diff options
author | Tsukasa OI <research_trasio@irq.a4lg.com> | 2022-05-10 20:29:08 +0900 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2022-05-24 10:38:46 +1000 |
commit | a4a9a4432e2bf280a989ca344466d7375db7993f (patch) | |
tree | 341419f7fcfbbc34cd1fe33c2f1091daebd40839 /target/riscv | |
parent | 6047dcc2459fc6d1c49c4aa02e2e902dd3113856 (diff) | |
download | qemu-a4a9a4432e2bf280a989ca344466d7375db7993f.zip qemu-a4a9a4432e2bf280a989ca344466d7375db7993f.tar.gz qemu-a4a9a4432e2bf280a989ca344466d7375db7993f.tar.bz2 |
target/riscv: Add short-isa-string option
Because some operating systems don't correctly parse long ISA extension
string, this commit adds short-isa-string boolean option to disable
generating long ISA extension strings on Device Tree.
For instance, enabling Zfinx and Zdinx extensions and booting Linux (5.17 or
earlier) with FPU support caused a kernel panic.
Operating Systems which short-isa-string might be helpful:
1. Linux (5.17 or earlier)
2. FreeBSD (at least 14.0-CURRENT)
3. OpenBSD (at least current development version)
Signed-off-by: Tsukasa OI <research_trasio@irq.a4lg.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <7c1fe5f06b0a7646a47e9bcdddb1042bb60c69c8.1652181972.git.research_trasio@irq.a4lg.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target/riscv')
-rw-r--r-- | target/riscv/cpu.c | 6 | ||||
-rw-r--r-- | target/riscv/cpu.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 9f38e56..dc934123 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -879,6 +879,8 @@ static Property riscv_cpu_properties[] = { DEFINE_PROP_BOOL("x-aia", RISCVCPU, cfg.aia, false), DEFINE_PROP_UINT64("resetvec", RISCVCPU, cfg.resetvec, DEFAULT_RSTVEC), + + DEFINE_PROP_BOOL("short-isa-string", RISCVCPU, cfg.short_isa_string, false), DEFINE_PROP_END_OF_LIST(), }; @@ -1049,7 +1051,9 @@ char *riscv_isa_string(RISCVCPU *cpu) } } *p = '\0'; - riscv_isa_string_ext(cpu, &isa_str, maxlen); + if (!cpu->cfg.short_isa_string) { + riscv_isa_string_ext(cpu, &isa_str, maxlen); + } return isa_str; } diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index fe6c9a2..f5ff729 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -425,6 +425,8 @@ struct RISCVCPUConfig { bool aia; bool debug; uint64_t resetvec; + + bool short_isa_string; }; typedef struct RISCVCPUConfig RISCVCPUConfig; |