From: Raymond Mao <raymondmaoca@gmail.com>
To: opensbi@lists.infradead.org
Cc: scott@riscstar.com, dave.patel@riscstar.com,
raymond.mao@riscstar.com, robin.randhawa@sifive.com,
samuel.holland@sifive.com, anup.patel@qti.qualcomm.com,
anuppate@qti.qualcomm.com, anup@brainfault.org,
dhaval@rivosinc.com, peter.lin@sifive.com
Subject: [PATCH 00/10] Introduce Virtual IRQ (VIRQ) framework
Date: Thu, 14 May 2026 18:57:46 -0400 [thread overview]
Message-ID: <20260514225756.2255758-1-raymondmaoca@gmail.com> (raw)
From: Raymond Mao <raymond.mao@riscstar.com>
This series introduces a Virtual IRQ (VIRQ) framework for OpenSBI to
support domain-aware wired interrupt couriering.
The main use case is to let OpenSBI receive a host HWIRQ in M-mode,
map it into a per-channel VIRQ number space, route it to a target
domain, notify the target S-mode payload, and let that payload
pop/complete the pending VIRQ through an SBI ecall interface.
The implementation is organized as follows:
- add irqchip helpers for S-mode pending notification
- extend domain context switching to support VIRQ-driven
cross-domain couriering and return-to-previous-domain flow
- add the core VIRQ mapping, routing, and per-(domain,hart)
pending queue framework
- add a VIRQ vendor ecall extension for POP and COMPLETE
- parse sysirq routing rules from DT under /chosen/opensbi-domains
- derive APLIC target hart routing from sysirq nodes
- update the irqchip/APLIC path to support deferred completion and
per-HWIRQ APLIC targets
- document the DT binding and routing rules
The DT routing model is based on "opensbi,mpxy-sysirq" nodes.
Each interrupts-extended entry contributes one routed physical source,
its entry index becomes the VIRQ number within the selected
opensbi,mpxy-channel-id, and opensbi,domain selects the destination
OpenSBI domain.
This series depends on a previous patch set:
[PATCH v2 1/3] lib: utils: irqchip: implement APLIC hwirq operation hooks
https://lore.kernel.org/opensbi/20260504171342.1655882-1-raymondmaoca@gmail.com/#t
Raymond Mao (10):
lib: irqchip: add S-mode notification helpers
lib: sbi: domain: adaptation for supporting VIRQ couriering domain
context switch
lib: sbi: Add Virtual IRQ (VIRQ) subsystem
lib: sbi: Add VIRQ ecall extension
lib: sbi: domain: add domain lookup by name
lib: utils: fdt: parse sysirq routing from DT
lib: utils: irqchip: derive APLIC targets from sysirq nodes
lib: irqchip: support deferred completion and per-HWIRQ APLIC targets
lib: sbi: domain: ensure boot_hartid is assigned
docs: domain: document sysirq VIRQ mapping and routing rules
docs/domain_support.md | 63 ++
include/sbi/sbi_domain.h | 7 +
include/sbi/sbi_domain_context.h | 24 +
include/sbi/sbi_ecall_interface.h | 26 +
include/sbi/sbi_irqchip.h | 24 +
include/sbi/sbi_virq.h | 492 +++++++++++
include/sbi_utils/fdt/fdt_helper.h | 17 +
include/sbi_utils/irqchip/aplic.h | 1 +
lib/sbi/Kconfig | 10 +
lib/sbi/objects.mk | 4 +
lib/sbi/sbi_domain.c | 49 ++
lib/sbi/sbi_domain_context.c | 152 +++-
lib/sbi/sbi_ecall_virq.c | 56 ++
lib/sbi/sbi_irqchip.c | 39 +-
lib/sbi/sbi_trap.c | 16 +
lib/sbi/sbi_virq.c | 1136 +++++++++++++++++++++++++
lib/utils/fdt/fdt_domain.c | 119 ++-
lib/utils/fdt/fdt_helper.c | 49 ++
lib/utils/irqchip/aplic.c | 60 +-
lib/utils/irqchip/fdt_irqchip_aplic.c | 103 +++
20 files changed, 2429 insertions(+), 18 deletions(-)
create mode 100644 include/sbi/sbi_virq.h
create mode 100644 lib/sbi/sbi_ecall_virq.c
create mode 100644 lib/sbi/sbi_virq.c
--
2.25.1
--
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
next reply other threads:[~2026-05-14 22:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 22:57 Raymond Mao [this message]
2026-05-14 22:57 ` [PATCH 01/10] lib: irqchip: add S-mode notification helpers Raymond Mao
2026-05-14 22:57 ` [PATCH 02/10] lib: sbi: domain: adaptation for supporting VIRQ couriering domain context switch Raymond Mao
2026-05-14 22:57 ` [PATCH 03/10] lib: sbi: Add Virtual IRQ (VIRQ) subsystem Raymond Mao
2026-05-14 22:57 ` [PATCH 04/10] lib: sbi: Add VIRQ ecall extension Raymond Mao
2026-05-14 22:57 ` [PATCH 05/10] lib: sbi: domain: add domain lookup by name Raymond Mao
2026-05-14 22:57 ` [PATCH 06/10] lib: utils: fdt: parse sysirq routing from DT Raymond Mao
2026-05-14 22:57 ` [PATCH 07/10] lib: utils: irqchip: derive APLIC targets from sysirq nodes Raymond Mao
2026-05-14 22:57 ` [PATCH 08/10] lib: irqchip: support deferred completion and per-HWIRQ APLIC targets Raymond Mao
2026-05-14 22:57 ` [PATCH 09/10] lib: sbi: domain: ensure boot_hartid is assigned Raymond Mao
2026-05-14 22:57 ` [PATCH 10/10] docs: domain: document sysirq VIRQ mapping and routing rules Raymond Mao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260514225756.2255758-1-raymondmaoca@gmail.com \
--to=raymondmaoca@gmail.com \
--cc=anup.patel@qti.qualcomm.com \
--cc=anup@brainfault.org \
--cc=anuppate@qti.qualcomm.com \
--cc=dave.patel@riscstar.com \
--cc=dhaval@rivosinc.com \
--cc=opensbi@lists.infradead.org \
--cc=peter.lin@sifive.com \
--cc=raymond.mao@riscstar.com \
--cc=robin.randhawa@sifive.com \
--cc=samuel.holland@sifive.com \
--cc=scott@riscstar.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox