* [PATCH v2 1/1] hw/riscv/virt.c: add cbo[mz]-block-size fdt properties
2023-03-02 9:14 [PATCH v2 0/1] hw/riscv/virt.c: add cbo[mz]-block-size fdt properties Daniel Henrique Barboza
@ 2023-03-02 9:14 ` Daniel Henrique Barboza
2023-03-02 9:57 ` Bin Meng
2023-03-05 20:39 ` [PATCH v2 0/1] " Palmer Dabbelt
1 sibling, 1 reply; 4+ messages in thread
From: Daniel Henrique Barboza @ 2023-03-02 9:14 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-riscv, alistair.francis, bmeng, liweiwei, zhiwei_liu,
Daniel Henrique Barboza, Ben Dooks, Anup Patel, Andrew Jones
From: Anup Patel <apatel@ventanamicro.com>
The cbom-block-size fdt property property is used to inform the OS about
the blocksize in bytes for the Zicbom cache operations. Linux documents
it in Documentation/devicetree/bindings/riscv/cpus.yaml
as:
riscv,cbom-block-size:
$ref: /schemas/types.yaml#/definitions/uint32
description:
The blocksize in bytes for the Zicbom cache operations.
cboz-block-size has the same role but for the Zicboz extension, i.e.
informs the size in bytes for Zicboz cache operations. Linux support
for it is under review/approval in [1]. Patch 3 of that series describes
cboz-block-size as:
riscv,cboz-block-size:
$ref: /schemas/types.yaml#/definitions/uint32
description:
The blocksize in bytes for the Zicboz cache operations.
[1] https://lore.kernel.org/all/20230224162631.405473-1-ajones@ventanamicro.com/
Cc: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
---
hw/riscv/virt.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 49acb57da4..3799fab9e5 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -244,6 +244,17 @@ static void create_fdt_socket_cpus(RISCVVirtState *s, int socket,
name = riscv_isa_string(cpu_ptr);
qemu_fdt_setprop_string(ms->fdt, cpu_name, "riscv,isa", name);
g_free(name);
+
+ if (cpu_ptr->cfg.ext_icbom) {
+ qemu_fdt_setprop_cell(ms->fdt, cpu_name, "riscv,cbom-block-size",
+ cpu_ptr->cfg.cbom_blocksize);
+ }
+
+ if (cpu_ptr->cfg.ext_icboz) {
+ qemu_fdt_setprop_cell(ms->fdt, cpu_name, "riscv,cboz-block-size",
+ cpu_ptr->cfg.cboz_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",
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/1] hw/riscv/virt.c: add cbo[mz]-block-size fdt properties
2023-03-02 9:14 [PATCH v2 0/1] hw/riscv/virt.c: add cbo[mz]-block-size fdt properties Daniel Henrique Barboza
2023-03-02 9:14 ` [PATCH v2 1/1] " Daniel Henrique Barboza
@ 2023-03-05 20:39 ` Palmer Dabbelt
1 sibling, 0 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2023-03-05 20:39 UTC (permalink / raw)
To: dbarboza
Cc: qemu-devel, qemu-riscv, Alistair Francis, bmeng, liweiwei,
zhiwei_liu, dbarboza, ben.dooks
On Thu, 02 Mar 2023 01:14:05 PST (-0800), dbarboza@ventanamicro.com wrote:
> Based-on: 20230224132536.552293-1-dbarboza@ventanamicro.com
> ("[PATCH v8 0/4] riscv: Add support for Zicbo[m,z,p] instructions")
>
> Hi,
>
> This second version, which is still dependent on:
>
> [PATCH v8 0/4] riscv: Add support for Zicbo[m,z,p] instructions
>
> Is adding the cboz FDT property as well as requested by Ben Dooks. First
> version refrain from adding it since it's still under review in the
> kernel but, given that we have cboz_blocksize already available, it
> makes sense to also expose it like we're already doing for
> cbom-block-size.
>
> Changes from v1:
> - also add riscv,cboz-block-size for Zicboz
> - v1 link: https://lists.gnu.org/archive/html/qemu-devel/2023-03/msg00368.html
>
> Cc: Ben Dooks <ben.dooks@codethink.co.uk>
>
> Anup Patel (1):
> hw/riscv/virt.c: add cbo[mz]-block-size fdt properties
>
> hw/riscv/virt.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
Thanks, this is in the queue.
^ permalink raw reply [flat|nested] 4+ messages in thread