Skip to content

Commit 38facfa

Browse files
danielhbalistair23
authored andcommitted
hw/riscv/virt.c: re-insert and deprecate 'riscv,delegate'
Commit b1f1e9d renamed 'riscv,delegate' to 'riscv,delegation' since it is the correct name as per dt-bindings, and the absence of the correct name will result in validation fails when dumping the dtb and using dt-validate. But this change has a side-effect: every other firmware available that is AIA capable is using 'riscv,delegate', and it will fault/misbehave if this property isn't present. The property was added back in QEMU 7.0, meaning we have 2 years of firmware development using the wrong property. Re-introducing 'riscv,delegate' while keeping 'riscv,delegation' allows older firmwares to keep booting with the 'virt' machine. 'riscv,delegate' is then marked for future deprecation with its use being discouraged from now on. Cc: Conor Dooley <conor@kernel.org> Cc: Anup Patel <apatel@ventanamicro.com> Fixes: b1f1e9d ("hw/riscv/virt.c: aplic DT: rename prop to 'riscv, delegation'") Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20240715090455.145888-1-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
1 parent 38c83e8 commit 38facfa

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/about/deprecated.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,17 @@ versions, aliases will point to newer CPU model versions
479479
depending on the machine type, so management software must
480480
resolve CPU model aliases before starting a virtual machine.
481481

482+
RISC-V "virt" board "riscv,delegate" DT property (since 9.1)
483+
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
484+
485+
The "riscv,delegate" DT property was added in QEMU 7.0 as part of
486+
the AIA APLIC support. The property changed name during the review
487+
process in Linux and the correct name ended up being
488+
"riscv,delegation". Changing the DT property name will break all
489+
available firmwares that are using the current (wrong) name. The
490+
property is kept as is in 9.1, together with "riscv,delegation", to
491+
give more time for firmware developers to change their code.
492+
482493
Migration
483494
---------
484495

hw/riscv/virt.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,15 @@ static void create_fdt_one_aplic(RISCVVirtState *s, int socket,
651651
qemu_fdt_setprop_cells(ms->fdt, aplic_name, "riscv,delegation",
652652
aplic_child_phandle, 0x1,
653653
VIRT_IRQCHIP_NUM_SOURCES);
654+
/*
655+
* DEPRECATED_9.1: Compat property kept temporarily
656+
* to allow old firmwares to work with AIA. Do *not*
657+
* use 'riscv,delegate' in new code: use
658+
* 'riscv,delegation' instead.
659+
*/
660+
qemu_fdt_setprop_cells(ms->fdt, aplic_name, "riscv,delegate",
661+
aplic_child_phandle, 0x1,
662+
VIRT_IRQCHIP_NUM_SOURCES);
654663
}
655664

656665
riscv_socket_fdt_write_id(ms, aplic_name, socket);

0 commit comments

Comments
 (0)