From patchwork Fri Jun 30 04:07:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 9818969 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 C612960224 for ; Fri, 30 Jun 2017 09:20:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7022285FB for ; Fri, 30 Jun 2017 09:20:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABD2628607; Fri, 30 Jun 2017 09:20:54 +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 5CDFD285FB for ; Fri, 30 Jun 2017 09:20:54 +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 1dQs4A-0005VO-4k; Fri, 30 Jun 2017 09:18:18 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQnE5-0008IX-0D for xen-devel@lists.xenproject.org; Fri, 30 Jun 2017 04:08:13 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id D3/AF-01859-CAEC5595; Fri, 30 Jun 2017 04:08:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOIsWRWlGSWpSXmKPExsViPb2gRXf1udB Ig+N/FC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozF+7pYCx7xVfy5sZStgfEqTxcjJ4eEgJ/E +gVb2EFsIYFaieW/nzBD2CsZJZq/2HYxcgHZxxkl+n5MYQVJsAnoSJxpfgDWICIQLrF2bTcbS BGzwDNGiU8/fzCCJIQFQiS+7DsKZrMIqEq87VvPBGLzCsRL7Jywng1is5zEti17wGo4BWwlll x5DnWFjcSjXd1Q9YISJ2c+YQGxmQUkJA6+eMEM0ask8XrdARYIW1fixs9DUHFNiW2rz0HNN5M 4svM/K4QtKLHz+QW2CYwis5CMnYVk7AJGplWMGsWpRWWpRbqG5npJRZnpGSW5iZk5uoYGxnq5 qcXFiempOYlJxXrJ+bmbGIGBzgAEOxhfnvY8xCjJwaQkyntuUWikEF9SfkplRmJxRnxRaU5q8 SFGGQ4OJQnesLNAOcGi1PTUirTMHGDMwaQlOHiURHgFlgCleYsLEnOLM9MhUqcYdTmOzfj5jU mIJS8/L1VKnFcNZIYASFFGaR7cCFj8X2KUlRLmZQQ6SoinILUoN7MEVf4VozgHo5IwLw/IFJ7 MvBK4Ta+AjmACOkJ4RgjIESWJCCmpBsauE3lvF91LMOg4cXTesjeFsyKXpx/hMa+Pe1I64ek1 O81TDrFH/ZT+HPCrf+98XfJZwTJWM7cuP/tkjocya1x2rzwfHNKrLtd8hbee72hwgq/2yz7jB Q8C7dyu+eUVXf/fyy6yI8k24UWBRYhP4IGrmsw3L90qNBU5zXj15SO+6wpJxvn/biuxFGckGm oxFxUnAgDvQSXQ+gIAAA== X-Env-Sender: douly.fnst@cn.fujitsu.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1498795690!103343455!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.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12431 invoked from network); 30 Jun 2017 04:08:11 -0000 Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by server-8.tower-31.messagelabs.com with SMTP; 30 Jun 2017 04:08:11 -0000 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="20680342" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 30 Jun 2017 12:07:54 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id CC4FF46B53F6; Fri, 30 Jun 2017 12:07:55 +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; Fri, 30 Jun 2017 12:07:54 +0800 From: Dou Liyang To: , , Date: Fri, 30 Jun 2017 12:07:31 +0800 Message-ID: <554a909f2a7b85ff8dd94d33ca8ed1fdb8f22229.1498795030.git.douly.fnst@cn.fujitsu.com> 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: CC4FF46B53F6.A60AF X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-Mailman-Approved-At: Fri, 30 Jun 2017 09:18:16 +0000 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 v5 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 00d97f4..63220ca 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2359,8 +2359,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; } @@ -2400,6 +2398,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));