All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
	x86@kernel.org, mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com,
	len.brown@intel.com, fenghua.yu@intel.com, vgoyal@redhat.com,
	grant.likely@secretlab.ca, rob.herring@calxeda.com
Subject: Re: [PATCH v1 2/2] x86, apic: Disable BSP if boot cpu is AP
Date: Mon, 22 Oct 2012 13:04:18 -0700	[thread overview]
Message-ID: <873916i88t.fsf@xmission.com> (raw)
In-Reply-To: <20121016043528.20003.601.stgit@localhost6.localdomain6> (HATAYAMA Daisuke's message of "Tue, 16 Oct 2012 13:35:28 +0900")

HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> writes:

> We disable BSP if boot cpu is AP.
>
> INIT-INIT-SIPI sequence, a protocal to initiate AP, cannot be used for
> BSP since it causes BSP jump to BIOS init code; typical visible
> behaviour is hang or immediate reset, depending on the BIOS init code.
>
> INIT can be used to reset AP in a fatal system error state as
> described in MP spec 3.7.3 Processor-specific INIT. In contrast, there
> is no processor-specific INIT for BSP to initilize from a fatal system
> error. It might be possible to do so by NMI plus any hand-crafted
> reset code that is carefully designed, but at least I have no idea in
> this direction now.

Has anyone looked at clearing bit 8 of the IA32_APIC_BASE_MSR (0x1B) on
the bootstrap processor?  Bit 8 being the bit that indicates we are a
bootstrap processor.

If we can clear that bit INIT will always place the processor in
wait-for-startup-ipi mode and we won't have this problem.

That would also solve the hotunplug the bootstrap processor without
using an NMI as well.



If clearing bit 8 doesn't work and we have to go with a variant of
magically detecting the bootstrap processor.  I would make the logic.

1. Test bit 8 to see if we are on the bootstrap processor.
2. If we are not on the bootstrap processor and we don't have a table
   that will tell us guess that the bootstrap processor has apic id 0.

   It is so overwhelmingly common that the bootstrap processor has apic
   id 0 that any other assumption is silly.

More important is testing to see if we are on the bootstrap processor
and if we are not disabling any cpus in that case.  As that will
guarantee that introducing code to not start the bootstrap processor
won't cause a regression outside of the kexec on panic case.

Eric

WARNING: multiple messages have this Message-ID (diff)
From: ebiederm@xmission.com (Eric W. Biederman)
To: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: len.brown@intel.com, fenghua.yu@intel.com, x86@kernel.org,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	rob.herring@calxeda.com, grant.likely@secretlab.ca,
	hpa@zytor.com, mingo@elte.hu, tglx@linutronix.de,
	vgoyal@redhat.com
Subject: Re: [PATCH v1 2/2] x86, apic: Disable BSP if boot cpu is AP
Date: Mon, 22 Oct 2012 13:04:18 -0700	[thread overview]
Message-ID: <873916i88t.fsf@xmission.com> (raw)
In-Reply-To: <20121016043528.20003.601.stgit@localhost6.localdomain6> (HATAYAMA Daisuke's message of "Tue, 16 Oct 2012 13:35:28 +0900")

HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> writes:

> We disable BSP if boot cpu is AP.
>
> INIT-INIT-SIPI sequence, a protocal to initiate AP, cannot be used for
> BSP since it causes BSP jump to BIOS init code; typical visible
> behaviour is hang or immediate reset, depending on the BIOS init code.
>
> INIT can be used to reset AP in a fatal system error state as
> described in MP spec 3.7.3 Processor-specific INIT. In contrast, there
> is no processor-specific INIT for BSP to initilize from a fatal system
> error. It might be possible to do so by NMI plus any hand-crafted
> reset code that is carefully designed, but at least I have no idea in
> this direction now.

Has anyone looked at clearing bit 8 of the IA32_APIC_BASE_MSR (0x1B) on
the bootstrap processor?  Bit 8 being the bit that indicates we are a
bootstrap processor.

If we can clear that bit INIT will always place the processor in
wait-for-startup-ipi mode and we won't have this problem.

That would also solve the hotunplug the bootstrap processor without
using an NMI as well.



If clearing bit 8 doesn't work and we have to go with a variant of
magically detecting the bootstrap processor.  I would make the logic.

1. Test bit 8 to see if we are on the bootstrap processor.
2. If we are not on the bootstrap processor and we don't have a table
   that will tell us guess that the bootstrap processor has apic id 0.

   It is so overwhelmingly common that the bootstrap processor has apic
   id 0 that any other assumption is silly.

More important is testing to see if we are on the bootstrap processor
and if we are not disabling any cpus in that case.  As that will
guarantee that introducing code to not start the bootstrap processor
won't cause a regression outside of the kexec on panic case.

Eric

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2012-10-22 20:04 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16  4:35 [PATCH v1 0/2] x86, apic: Disable BSP if boot cpu is AP HATAYAMA Daisuke
2012-10-16  4:35 ` HATAYAMA Daisuke
2012-10-16  4:35 ` [PATCH v1 1/2] x86, apic: Introduce boot_cpu_is_bsp indicating whether boot cpu is BSP or not HATAYAMA Daisuke
2012-10-16  4:35   ` HATAYAMA Daisuke
2012-10-16  4:35 ` [PATCH v1 2/2] x86, apic: Disable BSP if boot cpu is AP HATAYAMA Daisuke
2012-10-16  4:35   ` HATAYAMA Daisuke
2012-10-22 20:04   ` Eric W. Biederman [this message]
2012-10-22 20:04     ` Eric W. Biederman
2012-10-22 20:16     ` H. Peter Anvin
2012-10-22 20:16       ` H. Peter Anvin
2012-10-22 20:31       ` Eric W. Biederman
2012-10-22 20:31         ` Eric W. Biederman
2012-10-22 20:33         ` H. Peter Anvin
2012-10-22 20:33           ` H. Peter Anvin
2012-10-22 20:38           ` H. Peter Anvin
2012-10-22 20:38             ` H. Peter Anvin
2012-10-22 20:43           ` Eric W. Biederman
2012-10-22 20:43             ` Eric W. Biederman
2012-10-22 20:47             ` H. Peter Anvin
2012-10-22 20:47               ` H. Peter Anvin
2012-10-22 21:29               ` Eric W. Biederman
2012-10-22 21:29                 ` Eric W. Biederman
2012-10-23  0:35                 ` H. Peter Anvin
2012-10-23  0:35                   ` H. Peter Anvin
2012-10-26  3:24                   ` HATAYAMA Daisuke
2012-10-26  3:24                     ` HATAYAMA Daisuke
2012-10-26  4:13                     ` Eric W. Biederman
2012-10-26  4:13                       ` Eric W. Biederman
2013-03-11  1:07                       ` HATAYAMA Daisuke
2013-03-11  1:07                         ` HATAYAMA Daisuke
2013-03-11  2:13                         ` HATAYAMA Daisuke
2013-03-11  2:13                           ` HATAYAMA Daisuke
2013-03-11  4:11                           ` H. Peter Anvin
2013-03-11  4:11                             ` H. Peter Anvin
2012-10-16  4:51 ` [PATCH v1 0/2] " Yu, Fenghua
2012-10-16  4:51   ` Yu, Fenghua
2012-10-16  5:03   ` HATAYAMA Daisuke
2012-10-16  5:03     ` HATAYAMA Daisuke
2012-10-16  5:14     ` Yu, Fenghua
2012-10-16  5:14       ` Yu, Fenghua
2012-10-16  6:38       ` HATAYAMA Daisuke
2012-10-16  6:38         ` HATAYAMA Daisuke
2012-10-22 16:02         ` H. Peter Anvin
2012-10-22 16:02           ` H. Peter Anvin
2012-10-16  5:15     ` HATAYAMA Daisuke
2012-10-16  5:15       ` HATAYAMA Daisuke
2012-10-17 14:12 ` Vivek Goyal
2012-10-17 14:12   ` Vivek Goyal
2012-10-18  3:08   ` HATAYAMA Daisuke
2012-10-18  3:08     ` HATAYAMA Daisuke
2012-10-18 14:14     ` Vivek Goyal
2012-10-18 14:14       ` Vivek Goyal
2012-10-19  3:20       ` HATAYAMA Daisuke
2012-10-19  3:20         ` HATAYAMA Daisuke
2012-10-19 15:17         ` Vivek Goyal
2012-10-19 15:17           ` Vivek Goyal
2012-10-22  6:32           ` HATAYAMA Daisuke
2012-10-22  6:32             ` HATAYAMA Daisuke
2012-10-22 18:37             ` Vivek Goyal
2012-10-22 18:37               ` Vivek Goyal
2012-10-22 17:10           ` Michael Holzheu
2012-10-22 17:10             ` Michael Holzheu

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=873916i88t.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=d.hatayama@jp.fujitsu.com \
    --cc=fenghua.yu@intel.com \
    --cc=grant.likely@secretlab.ca \
    --cc=hpa@zytor.com \
    --cc=kexec@lists.infradead.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rob.herring@calxeda.com \
    --cc=tglx@linutronix.de \
    --cc=vgoyal@redhat.com \
    --cc=x86@kernel.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.