From patchwork Mon Jul 3 11:07:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 9822531 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 23FDE60246 for ; Mon, 3 Jul 2017 11:10:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 161BD2817F for ; Mon, 3 Jul 2017 11:10:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A7E0283AD; Mon, 3 Jul 2017 11:10:25 +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 624812817F for ; Mon, 3 Jul 2017 11:10:24 +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 1dRzD5-0005tX-0h; Mon, 03 Jul 2017 11:08:07 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRzD4-0005sn-62 for xen-devel@lists.xenproject.org; Mon, 03 Jul 2017 11:08:06 +0000 Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id C7/28-01862-5952A595; Mon, 03 Jul 2017 11:08:05 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDIsWRWlGSWpSXmKPExsViPb2gRXeKalS kwZFnBhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a2iXPYCppEKn4132RrYFwh2MXIySEh4Cex +sQCVhBbSKBWYvuqI+wQ9kpGiXkfRLsYuYDsY4wS+7a+YQRJsAnoSJxpfgBWJCIQLrF2bTcbS BGzwDNGiU8/f4AVCQv4SCybtQVsKouAisS95hVgDbwC8RIdk7+yQGyWk9i2ZQ9YPaeArcSkls ssEJttJO60NjNC1AtKnJz5BCzOLCAhcfDFC2aIXiWJ1+sOAMU5gGxdidMn0iDCmhLbVp9jg7D NJI7s/M8KYQtK7Hx+gW0Co8gsJFNnIZm6gJFpFaNGcWpRWWqRrpGxXlJRZnpGSW5iZo6uoYGx Xm5qcXFiempOYlKxXnJ+7iZGYJjXMzAw7mDs2+t3iFGSg0lJlNf1ZmSkEF9SfkplRmJxRnxRa U5q8SFGGQ4OJQneCpWoSCHBotT01Iq0zBxgxMGkJTh4lER4D9wDauUtLkjMLc5Mh0idYjTm2L B6/RcmjlcT/n9jEmLJy89LlRLnrQaZJABSmlGaBzcIlgguMcpKCfMyMjAwCPEUpBblZpagyr9 iFOdgVBLmzQSZwpOZVwK37xXQKUxApzT0RICcUpKIkJJqYHS0Xn05ut4wM1j5wIxHP4Luc8YX GXIF1yd/rW8/aHbptVn6Gu0sXdnrp8tun7p11pKvTHLOidylmz+8Es041cpxMTnvjcqE+Jv/D 4Ud3Rayb2P4IbvTS8JS337IZhI7XDr9o2zOEtH4O0cqllsKnVtovjeML7qud1bd/lK9/V9/94 QzCr0I8VZiKc5INNRiLipOBADY7k5F/wIAAA== X-Env-Sender: douly.fnst@cn.fujitsu.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1499080076!99619729!3 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 49022 invoked from network); 3 Jul 2017 11:08:04 -0000 Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by server-15.tower-31.messagelabs.com with SMTP; 3 Jul 2017 11:08:04 -0000 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="20783667" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Jul 2017 19:08:03 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id 1200B47E98A6; Mon, 3 Jul 2017 19:07:58 +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:08:02 +0800 From: Dou Liyang To: , , Date: Mon, 3 Jul 2017 19:07:27 +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: 1200B47E98A6.A1F51 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 07/12] x86/apic: Unify interrupt mode setup for UP system 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 In UniProcessor kernel with UP_LATE_INIT=y, it enables and setups interrupt delivery mode in up_late_init(). Unify it to apic_intr_mode_init(), remove APIC_init_uniprocessor(). Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 1 - arch/x86/kernel/apic/apic.c | 47 ++++++--------------------------------------- 2 files changed, 6 insertions(+), 42 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index bfbf715..b35bbbf 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -144,7 +144,6 @@ void register_lapic_address(unsigned long address); extern void setup_boot_APIC_clock(void); extern void setup_secondary_APIC_clock(void); extern void lapic_update_tsc_freq(void); -extern int APIC_init_uniprocessor(void); #ifdef CONFIG_X86_64 static inline int apic_force_enable(unsigned long addr) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 8cae32c..6dc399e 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1281,7 +1281,7 @@ void __init init_bsp_APIC(void) /* Init the interrupt delivery mode for the BSP */ void __init apic_intr_mode_init(void) { - bool upmode = false; + bool upmode = IS_ENABLED(CONFIG_UP_LATE_INIT); apic_intr_mode = apic_intr_mode_select(); @@ -2381,51 +2381,16 @@ void __init apic_bsp_setup(bool upmode) setup_IO_APIC(); } -/* - * This initializes the IO-APIC and APIC hardware if this is - * a UP kernel. - */ -int __init APIC_init_uniprocessor(void) +#ifdef CONFIG_UP_LATE_INIT +void __init up_late_init(void) { - if (disable_apic) { - pr_info("Apic disabled\n"); - return -1; - } -#ifdef CONFIG_X86_64 - if (!boot_cpu_has(X86_FEATURE_APIC)) { - disable_apic = 1; - pr_info("Apic disabled by BIOS\n"); - return -1; - } -#else - if (!smp_found_config && !boot_cpu_has(X86_FEATURE_APIC)) - return -1; + apic_intr_mode_init(); - /* - * Complain if the BIOS pretends there is one. - */ - if (!boot_cpu_has(X86_FEATURE_APIC) && - APIC_INTEGRATED(boot_cpu_apic_version)) { - pr_err("BIOS bug, local APIC 0x%x not detected!...\n", - boot_cpu_physical_apicid); - return -1; - } -#endif - - if (!smp_found_config) - disable_ioapic_support(); + if (apic_intr_mode == APIC_PIC) + return; - default_setup_apic_routing(); - apic_bsp_setup(true); /* Setup local timer */ x86_init.timers.setup_percpu_clockev(); - return 0; -} - -#ifdef CONFIG_UP_LATE_INIT -void __init up_late_init(void) -{ - APIC_init_uniprocessor(); } #endif