From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: Question about Xen reboot on panic Date: Thu, 12 Nov 2015 10:08:00 -0700 Message-ID: <5644D58002000078000B469D@prv-mh.provo.novell.com> References: <5643C716.1050102@citrix.com> <5643D091.7090503@citrix.com> <56448BA8.6080705@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Meng Xu Cc: Andrew Cooper , Wei Liu , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org >>> On 12.11.15 at 17:57, 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