From patchwork Fri Jun 30 04:07:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 9818971 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 410C460224 for ; Fri, 30 Jun 2017 09:20:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32B0E285FB for ; Fri, 30 Jun 2017 09:20:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2747528607; Fri, 30 Jun 2017 09:20:56 +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 C5BCF285FB for ; Fri, 30 Jun 2017 09:20:55 +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-0005Vv-Or; 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 1dQnE7-0008JO-Mp for xen-devel@lists.xenproject.org; Fri, 30 Jun 2017 04:08:15 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id 77/7B-02181-EAEC5595; Fri, 30 Jun 2017 04:08:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNIsWRWlGSWpSXmKPExsViPb2gRXfdudB Ig519PBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aEJ69YCj4JV+x4V9LAOF2wi5GTQ0LAT2Ly i4XsILaQQK3Eg2l7mLoYuYDslYwSL35OZYZwjjNKHHs2kRmkik1AR+JM8wOwDhGBcIm1a7vZQ IqYBZ4xSnz6+YMRJCEs4CNx5tNtMJtFQFVizdpPLF2MHBy8AvES/75WQ2yWk9i2ZQ9YCaeArc SSK8+hrrCReLSrmwnE5hUQlDg58wkLiM0sICFx8MULZoheJYnX6w6AjZQQ0JW4vtUNIqwpsW3 1OTYI20ziyM7/rBC2oMTO5xfYJjCKzEIydRaSqQsYmVYxahSnFpWlFukamuslFWWmZ5TkJmbm 6BoaGOvlphYXJ6an5iQmFesl5+duYgQGOQMQ7GB8edrzEKMkB5OSKO+5RaGRQnxJ+SmVGYnFG fFFpTmpxYcYZTg4lCR4w84C5QSLUtNTK9Iyc4DxBpOW4OBREuEVWAKU5i0uSMwtzkyHSJ1iNO bYsHr9FyaOYzN+fmMSYsnLz0uVEudVA5kkAFKaUZoHNwiWBi4xykoJ8zICnSbEU5BalJtZgir /ilGcg1FJmJcHZApPZl4J3L5XQKcwAZ0iPCME5JSSRISUVAPjyfT48rQ9HYGGLwSXCZazrWu/ 9OP7pU/HOjQbHp3a7m9W1Xg++swiNjGHoCVLJLW8hfbd3xXWx7Ly4+JW3jkRK6PWqhuLSEzf9 0+3RU5kv0XMlP6KqW+vCwY7Xtht9atce/nity7fk09eqZiyqLJ5xtqnExgFxfdUaV2+oWXLsP 41/ynNpFhhJZbijERDLeai4kQA5sryIv4CAAA= X-Env-Sender: douly.fnst@cn.fujitsu.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1498795690!103343455!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 14637 invoked from network); 30 Jun 2017 04:08:13 -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:13 -0000 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="20680351" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 30 Jun 2017 12:08:06 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id 66ACF47E64D5; Fri, 30 Jun 2017 12:08:09 +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:08:08 +0800 From: Dou Liyang To: , , Date: Fri, 30 Jun 2017 12:07:35 +0800 Message-ID: <1fa26228fa94779d12d4089b83a43fe157b110fe.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: 66ACF47E64D5.A627C 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 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 | 49 +++++++++------------------------------------ 2 files changed, 9 insertions(+), 41 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 0601054..9bf7e95 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1198,6 +1198,10 @@ static int __init apic_intr_mode_select(int *upmode) } #endif +#ifdef CONFIG_UP_LATE_INIT + *upmode = true; +#endif + /* Check MP table or ACPI MADT configuration */ if (!smp_found_config) { disable_ioapic_support(); @@ -2380,51 +2384,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; - - /* - * 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 + apic_intr_mode_init(); - 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