On 05.06.2025 17:59, Oleksii Kurochko wrote: > Introduce support for IRQ setup on RISC-V by implementing setup_irq() and > __setup_irq(), adapted and extended from an initial implementation by [1]. > > __setup_irq() does the following: > - Sets up an IRQ action. > - Validates that shared IRQs have non-NULL `dev_id` and are only used when > existing handlers allow sharing. > - Uses smp_wmb() to enforce memory ordering after assigning desc->action > to ensure visibility before enabling the IRQ. > - Supports multi-action setups via CONFIG_IRQ_HAS_MULTIPLE_ACTION. > > setup_irq() does the following: > - Converts IRQ number to descriptor and acquires its lock. > - Rejects registration if the IRQ is already assigned to a guest domain, > printing an error. > - Delegates the core setup to __setup_irq(). > - On first-time setup, disables the IRQ, routes it to Xen using > intc_route_irq_to_xen(), sets default CPU affinity (current CPU), > calls the handler’s startup routine, and finally enables the IRQ. > > irq_set_affinity() invokes set_affinity() callback from the IRQ handler > if present. > > Defined IRQ_NO_PRIORITY as default priority used when routing IRQs to Xen. > > [1] > https://gitlab.com/xen-project/people/olkur/xen/-/commit/7390e2365828b83e27ead56b03114a56e3699dd5 > > Co-developed-by: Romain Caritey <romain.cari...@microchip.com> > Signed-off-by: Oleksii Kurochko <oleksii.kuroc...@gmail.com>
Acked-by: Jan Beulich <jbeul...@suse.com>