Re: [patch v3 1/7] x86/smp: Make stop_other_cpus() more robust

From: Ashok Raj
Date: Mon Jun 19 2023 - 13:51:54 EST


On Fri, Jun 16, 2023 at 01:57:59PM -0700, Ashok Raj wrote:
> On Fri, Jun 16, 2023 at 08:01:56PM +0200, Thomas Gleixner wrote:
> > On Fri, Jun 16 2023 at 07:13, Ashok Raj wrote:
> > > On Fri, Jun 16, 2023 at 09:53:25AM +0200, Thomas Gleixner wrote:
> > >> > can we simplify this by just apic->send_IPI(cpu, NMI_VECTOR); ??
> > >>
> > >> That would not set APIC_DM_NMI in delivery mode and the IPI would be
> > >> sent with APIC_DM_FIXED.
> > >
> > > That's correct.
> > >
> > > Maybe if we use apic->send_IPI_mask(cpumask_of(cpu), NMI_VECTOR)
> > >
> > > apic->send_IPI_mask(cpumask_of(cpu),NMI_VECTOR)
> > > __x2apic_send_IPI_mask()
> > > __x2apic_send_IPI_dest()
> > > unsigned long cfg = __prepare_ICR(0, vector, dest);
> > > native_x2apic_icr_write(cfg, apicid);
> > >
> > > __prepare_ICR() seems to have the magic for APIC_DM_NMI?
> >
> > Bah. I clearly neither can read nor can remember any of the internals of
> > that code:
> >
> > apic->send_IPI()
> > x2apic_send_IPI()
> > __x2apic_send_IPI_dest()
> >
> > It also works for all other APIC incarnations.
>
> Works!
>

Forgot to add

Reviewed-by: Ashok Raj <ashok.raj@xxxxxxxxx>