From patchwork Fri Jun 30 04:07:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 9818979 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 1004960224 for ; Fri, 30 Jun 2017 09:21:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00E2F285FB for ; Fri, 30 Jun 2017 09:21:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E96EB28607; Fri, 30 Jun 2017 09:21:03 +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 E20A028600 for ; Fri, 30 Jun 2017 09:21:02 +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 1dQs4B-0005WS-Dc; Fri, 30 Jun 2017 09:18:19 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQnEA-0008Kp-Hh for xen-devel@lists.xenproject.org; Fri, 30 Jun 2017 04:08:18 +0000 Received: from [193.109.254.147] by server-4.bemta-6.messagelabs.com id F1/35-02962-1BEC5595; Fri, 30 Jun 2017 04:08:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLIsWRWlGSWpSXmKPExsViPb2gRXfjudB Ig5WnpC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oxJm4+wFtwUqLjw8CFjA+Navi5GTg4JAT+J 1z/XMYHYQgK1EqcvnmTtYuQCslcySjz7PYUZwjnOKLHr9S1mkCo2AR2JM80P2EFsEYFwibVru 9lAipgFnjFKfPr5gxEkISzgJnG7YzHYWBYBVYkTK5ezgti8AvES956tYIdYLSexbcsesHpOAV uJJVees0OcYSPxaFc3E0S9oMTJmU9YQGxmAQmJgy9eMEP0Kkm8XneABcLWlXj+oIsRwtaU2Lb 6HBuEbSZxZOd/VghbUGLn8wtsExhFZiEZOwvJ2AWMTKsY1YtTi8pSi3SN9JKKMtMzSnITM3N0 DQ3M9HJTi4sT01NzEpOK9ZLzczcxAgOdAQh2MC7763SIUZKDSUmU99yi0EghvqT8lMqMxOKM+ KLSnNTiQ4wyHBxKErxhZ4FygkWp6akVaZk5wJiDSUtw8CiJ8AosAUrzFhck5hZnpkOkTjEac2 xYvf4LE8exGT+/MQmx5OXnpUqJ884EmSQAUppRmgc3CJYKLjHKSgnzMgKdJsRTkFqUm1mCKv+ KUZyDUUmYlwdkCk9mXgncvldApzABnSI8IwTklJJEhJRUA+NkHfYHC6alzOO5efvw+aknz6ZW Z0/h0n/qmv5p00sJFRNn0TlHa7ewWBn55PO8+hn0f59cQvF1xU0Nyt8eJ7otePR8+u8Lsy1vH TvmZnf81Hw9xQ/BPp/zpnIa/lk3KXaK+Aph0yvicdMSjjtn7D5TrfLJ+cOD3UdPdM+9UL1hud +tJ0zbLa9qKbEUZyQaajEXFScCAO3oSa0AAwAA X-Env-Sender: douly.fnst@cn.fujitsu.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1498795685!74337025!5 X-Originating-IP: [59.151.112.132] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64210 invoked from network); 30 Jun 2017 04:08:16 -0000 Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by server-11.tower-27.messagelabs.com with SMTP; 30 Jun 2017 04:08:16 -0000 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="20680358" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 30 Jun 2017 12:08:14 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id E7DEB46B53F6; Fri, 30 Jun 2017 12:08:16 +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:15 +0800 From: Dou Liyang To: , , Date: Fri, 30 Jun 2017 12:07:37 +0800 Message-ID: <1a780e5c87107497f45f1217d0c49e27f4213f88.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: E7DEB46B53F6.A6BFF 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 09/12] x86/init: add intr_mode_init to x86_init_ops 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 Add an unconditional x86_init_ops function which defaults to the standard function and can be overridden by the early platform code. Signed-off-by: Dou Liyang --- arch/x86/include/asm/x86_init.h | 2 ++ arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/x86_init.c | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 7ba7e90..f45acdf 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -50,11 +50,13 @@ struct x86_init_resources { * are set up. * @intr_init: interrupt init code * @trap_init: platform specific trap setup + * @intr_mode_init: interrupt delivery mode setup */ struct x86_init_irqs { void (*pre_vector_init)(void); void (*intr_init)(void); void (*trap_init)(void); + void (*intr_mode_init)(void); }; /** diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 9bf7e95..51204d4 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2387,7 +2387,7 @@ void __init apic_bsp_setup(bool upmode) #ifdef CONFIG_UP_LATE_INIT void __init up_late_init(void) { - apic_intr_mode_init(); + x86_init.irqs.intr_mode_init(); if (apic_intr_mode == APIC_PIC) return; diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 2db61dcb..80d25fe 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1288,7 +1288,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) set_cpu_sibling_map(0); - apic_intr_mode_init(); + x86_init.irqs.intr_mode_init(); smp_sanity_check(); switch (apic_intr_mode) { diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index a088b2c..a7889b9 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -55,6 +55,7 @@ struct x86_init_ops x86_init __initdata = { .pre_vector_init = init_ISA_irqs, .intr_init = native_init_IRQ, .trap_init = x86_init_noop, + .intr_mode_init = apic_intr_mode_init }, .oem = {