On Fri, 2025-05-16 at 10:05 +1000, Nicholas Piggin wrote:
> On Mon May 12, 2025 at 1:10 PM AEST, Nicholas Piggin wrote:
> > From: Glenn Miles <mil...@linux.vnet.ibm.com>
> > 
> > Add support for XIVE ESB Interrupt Escalation.
> > 
> > Suggested-by: Michael Kowal <ko...@linux.ibm.com>
> > [This change was taken from a patch provided by Michael Kowal.]
> > Signed-off-by: Glenn Miles <mil...@linux.vnet.ibm.com>
> > ---
> >  hw/intc/xive2.c             | 62 ++++++++++++++++++++++++++++++-------
> >  include/hw/ppc/xive2.h      |  1 +
> >  include/hw/ppc/xive2_regs.h | 13 +++++---
> >  3 files changed, 59 insertions(+), 17 deletions(-)
> > 
> > diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c
> > index de139dcfbf..0993e792cc 100644
> > --- a/hw/intc/xive2.c
> > +++ b/hw/intc/xive2.c
> > @@ -1552,18 +1552,39 @@ do_escalation:
> >          }
> >      }
> >  
> > -    /*
> > -     * The END trigger becomes an Escalation trigger
> > -     */
> > -    xive2_router_end_notify(xrtr,
> > -                           xive_get_field32(END2_W4_END_BLOCK,     end.w4),
> > -                           xive_get_field32(END2_W4_ESC_END_INDEX, end.w4),
> > -                           xive_get_field32(END2_W5_ESC_END_DATA,  
> > end.w5));
> > +    if (xive2_end_is_escalate_end(&end)) {
> > +        /*
> > +         * Perform END Adaptive escalation processing
> > +         * The END trigger becomes an Escalation trigger
> > +         */
> > +        xive2_router_end_notify(xrtr,
> > +                               xive_get_field32(END2_W4_END_BLOCK,     
> > end.w4),
> > +                               xive_get_field32(END2_W4_ESC_END_INDEX, 
> > end.w4),
> > +                               xive_get_field32(END2_W5_ESC_END_DATA,  
> > end.w5));
> > +    } /* end END adaptive escalation */
> > +
> > +    else {
> > +        uint32_t lisn;              /* Logical Interrupt Source Number */
> > +
> > +        /*
> > +         *  Perform ESB escalation processing
> > +         *      E[N] == 1 --> N
> > +         *      Req[Block] <- E[ESB_Block]
> > +         *      Req[Index] <- E[ESB_Index]
> > +         *      Req[Offset] <- 0x000
> > +         *      Execute <ESB Store> Req command
> > +         */
> > +        lisn = XIVE_EAS(xive_get_field32(END2_W4_END_BLOCK,     end.w4),
> > +                        xive_get_field32(END2_W4_ESC_END_INDEX, end.w4));
> > +
> > +        xive2_notify(xrtr, lisn, true /* pq_checked */);
> 
> Sorry I forgot to squash in a fix for the issues here. These should be
> _ESB_ constants not _END_, and we believe pq_checked should be false
> here so the ESB state machine is run.
> 
> https://lore.kernel.org/qemu-devel/d8cfk7z5ajf8.alt8mmh6e...@gmail.com/
> 
> I think we took discussion offline after that but that was the
> conclusion. I will sqash that fix in here. With that,
> 
> Reviewed-by: Nicholas Piggin <npig...@gmail.com>
> 
> I also wonder if Mike should be author of this patch since
> that's what the note indicates? Or co-author? Better give your
> Signed-off-by too, if so.
> 
> Thanks,
> Nick

Yes, this commit was taken verbatim from a diff that Mike Kowal
provided me.  I think he certainly deserves the credit.  I wasn't sure
how to do that.

Glenn


Reply via email to