Re: [RFC PATCH 21/32] x86/fred: FRED entry/exit and dispatch code

From: Peter Zijlstra
Date: Thu Dec 22 2022 - 08:08:53 EST


On Wed, Dec 21, 2022 at 02:56:08AM +0000, Li, Xin3 wrote:

> > > + if (!(BIT(vector) & noinstr_mask)) {
> > > + state = irqentry_enter(regs);
> > > + instrumentation_begin();
> > > + }
> > > +
> > > + exception_handlers[vector](regs);
> > > +
> > > + if (!(BIT(vector) & noinstr_mask)) {
> > > + instrumentation_end();
> > > + irqentry_exit(regs, state);
> > > + }
> >
> > This noinstr mask is daft; why not have DEFINE_FRED_HANDLER and
> > DEFINE_FRED_HANDLER_RAW or something, have the normal one include the
> > irqentry bits and use the _RAW one for the 'funny' ones that need to do it
> > themselves?
>
> I wanted to keep "state = irqentry_enter(regs); instrumentation_begin();"
> in the dispatch framework, instead of pushing down to the handlers.
>
> Of course, we could do it the other way if it is more preferred.

Yes, please do as I suggested, it is consistent IDTENTRY macros.