linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Suresh Siddha <suresh.b.siddha@intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Don Zickus <dzickus@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	stable <stable@kernel.org>
Subject: [PATCH] x86: fix x2apic preenabled system with kexec
Date: Thu, 15 Jul 2010 00:00:59 -0700	[thread overview]
Message-ID: <4C3EB22B.3000701@kernel.org> (raw)
In-Reply-To: <1279152189.2849.260.camel@sbs-t61.sc.intel.com>


Found one x2apic system kexec loop test failed 
when CONFIG_NMI_WATCHDOG=y (old) or CONFIG_LOCKUP_DETECTOR=y (current tip)

first kernel can kexec second kernel, but second kernel can not kexec third one.

it can be duplicated on another system with BIOS preenabled x2apic.
First kernel can not kexec second kernel.

It turns out, when kernel boot with pre-enabled x2apic, it will not execute
disable_local_APIC on shutdown path.

when init_apic_mappings() is called in setup_arch, it will skip setting of
apic_phys when x2apic_mode is set. ( x2apic_mode is much early check_x2apic())
Then later, disable_local_APIC() will bail out early because !apic_phys.

So check !x2apic_mode in x2apic_mode in disable_local_APIC with !apic_phys.

another solution could be updating init_apic_mappings() to set apic_phys even
for preenabled x2apic system. Actually even for x2apic system, that lapic
address is mapped already in early stage.

BTW: is there any x2apic preenabled system with apicid of boot cpu > 255?

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: stable@kernel.org
---
 arch/x86/kernel/apic/apic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/x86/kernel/apic/apic.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/apic/apic.c
+++ linux-2.6/arch/x86/kernel/apic/apic.c
@@ -921,7 +921,7 @@ void disable_local_APIC(void)
 	unsigned int value;
 
 	/* APIC hasn't been mapped yet */
-	if (!apic_phys)
+	if (!x2apic_mode && !apic_phys)
 		return;
 
 	clear_local_APIC();

  parent reply	other threads:[~2010-07-15  7:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13  2:59 tip/master broken with x2apic and kexec Yinghai Lu
2010-07-13  3:29 ` Yinghai Lu
2010-07-13  6:40   ` H. Peter Anvin
2010-07-14  0:54   ` [tip:x86/alternatives] x86, alternatives: Fix one more open-coded 8-bit alternative number tip-bot for H. Peter Anvin
2010-07-14  0:54     ` [tip:x86/alternatives] x86, alternatives: BUG on encountering an invalid CPU feature number tip-bot for H. Peter Anvin
2010-07-13 22:00 ` tip/master broken with x2apic and kexec H. Peter Anvin
2010-07-13 23:27   ` Yinghai Lu
2010-07-14 20:35     ` Yinghai Lu
2010-07-14 21:05       ` Don Zickus
2010-07-14 22:07         ` Yinghai Lu
2010-07-14 21:23       ` Yinghai Lu
2010-07-14 22:57         ` Yinghai Lu
2010-07-15  0:03           ` Suresh Siddha
2010-07-15  2:01             ` Yinghai Lu
2010-07-15  7:00             ` Yinghai Lu [this message]
2010-07-15 18:16               ` [PATCH] x86: fix x2apic preenabled system with kexec Suresh Siddha
2010-07-15 20:10                 ` Yinghai Lu
2010-07-15 20:40                   ` Yinghai Lu
2010-07-17  0:48               ` [tip:x86/urgent] x86: Fix " tip-bot for Yinghai Lu

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=4C3EB22B.3000701@kernel.org \
    --to=yinghai@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dzickus@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stable@kernel.org \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).