From patchwork Mon Jul 3 11:07:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 9822519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 137A160246 for ; Mon, 3 Jul 2017 11:10:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05F602817F for ; Mon, 3 Jul 2017 11:10:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEFF928462; Mon, 3 Jul 2017 11:10:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E854B2817F for ; Mon, 3 Jul 2017 11:10:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRzCr-0005jn-VA; Mon, 03 Jul 2017 11:07:53 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRzCr-0005jU-2R for xen-devel@lists.xenproject.org; Mon, 03 Jul 2017 11:07:53 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id EA/74-03612-8852A595; Mon, 03 Jul 2017 11:07:52 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKIsWRWlGSWpSXmKPExsViPb2gRbddNSr S4MFLPYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNeP5hWbmgkd8FRc3n2FuYLzK08XIySEh4Cfx ast9xi5GDg4hgVqJyROsuhi5gMyVjBLTGmezQDjHGCV2Xj3ADNLAJqAjcab5ATuILSIQLrF2b TcbSBGzwDNGiU8/f4BNEhYIkVi6UxekhkVAReLRrcesIDavQLzEkq4VzBCL5SS2bdnDCGJzCt hKTGq5zAJiCwnYSNxpbWaEqBeUODnzCVicWUBC4uCLF1C9ShKv1x1gAVklIaArceO2CURYU2L b6nNsELaZxJGd/1khbEGJnc8vsE1gFJmFZOosJFMXMDKtYtQoTi0qSy3SNTLWSyrKTM8oyU3M zNE1NDDTy00tLk5MT81JTCrWS87P3cQIDHIGINjB+Gd+4CFGSQ4mJVFe15uRkUJ8SfkplRmJx RnxRaU5qcWHGGU4OJQkeL8pR0UKCRalpqdWpGXmAOMNJi3BwaMkwnvgHlArb3FBYm5xZjpE6h SjLserCf+/MQmx5OXnpUqJ87KrAM0QACnKKM2DGwGL/UuMslLCvIxARwnxFKQW5WaWoMq/YhT nYFQS5v0EcglPZl4J3KZXQEcwAR3R0BMBckRJIkJKqoGR95mx4OHYWvs/9gZBvw4IsJ0TNDzz eI90q51anvWliNM83/nmK28tUj3wYkWiCW8Mc0ZwzOeqGfWh+jaFMh8q/+jcvqI/Z93KN7fOs n/YInciXGbBq5DNcz/wBW+1fGLy1abj6A327jmycxbtcOY3/XNz7jz/7IlP+QOVbzP/N3v+8w Bvxw1LJZbijERDLeai4kQANXDTnfgCAAA= X-Env-Sender: douly.fnst@cn.fujitsu.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1499080068!52448529!1 X-Originating-IP: [59.151.112.132] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2291 invoked from network); 3 Jul 2017 11:07:51 -0000 Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by server-15.tower-27.messagelabs.com with SMTP; 3 Jul 2017 11:07:51 -0000 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="20783655" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Jul 2017 19:07:46 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id 5843047E98A6; Mon, 3 Jul 2017 19:07:45 +0800 (CST) Received: from localhost.localdomain.localdomain (10.167.226.106) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 3 Jul 2017 19:07:49 +0800 From: Dou Liyang To: , , Date: Mon, 3 Jul 2017 19:07:23 +0800 Message-ID: X-Mailer: git-send-email 2.5.5 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 5843047E98A6.A023E X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com Cc: Dou Liyang , bhe@redhat.com, peterz@infradead.org, mingo@kernel.org, ebiederm@xmission.com, hpa@zytor.com, izumi.taku@jp.fujitsu.com, boris.ostrovsky@oracle.com, tglx@linutronix.de Subject: [Xen-devel] [PATCH v6 03/12] x86/apic: Split local APIC timer setup from the APIC setup X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP apic_bsp_setup() sets up the local APIC, I/O APIC and APIC timer. The local APIC and I/O APIC setup belongs to interrupt delivery mode setup. Setting up the local APIC timer for booting CPU is another job and has nothing to do with interrupt delivery mode setup. Split local APIC timer setup from the APIC setup, keep it in the original position for SMP and UP kernel for preparation. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 4 ++-- arch/x86/kernel/smpboot.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 3f22717..83b7c2e 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2355,8 +2355,6 @@ int __init apic_bsp_setup(bool upmode) end_local_APIC_setup(); irq_remap_enable_fault_handling(); setup_IO_APIC(); - /* Setup local timer */ - x86_init.timers.setup_percpu_clockev(); return id; } @@ -2396,6 +2394,8 @@ int __init APIC_init_uniprocessor(void) default_setup_apic_routing(); apic_bsp_setup(true); + /* Setup local timer */ + x86_init.timers.setup_percpu_clockev(); return 0; } diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index f04479a..93f0cda 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1333,6 +1333,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) case SMP_FORCE_UP: disable_smp(); apic_bsp_setup(false); + /* Setup local timer */ + x86_init.timers.setup_percpu_clockev(); return; case SMP_OK: break; @@ -1347,6 +1349,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) default_setup_apic_routing(); cpu0_logical_apicid = apic_bsp_setup(false); + /* Setup local timer */ + x86_init.timers.setup_percpu_clockev(); + pr_info("CPU0: "); print_cpu_info(&cpu_data(0));