From patchwork Wed Mar 29 14:47:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9651763 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 67C56602BE for ; Wed, 29 Mar 2017 14:50:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A5572848D for ; Wed, 29 Mar 2017 14:50:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D8A3284D4; Wed, 29 Mar 2017 14:50:38 +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 B64732848D for ; Wed, 29 Mar 2017 14:50:37 +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 1ctEtg-0008Rn-W8; Wed, 29 Mar 2017 14:48:28 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctEte-0008QB-Qm for xen-devel@lists.xenproject.org; Wed, 29 Mar 2017 14:48:26 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id 57/90-27751-A39CBD85; Wed, 29 Mar 2017 14:48:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDIsWRWlGSWpSXmKPExsXitHRDpK7lyds RBqu2KVl83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmntv5iLGgTrHh64SJLA+Mivi5GTg4JAX+J 91c2M4LYbAI6Ehfn7mQDsUUEYiUeP97C3MXIwcEsUC4x40Y8SFhYIFjixJSrTCA2i4CqRM+lV hYQm1fAQuLL9EYWiJF6Em8nvgAbySlgKbF22zt2EFsIqObTt5VsEPWCEidnPgGrZxbQlGjd/p sdwpaXaN46mxmiXlGif94DtgmMfLOQtMxC0jILScsCRuZVjBrFqUVlqUW6xkZ6SUWZ6RkluYm ZObqGBmZ6uanFxYnpqTmJScV6yfm5mxiBocYABDsYT68LPMQoycGkJMp7wvB2hBBfUn5KZUZi cUZ8UWlOavEhRhkODiUJ3toTQDnBotT01Iq0zBxg0MOkJTh4lER4Q0HSvMUFibnFmekQqVOMi lLivIkgCQGQREZpHlwbLNIuMcpKCfMyAh0ixFOQWpSbWYIq/4pRnINRSZjXEGQKT2ZeCdz0V0 CLmYAWi9vcAllckoiQkmpgVP/3s1804ivnz30uHw1l5v4+dPyr6X0WG2GH8m2ykb9W8+hUVx6 +dkHk3AebE9bldgWqZld0pD74ikwoyvq3SKfAVXgD+06dkkbzc4bL+lTULJWW/a5aInOltn7W /Zkvt4l/i5gvq8sww2ZLXZM0+4ctnxdn+isLtKyrFr+0o7Lv6m1jqdfeSizFGYmGWsxFxYkAw YGuxa8CAAA= X-Env-Sender: prvs=25439209a=roger.pau@citrix.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1490798900!94023839!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14398 invoked from network); 29 Mar 2017 14:48:25 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 29 Mar 2017 14:48:25 -0000 X-IronPort-AV: E=Sophos;i="5.36,241,1486425600"; d="scan'208";a="416467321" From: Roger Pau Monne To: , , Date: Wed, 29 Mar 2017 15:47:32 +0100 Message-ID: <20170329144733.4709-6-roger.pau@citrix.com> X-Mailer: git-send-email 2.11.0 (Apple Git-81) In-Reply-To: <20170329143918.4445-1-roger.pau@citrix.com> References: <20170329143918.4445-1-roger.pau@citrix.com> MIME-Version: 1.0 Cc: Andrew Cooper , Jan Beulich , Roger Pau Monne Subject: [Xen-devel] [PATCH v3 7/8] x86/ioapic: add prototype for io_apic_gsi_base to io_apic.h 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 So that the function can be called from other files without adding prototypes to each of them. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich --- Cc: Jan Beulich Cc: Andrew Cooper --- Changes since v1: - Add io_ prefix to avoid confusion. - Make the parameter unsigned. --- xen/arch/x86/io_apic.c | 4 +--- xen/arch/x86/mpparse.c | 2 +- xen/include/asm-x86/io_apic.h | 3 +++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 24ee431b00..d18046067c 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2274,8 +2274,6 @@ static int ioapic_physbase_to_id(unsigned long physbase) return -EINVAL; } -unsigned apic_gsi_base(int apic); - static int apic_pin_2_gsi_irq(int apic, int pin) { int idx; @@ -2286,7 +2284,7 @@ static int apic_pin_2_gsi_irq(int apic, int pin) idx = find_irq_entry(apic, pin, mp_INT); return idx >= 0 ? pin_2_irq(idx, apic, pin) - : apic_gsi_base(apic) + pin; + : io_apic_gsi_base(apic) + pin; } int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval) diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c index 1eb7c99ea7..efcbc6115d 100644 --- a/xen/arch/x86/mpparse.c +++ b/xen/arch/x86/mpparse.c @@ -913,7 +913,7 @@ unsigned __init highest_gsi(void) return res; } -unsigned apic_gsi_base(int apic) +unsigned int io_apic_gsi_base(unsigned int apic) { return mp_ioapic_routing[apic].gsi_base; } diff --git a/xen/include/asm-x86/io_apic.h b/xen/include/asm-x86/io_apic.h index 225edd63b2..8029c8f400 100644 --- a/xen/include/asm-x86/io_apic.h +++ b/xen/include/asm-x86/io_apic.h @@ -127,6 +127,9 @@ struct __packed IO_APIC_route_entry { /* I/O APIC entries */ extern struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS]; +/* Base GSI for this IO APIC */ +unsigned int io_apic_gsi_base(unsigned int apic); + /* Only need to remap ioapic RTE (reg: 10~3Fh) */ #define ioapic_reg_remapped(reg) (iommu_intremap && ((reg) >= 0x10))