From patchwork Wed Jun 1 14:38:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9147503 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 29DA060467 for ; Wed, 1 Jun 2016 14:41:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B4672654B for ; Wed, 1 Jun 2016 14:41:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1027B2699B; Wed, 1 Jun 2016 14:41:24 +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 AF2F02654B for ; Wed, 1 Jun 2016 14:41:23 +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 1b87Ib-0002WJ-Ee; Wed, 01 Jun 2016 14:39:09 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b87Ia-0002WB-FX for xen-devel@lists.xensource.com; Wed, 01 Jun 2016 14:39:08 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id 2C/83-25698-B83FE475; Wed, 01 Jun 2016 14:39:07 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRWlGSWpSXmKPExsVybKJsh273Z79 wg/4+UYt7U96zOzB6bO/bxR7AGMWamZeUX5HAmrHzhGDBUu6KKztusDcwbuToYuTiEBKYyiix 6MIXNginn0li7YbFjF2MnBxsAoYSf59sYgOxRQQkJDY1rGACsZkFAiTOn3gFViMsECJx7st0s BoWAVWJN3smgcV5Bdwk5t9aDFYvISAncfLYZFYIO0NiXs8cKNtLYtGNS1C2msTVc5uYJzDyLG BkWMWoXpxaVJZapGukl1SUmZ5RkpuYmaNraGCql5taXJyYnpqTmFSsl5yfu4kR6HUGINjB+P2 P0yFGSQ4mJVFe3Q9+4UJ8SfkplRmJxRnxRaU5qcWHGDU4OAQ2r119gVGKJS8/L1VJgtfiI1Cd YFFqempFWmYOMCxhSiU4eJREeJtB0rzFBYm5xZnpEKlTjIpS4rw6IAkBkERGaR5cGywWLjHKS gnzMgIdJcRTkFqUm1mCKv+KUZyDUUmYdzvIFJ7MvBK46a+AFjMBLY7P8AFZXJKIkJJqYIxrYK 3OfCPQzrq/kXvOby/BC1OdKp7OY/o998jye/qtCWcnTfNYpNkrpCy0VfTvpZSCvNi9e4xY+K8 qnrktfk0hKLrk64u6xmW8WdG5yronT29PuL9r+qtUqSBXqfdxh3M3MKxZ0HKxvUT67a5Z80Ty +CP5nual5rRtiX2vdu5ZzKRKDX7DTCWW4oxEQy3mouJEAFZVCASAAgAA X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-7.tower-206.messagelabs.com!1464791944!42516954!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20236 invoked from network); 1 Jun 2016 14:39:06 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 1 Jun 2016 14:39:06 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC76C2040F; Wed, 1 Jun 2016 14:39:03 +0000 (UTC) Received: from localhost.localdomain (23.105.115.87.dyn.plus.net [87.115.105.23]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 545C8203E3; Wed, 1 Jun 2016 14:39:02 +0000 (UTC) From: Stefano Stabellini To: julien.grall@arm.com Date: Wed, 1 Jun 2016 15:38:51 +0100 Message-Id: <1464791931-29322-1-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 X-Virus-Scanned: ClamAV using ClamSMTP Cc: xen-devel@lists.xensource.com, wei.liu2@citrix.com, sstabellini@kernel.org Subject: [Xen-devel] [PATCH v2] xen/arm: warn the user that we cannot route SPIs to Dom0 on ACPI 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP as a consequence of 9d77b3c01d1261ce17c10097a1b393f2893ca657 being reverted. Signed-off-by: Stefano Stabellini Reviewed-by: Julien Grall --- Changes in v2: - fix typo - add log_once --- xen/arch/arm/vgic.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index ee35683..413ff16 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include @@ -342,9 +344,22 @@ void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n) unsigned long flags; int i = 0; struct vcpu *v_target; + struct domain *d = v->domain; while ( (i = find_next_bit(&mask, 32, i)) < 32 ) { irq = i + (32 * n); + /* Set the irq type and route it to guest only for SPI and Dom0 */ + if( irq_access_permitted(d, irq) && is_hardware_domain(d) && + ( irq >= 32 ) && ( !acpi_disabled ) ) + { + static int log_once = 0; + if ( !log_once ) + { + gprintk(XENLOG_WARNING, "Routing SPIs to Dom0 on ACPI systems is unimplemented.\n"); + log_once++; + } + } + v_target = __vgic_get_target_vcpu(v, irq); p = irq_to_pending(v_target, irq); set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);