From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86/shutdown: mask LVTERR ahead of offlining CPUs
Date: Mon, 23 Sep 2024 13:54:51 +0200 [thread overview]
Message-ID: <b4cddc52-e527-4c1b-90d9-50490363b5c2@suse.com> (raw)
In-Reply-To: <Zu0z2ZO7lwTklq19@macbook.local>
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
prev parent reply other threads:[~2024-09-23 11:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 14:27 [PATCH] x86/shutdown: mask LVTERR ahead of offlining CPUs Roger Pau Monne
2024-09-19 20:19 ` Andrew Cooper
2024-09-20 8:35 ` Roger Pau Monné
2024-09-23 11:54 ` Jan Beulich [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b4cddc52-e527-4c1b-90d9-50490363b5c2@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.