On Wed, 29 Jun 2022 22:47:19 -0500
Scott Cheloha <scottchel...@gmail.com> wrote:

> To be perfectly clear, you are concerned about this scenario:
> 
> > > + if (ci->ci_dec_deferred && newcpl < IPL_CLOCK) {
> > > +         ppc_mtdec(0);
> 
>       /* DEC interrupt fires *here*. */
>       /* We jump to decrint() and then call decr_intr(). */
> 
> > > +         ppc_mtdec(UINT32_MAX);  /* raise DEC exception */
> > > + }
> 
> I think it's possible for the DEC exception to occur in that spot.
> However, external/DEC *interrupts* are explicitly disabled, so I don't
> think that we will jump to decrint() until the next time we do
> 
>       ppc_intr_enable(1);

I missed the ppc_intr_disable(), which disables PSL_EE, in
macintr_splx and openpic_splx.  You are correct, it can't call
decr_intr until ppc_intr_enable(1).

ppc_dflt_splx also looks good, because we don't enable PSL_EE until
we switch to macintr_splx or openpic_splx.

> > Would this be better?
> > 
> >     ppc_mtdec(1 >> UINT32_MAX);
> >     ppc_mtdec(UINT32_MAX);
> 
> I assume you meant to type
> 
>       ppc_mtdec(UINT32_MAX >> 1);

Yes, I meant UINT32_MAX >> 1, but you have persuaded me that the
existing ppc_mtdec(0) is correct, and no change is necessary.  I
will continue running your diff with ppc_mtdec(0).

Reply via email to