[PATCH v2 3/3] [NOT-FOR-UPSTREAM] platform: generic: virt: add APLIC M-mode IRQ test overlay
Raymond Mao
raymondmaoca at gmail.com
Mon May 4 10:13:42 PDT 2026
From: Raymond Mao <raymond.mao at riscstar.com>
Stock QEMU virt,aia=aplic delegates all wired IRQs from the M-mode
APLIC to its child S-mode APLIC, which prevents the local
APLIC_QEMU_WIRED_TEST path from exercising M-mode wired IRQ delivery.
Add a DT overlay that changes the M-mode APLIC delegation ranges from
1..96 to 1..9 and 11..96, leaving hwirq 10 local to the M-mode APLIC.
This matches the local test path, which uses UART RX on hwirq 10.
The overlay is intended to be applied on top of a base DTB dumped from
the same QEMU virt,aia=aplic command line, so the embedded child
phandle matches that dumped base DTB.
Usage:
- dump the base DTB from the target QEMU command line
- compile this file as a DT overlay and apply it to the dumped base DTB
- boot QEMU with the merged DTB and APLIC_QEMU_WIRED_TEST=y to verify
M-mode wired IRQ delivery
Signed-off-by: Raymond Mao <raymond.mao at riscstar.com>
---
.../virt/aplic_mmode_wired_irq_test.dts | 28 +++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 platform/generic/virt/aplic_mmode_wired_irq_test.dts
diff --git a/platform/generic/virt/aplic_mmode_wired_irq_test.dts b/platform/generic/virt/aplic_mmode_wired_irq_test.dts
new file mode 100644
index 00000000..8fb976b5
--- /dev/null
+++ b/platform/generic/virt/aplic_mmode_wired_irq_test.dts
@@ -0,0 +1,28 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+ fragment at 0 {
+ target-path = "/soc/interrupt-controller at c000000";
+ __overlay__ {
+ /*
+ * Stock QEMU virt,aia=aplic delegates all wired IRQs from
+ * the M-mode APLIC to its child S-mode APLIC:
+ *
+ * <child-phandle 1 96>
+ *
+ * Keep hwirq 10 local to the M-mode APLIC by delegating
+ * only 1..9 and 11..96 to the child APLIC. This matches
+ * the local OpenSBI APLIC_QEMU_WIRED_TEST path, which
+ * exercises wired IRQ delivery via hwirq 10 (UART RX).
+ *
+ * This overlay is intended to be applied on top of a base
+ * DTB dumped from the same QEMU virt,aia=aplic command
+ * line. The child phandle value below therefore matches
+ * that dumped base DTB.
+ */
+ riscv,delegate = <0x04 0x01 0x09 0x04 0x0b 0x60>;
+ riscv,delegation = <0x04 0x01 0x09 0x04 0x0b 0x60>;
+ };
+ };
+};
--
2.25.1
More information about the opensbi
mailing list