From: tip-bot for Wei Jiangang <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, hpa@zytor.com,
linux-kernel@vger.kernel.org, tglx@linutronix.de,
torvalds@linux-foundation.org, weijg.fnst@cn.fujitsu.com,
mingo@kernel.org
Subject: [tip:x86/apic] x86/smpboot: Check APIC ID before setting up default routing
Date: Wed, 24 Aug 2016 06:01:24 -0700 [thread overview]
Message-ID: <tip-384d9fe3741657c8ed8cd9bf30bc1d4611864d56@git.kernel.org> (raw)
In-Reply-To: <1471576957-12961-1-git-send-email-weijg.fnst@cn.fujitsu.com>
Commit-ID: 384d9fe3741657c8ed8cd9bf30bc1d4611864d56
Gitweb: http://git.kernel.org/tip/384d9fe3741657c8ed8cd9bf30bc1d4611864d56
Author: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
AuthorDate: Fri, 19 Aug 2016 11:22:36 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 24 Aug 2016 11:24:33 +0200
x86/smpboot: Check APIC ID before setting up default routing
This is not a bugfix, but code optimization.
If the BSP's APIC ID in local APIC is unexpected,
a kernel panic will occur and the system will halt.
That means no need to enable APIC mode, and no reason
to set up the default routing for APIC.
The combination of default_setup_apic_routing() and
apic_bsp_setup() are used to enable APIC mode.
They two should be kept together, rather than being
separated by the codes of checking APIC ID.
Just like their usage in APIC_init_uniprocessor().
Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@suse.de
Link: http://lkml.kernel.org/r/1471576957-12961-1-git-send-email-weijg.fnst@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/smpboot.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2a6e84a..8216b99 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1316,14 +1316,13 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
break;
}
- default_setup_apic_routing();
-
if (read_apic_id() != boot_cpu_physical_apicid) {
panic("Boot APIC ID in local APIC unexpected (%d vs %d)",
read_apic_id(), boot_cpu_physical_apicid);
/* Or can we switch back to PIC here? */
}
+ default_setup_apic_routing();
cpu0_logical_apicid = apic_bsp_setup(false);
pr_info("CPU%d: ", 0);
prev parent reply other threads:[~2016-08-24 13:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 3:22 [PATCH v2 1/2] x86/smpboot: Check APIC ID before setting up default routing Wei Jiangang
2016-08-19 3:22 ` [PATCH v2 2/2] x86/apic: Update comment about disabling processor focus Wei Jiangang
2016-08-24 13:01 ` [tip:x86/apic] " tip-bot for Wei Jiangang
2016-08-24 13:01 ` tip-bot for Wei Jiangang [this message]
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=tip-384d9fe3741657c8ed8cd9bf30bc1d4611864d56@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=weijg.fnst@cn.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox