From patchwork Tue Nov 17 09:40:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 56752 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1828030lbb; Tue, 17 Nov 2015 01:50:16 -0800 (PST) X-Received: by 10.31.41.65 with SMTP id p62mr2492599vkp.138.1447753815826; Tue, 17 Nov 2015 01:50:15 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id s18si2032740vkf.214.2015.11.17.01.50.15 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Nov 2015 01:50:15 -0800 (PST) Received-SPF: neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=50.57.142.19; Authentication-Results: mx.google.com; spf=neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zycss-0008ND-K5; Tue, 17 Nov 2015 09:49:06 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zycsr-0008LD-9N for xen-devel@lists.xen.org; Tue, 17 Nov 2015 09:49:05 +0000 Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id C6/CC-16618-F08FA465; Tue, 17 Nov 2015 09:49:03 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-6.tower-27.messagelabs.com!1447753742!3768308!1 X-Originating-IP: [74.125.82.51] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.19.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11254 invoked from network); 17 Nov 2015 09:49:02 -0000 Received: from mail-wm0-f51.google.com (HELO mail-wm0-f51.google.com) (74.125.82.51) by server-6.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Nov 2015 09:49:02 -0000 Received: by wmec201 with SMTP id c201so17378175wme.1 for ; Tue, 17 Nov 2015 01:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zEuoHhsp2HA4541HqIHTwj8bTQeZ+3e/gdvAfW9FR9A=; b=mzHuxyhKqMe0pxW9cAMx3J0k2nKB2A67d5I5rRs71b68sZ77evkUhx2D9o4BCKb1hA sc2L6bQtKWM4gTcoK4jdiRnw2cSdbPxyBcGi58tWQdU9Ivr1IiXNleX+zzTv8MExoFbJ J0mQq1jAkq1oUbW/OZIOqGoNSfhWfSU6nXJd15xbIpTh1IPMEUoJn6coUGEorIb6ykPd UnG8YztX6ecd1UWtkpxcRvR1xd2pWJW5tCcr3GDRw3Uuc4oT2xzIodLt8+C46nSSzi0Y HPZ53Etm21tx9gCm2au+IfXAKO/uPHlO3zJHi+O40NzGM16quRUih0Qr+qKxuhOhnpLv glYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zEuoHhsp2HA4541HqIHTwj8bTQeZ+3e/gdvAfW9FR9A=; b=h1aFFyHWqOr0yc4sEJd7jPX7TlYmlec3IUUtdtslEuhJND+CDAGLZ03AUcb6aNMjpu jywdpvAWmkAHXN/YGVJQyO3JBfHbRVn/R/qJHLTsugFZKqSCA8PWRTcNM/qEysrjMKQR TH2rClARu+5DrfsE11h6PBhEcZ+JMmpwSzJ4Kwl4t2mKvsegUoZbD7hzwbKhaRkRfQ23 2gbSZoSDA0dJsujuhxS6cQaIZhrw3AV/rkS7MABumBRe209s1EoxU5EPUWfLmbDXM8Eg 1OYIi01HtTWuWlGNxjdhkgpVUaHqfLGu4zZG5//9GtOP9upLrRXhsQ4BRGAG91SJPo6D QLaQ== X-Gm-Message-State: ALoCoQnZ048/w0pb5WL38gFDAgumIboQMWC8dOTw7BCg255JSWPAQ6ZYbuuQhk2GLb6rZjL8W1Uw X-Received: by 10.194.170.196 with SMTP id ao4mr31177869wjc.15.1447753742256; Tue, 17 Nov 2015 01:49:02 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id 186sm4474692wmv.9.2015.11.17.01.49.00 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:49:01 -0800 (PST) From: shannon.zhao@linaro.org To: ian.campbell@citrix.com, stefano.stabellini@citrix.com, keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, julien.grall@citrix.com, xen-devel@lists.xen.org Date: Tue, 17 Nov 2015 17:40:54 +0800 Message-Id: <1447753261-7552-56-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> References: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> Cc: mark.rutland@arm.com, hangaohuai@huawei.com, ard.biesheuvel@linaro.org, shannon.zhao@linaro.org, christoffer.dall@linaro.org, peter.huangpeng@huawei.com, david.vrabel@citrix.com, zhaoshenglong@huawei.com, linux-arm-kernel@lists.infradead.org, roger.pau@citrix.com Subject: [Xen-devel] [PATCH v3 55/62] arm/acpi: Route all Xen unused SPIs to Dom0 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org From: Shannon Zhao Route all SPIs to Dom0 except the interrupts that Xen uses. Since Xen already uses the uart interrupt, the desc->action will not be NULL, so it will skip it. Signed-off-by: Shannon Zhao --- xen/arch/arm/domain_build.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) -- 2.1.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 6d8536b..6945f89 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1360,6 +1360,35 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) #define XEN_HYPERVISOR_ID 0x000058656E564D4D /* "XenVMM" */ #define ACPI_DOM0_FDT_MIN_SIZE 4096 +static int acpi_route_spi(struct domain *d) +{ + int i, res; + struct irq_desc *desc; + + /* Don't route Xen used interrupt to Dom0. Since Xen already uses the uart + * interrupt, the desc->action will not be NULL, so it will skip it. + */ + for( i = NR_LOCAL_IRQS; i < vgic_num_irqs(d); i++ ) + { + /* Don't route uart interrupt to Dom0 */ + desc = irq_to_desc(i); + if( desc->action != NULL) + continue; + + vgic_reserve_virq(d, i); + irq_set_type(i, ACPI_IRQ_TYPE_NONE); + res = route_irq_to_guest(d, i, i, NULL); + if ( res ) + { + printk(XENLOG_ERR "Unable to route IRQ %u to domain %u\n", + i, d->domain_id); + continue; + } + } + + return 0; +} + static int make_chosen_node(const struct kernel_info *kinfo, struct membank tbl_add[]) { @@ -1897,6 +1926,10 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo) if ( rc != 0 ) return rc; + rc = acpi_route_spi(d); + if ( rc != 0 ) + return rc; + return 0; } #else