From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [PATCH v2] x86: Fixup IRQs when CPUs go down during shutdown
Date: Wed, 2 Dec 2015 15:09:29 +0000 [thread overview]
Message-ID: <565F09A9.9000408@citrix.com> (raw)
In-Reply-To: <565F081502000078000BB4A1@prv-mh.provo.novell.com>
On 12/02/2015 02:02 PM, Jan Beulich wrote:
>>>> On 02.12.15 at 14:46, <ross.lagerwall@citrix.com> wrote:
>> Commit fc0c3fa2ad5c ("x86/IO-APIC: fix setup of Xen internally used IRQs
>> (take 2)") introduced a regression on some hardware where Xen would hang
>> during shutdown, repeating the following message:
>> APIC error on CPU0: 08(08), Receive accept error
>>
>> This appears to be because an interrupt (in this case from the serial
>> console) destined for a CPU other than the boot CPU is left unhandled so
>> an APIC error on CPU 0 is generated instead.
>>
>> To fix this, before taking down the non-boot CPUs, call fixup_irqs()
>> with a CPU mask of only the boot CPU to reset the IRQ affinities
>> correctly.
>>
>> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
>> ---
>
> Even though in this case interested people may know, missing info
> on changes from previous version here.
>
>> +/* CPU(s) have been removed from mask. Re-set irq affinities. */
>> +void fixup_irqs(const cpumask_t *mask, bool_t verbose)
>
> The comment doesn't match reality. And I wonder whether it
> wouldn't be reasonable to imply "verbose" (either from mask
> equaling &cpu_online_map, or by introducing SYS_STATE_shutdown
> and/or SYS_STATE_reboot).
I considered introducing a new SYS_STATE but decided that a function
parameter was clearer rather than implying it from some other global state.
>
>> @@ -2385,16 +2382,27 @@ void fixup_irqs(void)
>>
>> spin_unlock(&desc->lock);
>>
>> - if ( break_affinity && set_affinity )
>> - printk("Broke affinity for irq %i\n", irq);
>> - else if ( !set_affinity )
>> - printk("Cannot set affinity for irq %i\n", irq);
>> + if ( verbose )
>> + {
>> + if ( break_affinity && set_affinity )
>> + printk("Broke affinity for irq %i\n", irq);
>> + else if ( !set_affinity )
>> + printk("Cannot set affinity for irq %i\n", irq);
>> + }
>
> How about
>
> if ( !verbose )
> continue;
>
> limiting churn on code?
OK.
>
>> --- a/xen/arch/x86/smp.c
>> +++ b/xen/arch/x86/smp.c
>> @@ -286,6 +286,7 @@ void __stop_this_cpu(void)
>>
>> static void stop_this_cpu(void *dummy)
>> {
>> + fixup_eoi();
>> __stop_this_cpu();
>
> Is this really needed during shutdown?
Possibly not, but I think it's cleaner to do the same as what is used
for CPU down.
>
>> @@ -298,6 +299,13 @@ static void stop_this_cpu(void *dummy)
>> void smp_send_stop(void)
>> {
>> int timeout = 10;
>> + cpumask_t online;
>> +
>> + cpumask_clear(&online);
>> + cpumask_set_cpu(smp_processor_id(), &online);
>
> That's what we have cpumask_of() for.
>
OK.
--
Ross Lagerwall
next prev parent reply other threads:[~2015-12-02 15:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-02 13:46 [PATCH v2] x86: Fixup IRQs when CPUs go down during shutdown Ross Lagerwall
2015-12-02 13:53 ` Andrew Cooper
2015-12-02 14:02 ` Jan Beulich
2015-12-02 15:09 ` Ross Lagerwall [this message]
2015-12-02 15:30 ` Jan Beulich
2015-12-04 10:46 ` Andrew Cooper
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=565F09A9.9000408@citrix.com \
--to=ross.lagerwall@citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=xen-devel@lists.xen.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.