From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753940AbcHQGob (ORCPT ); Wed, 17 Aug 2016 02:44:31 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:8614 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753553AbcHQGnk (ORCPT ); Wed, 17 Aug 2016 02:43:40 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="10000229" From: Wei Jiangang To: CC: , , , , , Wei Jiangang Subject: [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing Date: Wed, 17 Aug 2016 14:42:51 +0800 Message-ID: <1471416172-9463-1-git-send-email-weijg.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.167.226.50] X-yoursite-MailScanner-ID: 0E5C342CD10F.AE9A8 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: weijg.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check the boot APIC ID firstly, and then setup the default routing of APIC looks better. And move default_setup_apic_routing() close to apic_bsp_setup(), which staying in step with the codes in APIC_init_uniprocessor(). Signed-off-by: Wei Jiangang --- 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 2a6e84a30a54..8216b997c1c9 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); -- 1.9.3