From patchwork Tue Oct 17 21:32:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 10012973 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 2CA9260235 for ; Tue, 17 Oct 2017 21:35:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FAB828A3D for ; Tue, 17 Oct 2017 21:35:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1436E28A5A; Tue, 17 Oct 2017 21:35:14 +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 98D9028A4D for ; Tue, 17 Oct 2017 21:35:12 +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 1e4ZTo-00070B-1B; Tue, 17 Oct 2017 21:32:52 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4ZTm-000704-H2 for xen-devel@lists.xen.org; Tue, 17 Oct 2017 21:32:50 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id 41/49-05363-10776E95; Tue, 17 Oct 2017 21:32:49 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRWlGSWpSXmKPExsVybKJssi5D+bN Ig8OzuSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ox/e5pZCpZzVbybdIGtgfEoRxcjF4eQQD+T xNTbs1m7GDk4WAQcJJaeUAQxGQViJB78sO5i5AQywyQmX17CCmKzCGhLrLj6mAnEZhMwlPj7Z BMbSLkEkL3kMwdIWERAWuLa58uMIDazgIHEsa6VYLawgKvE9Al3wMbwCnhLnJ1+jAXEFhXQlT j07w8bRFxQ4uTMJywQvVoSy6dvY5nAyDcLSWoWktQCRqZVjBrFqUVlqUW6hiZ6SUWZ6RkluYm ZObqGBsZ6uanFxYnpqTmJScV6yfm5mxiBAcUABDsYV2z3PMQoycGkJMrrbPgkUogvKT+lMiOx OCO+qDQntfgQowwHh5IE7/fSZ5FCgkWp6akVaZk5wNCGSUtw8CiJ8PKUAaV5iwsSc4sz0yFSp xh1ORb03PjDJMSSl5+XKiXOywpSJABSlFGaBzcCFmeXGGWlhHkZgY4S4ilILcrNLEGVf8Uozs GoJMwrATKFJzOvBG7TK6AjmICOWOf0BOSIkkSElFQDo9SiByzNInluLQpSr9v2/Hq1fkWSQNK i61s4ffdI33nDZ8DS276gL+7ilW3s9rdWFmjdCY0Q0nGXFpL4taw2ONtf8HPJmwnbzrbb/eDj zhRe8o7l353MsNqqyw7eLJeuOKUuv/M1136i+Un1sGjWUv4NEVzdnwrq53t9TzO7eTO2JGbdx /rlSizFGYmGWsxFxYkAJcyQQ64CAAA= X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-15.tower-31.messagelabs.com!1508275966!106673517!1 X-Originating-IP: [198.145.29.99] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14644 invoked from network); 17 Oct 2017 21:32:48 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.99) by server-15.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 17 Oct 2017 21:32:48 -0000 Received: from [10.0.0.56] (c-24-130-70-9.hsd1.ca.comcast.net [24.130.70.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B0DB421871; Tue, 17 Oct 2017 21:32:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0DB421871 Date: Tue, 17 Oct 2017 14:32:45 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: xen-devel@lists.xen.org Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Cc: julien.grall@arm.com, sstabellini@kernel.org Subject: [Xen-devel] [PATCH] arm: configure interrupts to be in non-secure group1 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 Xen uses non-secure group1 interrupts, however it doesn't configure the GICv3 accordingly. Xen needs to set GICD_IGROUPR for SPIs and GICR_IGROUPR0 for local interrupt to "1" to specify that interrupts belong to group1. This is particularly important if the system has GICD_CTLR.DS set, also see commit 7c9b973061b03af62734f613f6abec46c0dd4a88 in Linux. Signed-off-by: Stefano Stabellini --- This is a candidate for stable backports. diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 74d00e0..196cfc5 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -569,6 +569,9 @@ static void __init gicv3_dist_init(void) for ( i = NR_GIC_LOCAL_IRQS; i < nr_lines; i += 32 ) writel_relaxed(0xffffffff, GICD + GICD_ICENABLER + (i / 32) * 4); + for ( i = NR_GIC_LOCAL_IRQS; i < nr_lines; i += 32 ) + writel_relaxed(0xffffffff, GICD + GICD_IGROUPR + (i / 32) * 4); + gicv3_dist_wait_for_rwp(); /* Turn on the distributor */ @@ -775,6 +778,7 @@ static int gicv3_cpu_init(void) */ writel_relaxed(0xffff0000, GICD_RDIST_SGI_BASE + GICR_ICENABLER0); writel_relaxed(0x0000ffff, GICD_RDIST_SGI_BASE + GICR_ISENABLER0); + writel_relaxed(0xffffffff, GICD_RDIST_SGI_BASE + GICR_IGROUPR0); gicv3_redist_wait_for_rwp();