On 20.09.2024 10:35, Roger Pau Monné wrote:
> On Thu, Sep 19, 2024 at 10:19:49PM +0200, Andrew Cooper wrote:
>> On 19/09/2024 4:27 pm, Roger Pau Monne wrote:
>>> @@ -364,6 +369,18 @@ void smp_send_stop(void)
>>>          fixup_irqs(cpumask_of(cpu), 0);
>>>          local_irq_enable();
>>>  
>>> +        /*
>>> +         * Mask the local APIC error vector ahead of stopping CPUs.
>>> +         *
>>> +         * On AMD the local APIC will report Receive Accept Errors if the
>>> +         * destination APIC ID of an interrupt message is not online.  
>>> There's
>>> +         * no guarantee that fixup_irqs() will evacuate all interrupts -
>>> +         * possibly because the sole CPU remaining online doesn't have 
>>> enough
>>> +         * vectors to accommodate all.
>>> +         */
>>> +        smp_call_function(mask_lvterr, NULL, true);
>>> +        mask_lvterr(NULL);
>>> +
>>>          smp_call_function(stop_this_cpu, NULL, 0);
>>
>> Irrespective of the question over approach, stop_this_cpu() should end
>> up clearing LVTERR.  Why doesn't that suffice?
> 
> No, because those are no ordered.  The sequence needs to strictly be:
> 
>  - Mask LVTERR on all CPUs.
>  <wait for masking to be done uniformly>
>  - Stop CPUs.
> 
> Otherwise CPUs might be stopped before LVTERR has been uniformly
> masked, leading to Receive accept error reported on the CPUs that
> don't yet have LVTERR masked.

Yet fixup_irqs() has moved everything to CPU0. Nothing should go to any of
the APs anymore. Fiddling with LVTERR here feels like curing a symptom
rather than the root cause.

Jan

Reply via email to