On 13.02.2026 17:28, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/domain.c
> +++ b/xen/arch/riscv/domain.c
> @@ -198,3 +198,34 @@ void vcpu_sync_interrupts(struct vcpu *v)
>  #   error "Update v->arch.vsieh"
>  #endif
>  }
> +
> +static void vcpu_update_hvip(const struct vcpu *v)
> +{
> +    csr_write(CSR_HVIP, v->arch.hvip);
> +}
> +
> +void vcpu_flush_interrupts(struct vcpu *v)
> +{
> +    if ( ACCESS_ONCE(v->arch.irqs_pending_mask[0]) )
> +    {
> +        register_t *hvip = &v->arch.hvip;
> +
> +        unsigned long mask = xchg(&v->arch.irqs_pending_mask[0], 0UL);
> +        unsigned long val = ACCESS_ONCE(v->arch.irqs_pending[0]) & mask;

Nit: As mentioned before, blank lines should not normally occur between
declarations (unless there are overly many of them). With the blank line
removed, personally I think things would end up slightly neater if hvip
was declared last.

> +        *hvip &= ~mask;
> +        *hvip |= val;
> +
> +        vcpu_update_hvip(v);
> +    }
> +
> +/*
> + * Flush AIA high interrupts.
> + *
> + * It is necessary to do only for CONFIG_RISCV_32 which isn't
> + * supported now.
> + */
> +#ifdef CONFIG_RISCV_32

May I suggest for this to move ahead of the comment, and for the comment
to be properly indented by one level?

With the adjustments:
Acked-by: Jan Beulich <[email protected]>

Jan


Reply via email to