target/riscv: Require either I or E base extension

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
Alistair Francis 2019-06-17 18:31:16 -07:00 committed by Palmer Dabbelt
parent a101b643c2
commit bdddd44635
No known key found for this signature in database
GPG Key ID: EF4CA1502CCBAB41
1 changed files with 6 additions and 0 deletions

View File

@ -373,6 +373,12 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
return;
}
if (!cpu->cfg.ext_i && !cpu->cfg.ext_e) {
error_setg(errp,
"Either I or E extension must be set");
return;
}
if (cpu->cfg.ext_g && !(cpu->cfg.ext_i & cpu->cfg.ext_m &
cpu->cfg.ext_a & cpu->cfg.ext_f &
cpu->cfg.ext_d)) {