From patchwork Mon Mar 27 10:18:22 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: 9646349 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 241B6602D6 for ; Mon, 27 Mar 2017 10:21:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2414428364 for ; Mon, 27 Mar 2017 10:21:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1903B28384; Mon, 27 Mar 2017 10:21:00 +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 C32342837F for ; Mon, 27 Mar 2017 10:20:59 +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 1csRjk-0007CJ-Ns; Mon, 27 Mar 2017 10:18:56 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csRji-0007Ak-SK for xen-devel@lists.xenproject.org; Mon, 27 Mar 2017 10:18:54 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id 38/2E-15112-E07E8D85; Mon, 27 Mar 2017 10:18:54 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsWyU9JRQpf3+Y0 Ig3+HOS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1owJz28wFZwVqOjfXNrA+J63i5GTQ0LAT+L/ 8w8sIDabgI7Exbk72boYOThEBFQkbu81ADGZBcolZtyIB6kQFgiQaH77gA3EZhFQlTj26D07i M0rYClx/95VFoiJ8hKPNj0Cm8IpYCVxdl8FSFgIqKRzXxdUuaDEyZlPwMqZBTQlWrf/Zoew5S Wat85mhqhXlOifB7FKQiBdYuvfX8wTGPlnIWmfhaR9FpL2BYzMqxg1ilOLylKLdI0s9JKKMtM zSnITM3N0DQ3M9HJTi4sT01NzEpOK9ZLzczcxAoOPAQh2MJ5fG3iIUZKDSUmU98PpGxFCfEn5 KZUZicUZ8UWlOanFhxhlODiUJHiznwLlBItS01Mr0jJzgHEAk5bg4FES4T3wBCjNW1yQmFucm Q6ROsWoKCXOWwjSJwCSyCjNg2uDxd4lRlkpYV5GoEOEeApSi3IzS1DlXzGKczAqCfNuBpnCk5 lXAjf9FdBiJqDFh+eDLS5JREhJNTBKBx90MZjCbKRQt+JORHaD4uNsj4nsax4cy/8oUMcm0cD 169HV94WFWola/yMP7w254pIs8XnNEebEL8Hq/9v+yyzuEy5kXaMX/tXa++0Dv6CmRRo7WMwC k62aIryddHjvcs6ZyZjUuqHy6DGTzAzLH7f1wtc8mlhSMVdAd1NTy8SMXcvO8yqxFGckGmoxF xUnAgCu3I8AuAIAAA== X-Env-Sender: prvs=25239713d=roger.pau@citrix.com X-Msg-Ref: server-8.tower-27.messagelabs.com!1490609913!83588185!7 X-Originating-IP: [185.25.65.24] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29067 invoked from network); 27 Mar 2017 10:18:53 -0000 Received: from smtp.eu.citrix.com (HELO SMTP.EU.CITRIX.COM) (185.25.65.24) by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 27 Mar 2017 10:18:53 -0000 X-IronPort-AV: E=Sophos;i="5.36,231,1486425600"; d="scan'208";a="43158887" From: Roger Pau Monne To: Date: Mon, 27 Mar 2017 11:18:22 +0100 Message-ID: <20170327101823.99368-7-roger.pau@citrix.com> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170327101823.99368-1-roger.pau@citrix.com> References: <20170327101823.99368-1-roger.pau@citrix.com> MIME-Version: 1.0 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) Cc: Andrew Cooper , Jan Beulich , Roger Pau Monne Subject: [Xen-devel] [PATCH v2 6/7] x86/ioapic: add prototype for 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))