All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Meng Xu <xumengpanda@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Question about Xen reboot on panic
Date: Thu, 12 Nov 2015 10:08:00 -0700	[thread overview]
Message-ID: <5644D58002000078000B469D@prv-mh.provo.novell.com> (raw)
In-Reply-To: <CAENZ-+nA9cavdBbaN-YSwjaKN7b=RkjTR-5TwDTZR0JF7WV3hQ@mail.gmail.com>

>>> On 12.11.15 at 17:57, <xumengpanda@gmail.com> wrote:
>> After looking into the code, I found the following code in the
>> machine_restart(), which is quite suspicious.
>>
>>     if ( system_state >= SYS_STATE_smp_boot )
>>
>>     {
>>
>>         local_irq_enable();
>>
>>
>>         /* Ensure we are the boot CPU. */
>>
>>         if ( get_apic_id() != boot_cpu_physical_apicid )
> 
> If we are at the boot CPU and the if statement return true
> 
>>
>>         {
>>
>>             /* Send IPI to the boot CPU (logical cpu 0). */
>>
>>             on_selected_cpus(cpumask_of(0), __machine_restart,
>>
>>                              &delay_millisecs, 0);
> 
> we will send an IPI from CPU 0 to CPU to run machine_restart.

The other way around you mean.

>>
>>             for ( ; ; )
>>
>>                 halt();
> 
> and CPU 0 will halt immediately.
> 
> If the IPI arrives later on CPU 0, CPU 0 won't be able to handle it,
> since it has been halted.

It's CPUn that gets halted, not CPU0. This ...

> (XEN) On P0
> As this line suggests, P0 sends P0 an IPI and P0 goes to halt immediately...

... is suspicious: Is boot_cpu_physical_apicid not set correctly?
Or is get_apic_id() returning rubbish?

Jan

  reply	other threads:[~2015-11-12 17:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 22:49 Question about Xen reboot on panic Meng Xu
2015-11-11 22:54 ` Andrew Cooper
2015-11-11 23:21   ` Meng Xu
2015-11-11 23:34     ` Andrew Cooper
2015-11-12  2:10       ` Meng Xu
2015-11-12 12:52         ` Andrew Cooper
2015-11-12 12:57           ` Wei Liu
2015-11-12 13:16             ` Ian Campbell
2015-11-12 15:09               ` Meng Xu
2015-11-12 15:07           ` Meng Xu
2015-11-12 16:13             ` Meng Xu
2015-11-12 16:57               ` Meng Xu
2015-11-12 17:08                 ` Jan Beulich [this message]
2015-11-12 19:54                   ` Meng Xu
2015-11-13  7:39                     ` Jan Beulich
2015-11-19  3:58                       ` Meng Xu
2015-11-19  7:26                         ` Jan Beulich

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=5644D58002000078000B469D@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xumengpanda@gmail.com \
    /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.