aboutsummaryrefslogtreecommitdiff
path: root/hw/misc
diff options
context:
space:
mode:
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>2023-04-06 15:03:32 -0300
committerAlistair Francis <alistair.francis@wdc.com>2023-05-05 10:49:50 +1000
commit1ffa805c9d07bf1059d11a183540a3f07d02ea11 (patch)
tree9ebf8076aa0363211bf8147d684f80ccfc27b74c /hw/misc
parent66247edc8b6fb36d6b905babcd795068ea989ad5 (diff)
downloadqemu-1ffa805c9d07bf1059d11a183540a3f07d02ea11.zip
qemu-1ffa805c9d07bf1059d11a183540a3f07d02ea11.tar.gz
qemu-1ffa805c9d07bf1059d11a183540a3f07d02ea11.tar.bz2
target/riscv: sync env->misa_ext* with cpu->cfg in realize()
When riscv_cpu_realize() starts we're guaranteed to have cpu->cfg.ext_N properties updated. The same can't be said about env->misa_ext*, since the user might enable/disable MISA extensions in the command line, and env->misa_ext* won't caught these changes. The current solution is to sync everything at the end of validate_set_extensions(), checking every cpu->cfg.ext_N value to do a set_misa() in the end. The last change we're making in the MISA cfg flags are in the G extension logic, enabling IMAFG if cpu->cfg_ext.g is enabled. Otherwise we're not making any changes in MISA bits ever since realize() starts. There's no reason to postpone misa_ext updates until the end of the validation. Let's do it earlier, during realize(), in a new helper called riscv_cpu_sync_misa_cfg(). If cpu->cfg.ext_g is enabled, do it again by updating env->misa_ext* directly. This is a pre-requisite to allow riscv_cpu_validate_set_extensions() to use riscv_has_ext() instead of cpu->cfg.ext_N to validate the MISA extensions, which is our end goal here. Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20230406180351.570807-2-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'hw/misc')
0 files changed, 0 insertions, 0 deletions