From patchwork Fri Jun 30 04:07:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 9818977 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 63544603F3 for ; Fri, 30 Jun 2017 09:21:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 551C3285FB for ; Fri, 30 Jun 2017 09:21:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49C2D28607; Fri, 30 Jun 2017 09:21:02 +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 D4EEA28600 for ; Fri, 30 Jun 2017 09:21:01 +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 1dQs4C-0005XA-9p; Fri, 30 Jun 2017 09:18:20 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQnEM-0008OA-M1 for xen-devel@lists.xenproject.org; Fri, 30 Jun 2017 04:08:30 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 63/3A-02181-DBEC5595; Fri, 30 Jun 2017 04:08:29 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDIsWRWlGSWpSXmKPExsViPb2gRXfvudB Ig39N/Bbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bsmyvYChokKtb+3s7YwHhMpIuRk0NCwE9i 8Z1HTCC2kECtxM3G20A2F5C9klFib8MRKOc4o8TjCSvZQarYBHQkzjQ/ALNFBMIl1q7tZgMpY hZ4xijx6ecPRpCEsICdxJt3+8BsFgFVict7pwPZHBy8AvESc9eqQGyWk9i2ZQ9YCaeArcSSK8 /ZIa6wkXi0qxvsIl4BQYmTM5+wgNjMAhISB1+8YIboVZJ4ve4AC4StKzHn4w0mCFtTYtvqc2w QtpnEkZ3/WSFsQYmdzy+wTWAUmYVk7CwkYxcwMq1iVC9OLSpLLdI11ksqykzPKMlNzMzRNTQw 1stNLS5OTE/NSUwq1kvOz93ECAxzBiDYwdj8xekQoyQHk5Io77lFoZFCfEn5KZUZicUZ8UWlO anFhxhlODiUJHhvnwHKCRalpqdWpGXmACMOJi3BwaMkwiuwBCjNW1yQmFucmQ6ROsVozLFh9f ovTBzHZvz8xiTEkpeflyolzjvzLFCpAEhpRmke3CBYIrjEKCslzMsIdJoQT0FqUW5mCar8K0Z xDkYlYV4ekCk8mXklcPteAZ3CBHSK8IwQkFNKEhFSUg2MEZ2h9349nsuq/THrsMUPk0yd2XGG V57kf7tssnHvy+s1a27H13xdsfjF/xci6apPNkgqvb8XKyd9ZOcn8wkHbKw0S2VcjGaxb1VYI BV5pjno/GKeTaturXulsk5o0uyWdcdZpp+Q6l3aPcMt+ldSctFjG+mH4SmdVdGTv2mLMTqdVy g3Wln7XomlOCPRUIu5qDgRAAFRaGz/AgAA X-Env-Sender: douly.fnst@cn.fujitsu.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1498795676!103343434!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 21768 invoked from network); 30 Jun 2017 04:08:25 -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:25 -0000 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="20680368" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 30 Jun 2017 12:08:24 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id 945FF47F64D3; Fri, 30 Jun 2017 12:08:26 +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:25 +0800 From: Dou Liyang To: , , Date: Fri, 30 Jun 2017 12:07:40 +0800 Message-ID: <87b7542473a9566627759c34aa34db0054b97737.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: 945FF47F64D3.A497E 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 12/12] x86/apic: Remove the init_bsp_APIC() 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 The init_bsp_APIC() which works for the virtual wire mode is used in ISA irq initialization at the booting time. Currently, enable and setup the interrupt mode has been unified and advanced just behind the timer IRQ setup. Kernel switches to the final interrupt delivery mode directly. So init_bsp_APIC() is redundant. Remove the init_bsp_APIC() function. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 1 - arch/x86/kernel/apic/apic.c | 49 --------------------------------------------- arch/x86/kernel/irqinit.c | 3 --- 3 files changed, 53 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index b35bbbf..3c9fc9e 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -136,7 +136,6 @@ extern void disconnect_bsp_APIC(int virt_wire_setup); extern void disable_local_APIC(void); extern void lapic_shutdown(void); extern void sync_Arb_IDs(void); -extern void init_bsp_APIC(void); extern void apic_intr_mode_init(void); extern void setup_local_APIC(void); extern void init_apic_mappings(void); diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index d4722c2..47c94d5 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1235,55 +1235,6 @@ static int __init apic_intr_mode_select(int *upmode) return APIC_SYMMETRIC_IO; } -/* - * An initial setup of the virtual wire mode. - */ -void __init init_bsp_APIC(void) -{ - unsigned int value; - - /* - * Don't do the setup now if we have a SMP BIOS as the - * through-I/O-APIC virtual wire mode might be active. - */ - if (smp_found_config || !boot_cpu_has(X86_FEATURE_APIC)) - return; - - /* - * Do not trust the local APIC being empty at bootup. - */ - clear_local_APIC(); - - /* - * Enable APIC. - */ - value = apic_read(APIC_SPIV); - value &= ~APIC_VECTOR_MASK; - value |= APIC_SPIV_APIC_ENABLED; - -#ifdef CONFIG_X86_32 - /* This bit is reserved on P4/Xeon and should be cleared */ - if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && - (boot_cpu_data.x86 == 15)) - value &= ~APIC_SPIV_FOCUS_DISABLED; - else -#endif - value |= APIC_SPIV_FOCUS_DISABLED; - value |= SPURIOUS_APIC_VECTOR; - apic_write(APIC_SPIV, value); - - /* - * Set up the virtual wire mode. - */ - apic_write(APIC_LVT0, APIC_DM_EXTINT); - value = APIC_DM_NMI; - if (!lapic_is_integrated()) /* 82489DX */ - value |= APIC_LVT_LEVEL_TRIGGER; - if (apic_extnmi == APIC_EXTNMI_NONE) - value |= APIC_LVT_MASKED; - apic_write(APIC_LVT1, value); -} - /* Init the interrupt delivery mode for the BSP */ void __init apic_intr_mode_init(void) { diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index 7468c69..488c9e2 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c @@ -72,9 +72,6 @@ void __init init_ISA_irqs(void) struct irq_chip *chip = legacy_pic->chip; int i; -#if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC) - init_bsp_APIC(); -#endif legacy_pic->init(0); for (i = 0; i < nr_legacy_irqs(); i++)