mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
target/riscv: Fix checks in hmode/hmode32
Add check for the implicit dependence between H and S Csrs only existed in RV32 will not trigger virtual instruction fault when not in RV32 based on section 8.6.1 of riscv-privileged spec (draft-20220717) Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn> Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20220718130955.11899-6-liweiwei@iscas.ac.cn> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
c126f83cd6
commit
62a09b9b41
2 changed files with 7 additions and 7 deletions
|
@ -733,6 +733,11 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
|
|||
return;
|
||||
}
|
||||
|
||||
if (cpu->cfg.ext_h && !cpu->cfg.ext_s) {
|
||||
error_setg(errp, "H extension implicitly requires S-mode");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cpu->cfg.ext_f && !cpu->cfg.ext_icsr) {
|
||||
error_setg(errp, "F extension requires Zicsr");
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue