Re: [PATCH v2 21/22] irqchip/gic-v5: Add GICv5 IWB support

Lorenzo Pieralisi
2025-05-02T08:04:35Z

On Thu, May 01, 2025 at 03:15:46PM +0100, Marc Zyngier wrote:

[...]

> > If we are, we use the msi_alloc_info_t->hwirq to define the LPI eventid,
> > basically the IWB wire, if not we just allocate an eventid available from
> > the device bitmap.
> >
> > Other than that (and being forced to provide an IWB irqchip.irq_write_msi_msg()
> > pointer even if the IWB can't write anything otherwise we dereference
> > NULL) this works.
>
> Not even MBIGEN allows you to change the event. If you really want to
> ensure things are even tighter, invent a MSI_FLAG_HARDCODED_MSG flag,
> and pass that down the prepare path.

I tried to set a new alloc flag in the IWB msi_domain_template.ops.set_desc()
callback and it works.

It can be set in the IWB driver (and does not change anything else),
it works so happy days.

> > Is there a better way to implement this ? I would post this code with
> > v3 but instead of waiting I thought I could inline it here, feel free
> > to ignore it (or flame me if it is a solved problem I failed to spot,
> > we need to find a way for the IWB driver to pass the "fixed event" info
> > to the ITS - IWB eventIDs are hardwired it is not like the MBIgen where
> > the irq_write_msi_msg() callback programs the wire-to-eventid
> > translation in HW).
>
> It's *exactly* the same. And see above for a potential explicit
> solution. The empty irq_write_msi_msg() is not a problem. It's
> actually pretty clean, given how the whole thing works.
>
> Please fold this into your v3, and we'll take it from there.

I will with the new alloc flag above, thanks.

Lorenzo