aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>2023-12-18 09:53:13 -0300
committerAlistair Francis <alistair.francis@wdc.com>2024-01-10 18:47:47 +1000
commitcc2bf69a36e05e22a1dca9bf6305ef5e0cad993e (patch)
tree3ff225d5214f6a84608f14dd6cdc90fb87bbac9e /hw
parentd379c748a30dce4bc6114111a5d6c0acec9c05a7 (diff)
downloadqemu-cc2bf69a36e05e22a1dca9bf6305ef5e0cad993e.zip
qemu-cc2bf69a36e05e22a1dca9bf6305ef5e0cad993e.tar.gz
qemu-cc2bf69a36e05e22a1dca9bf6305ef5e0cad993e.tar.bz2
target/riscv: add zicbop extension flag
QEMU already implements zicbom (Cache Block Management Operations) and zicboz (Cache Block Zero Operations). Commit 59cb29d6a5 ("target/riscv: add Zicbop cbo.prefetch{i, r, m} placeholder") added placeholders for what would be the instructions for zicbop (Cache Block Prefetch Operations), which are now no-ops. The RVA22U64 profile mandates zicbop, which means that applications that run with this profile might expect zicbop to be present in the riscv,isa DT and might behave badly if it's absent. Adding zicbop as an extension will make our future RVA22U64 implementation more in line with what userspace expects and, if/when cache block prefetch operations became relevant to QEMU, we already have the extension flag to turn then on/off as needed. Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20231218125334.37184-6-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/riscv/virt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 4194ddc..f9fd134 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -250,6 +250,11 @@ static void create_fdt_socket_cpus(RISCVVirtState *s, int socket,
cpu_ptr->cfg.cboz_blocksize);
}
+ if (cpu_ptr->cfg.ext_zicbop) {
+ qemu_fdt_setprop_cell(ms->fdt, cpu_name, "riscv,cbop-block-size",
+ cpu_ptr->cfg.cbop_blocksize);
+ }
+
qemu_fdt_setprop_string(ms->fdt, cpu_name, "compatible", "riscv");
qemu_fdt_setprop_string(ms->fdt, cpu_name, "status", "okay");
qemu_fdt_setprop_cell(ms->fdt, cpu_name, "reg",