[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 27/39] xen/riscv: introduce arch_move_irqs()



On 27.08.2026 17:21, Oleksii Kurochko wrote:
> When migrating a vCPU between pCPUs the hypervisor must also migrate
> the associated virtual interrupt state. arch_move_irqs() is the
> per-arch hook called by generic code to trigger that.
> 
> Replace the static inline BUG_ON placeholder in asm/irq.h with a real
> implementation in intc.c dispatching through a new move_irqs vintc_ops
> callback. Wire it up in vAPLIC, which delegates to imsic_migrate_vcpu()
> which itself still a stub to be implemented in follow-up patches.
> 
> Note that technically ASSERT() in arch_move_irqs() could be skipped as
> it will be anyway NULL pointer dereference (and a trap will occur) if
> something isn't properly initialized but sometimes it is harder to
> find place where NULL pointer derefence happened as it isn't
> guaraunted that all necessary registers will be filled with something
> useful.
> As at the moment I don't find any case when ->move_irqs() could be
> skipped, the check that ->move_irq isn't NULL is added to ASSERT()
> instead of adding "if ( ...->move_irq) vitnc->ops->move_irqs(v)".

All of these two paragraphs look stale / inapllicable; ...

> --- a/xen/arch/riscv/intc.c
> +++ b/xen/arch/riscv/intc.c
> @@ -192,3 +192,11 @@ void vintc_ctxt_switch_to(struct vcpu *v)
>  
>      ops->ctxt_switch_to(v);
>  }
> +
> +/* Move vCPU's IRQs from one pCPU to another */
> +void arch_move_irqs(struct vcpu *v)
> +{
> +    const struct vintc_ops *ops = v->domain->arch.vintc->ops;
> +
> +    ops->move_irqs(v);
> +}

There's no ASSERT() here (and I'd prefer if none was added). With the
description pruned:
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.