From patchwork Wed Jan 18 18:54:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 91824 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1157947qgi; Wed, 18 Jan 2017 10:56:05 -0800 (PST) X-Received: by 10.107.136.40 with SMTP id k40mr4675449iod.99.1484765765665; Wed, 18 Jan 2017 10:56:05 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id u22si2388826iou.166.2017.01.18.10.56.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2017 10:56:05 -0800 (PST) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 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 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTvND-0006Nd-Le; Wed, 18 Jan 2017 18:54:19 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTvNC-0006NV-4G for xen-devel@lists.xen.org; Wed, 18 Jan 2017 18:54:18 +0000 Received: from [193.109.254.147] by server-4.bemta-6.messagelabs.com id 29/9B-25093-9D9BF785; Wed, 18 Jan 2017 18:54:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPLMWRWlGSWpSXmKPExsVysyfVTffGzvo Ig52TdCyWfFzM4sDocXT3b6YAxijWzLyk/IoE1owvT44yF7xjr3jYs4ClgfEkWxcjF4eQwCZG iX0fL7FCOKcZJZ48v8fcxcjJwSagKXHn8ycmEFtEQFri2ufLjCA2s4CDxJuP91hAbGGBJInOi 6vA4iwCqhIH921nB7F5BVwkPnV9AbMlBOQkTh6bzDqBkXMBI8MqRo3i1KKy1CJdI1O9pKLM9I yS3MTMHF1DAzO93NTi4sT01JzEpGK95PzcTYxAjzEAwQ7GVQsCDzFKcjApifKaramPEOJLyk+ pzEgszogvKs1JLT7EKMPBoSTB27oDKCdYlJqeWpGWmQMMHZi0BAePkgjvdZA0b3FBYm5xZjpE 6hSjopQ472SQhABIIqM0D64NFq6XGGWlhHkZgQ4R4ilILcrNLEGVf8UozsGoJMwrAQx+IZ7Mv BK46a+AFjMBLbZSBltckoiQkmpgnL9y4/wdL2ONryzIqTt/I+ZWvz/ba7mvXELNv5OLlOb2s8 21XHLTadpmvzUae95HrwqMZRZLlOHSWlGuosGW2Gc4P32aN7/lCubzUdxhR91/tJrtliw6u/f xu/3+60RmMax29ugXUGhKO/BDYIHH5ycVt/z3XpGSrn9uZHUxbc90nlNs66VSlViKMxINtZiL ihMB/4+i1FICAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1484765656!82268298!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42720 invoked from network); 18 Jan 2017 18:54:16 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-16.tower-27.messagelabs.com with SMTP; 18 Jan 2017 18:54:16 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6FC15707; Wed, 18 Jan 2017 10:54:15 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.218.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D2C783F3D6; Wed, 18 Jan 2017 10:54:14 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 18 Jan 2017 18:54:08 +0000 Message-Id: <1484765648-32493-1-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 Cc: Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH] xen/arm: gic-v3: Make sure read from ICC_IAR1_EL1 is visible on the redistributor 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" >From the GICv3 spec (IHI069C) section 4.1.1: "The effects of reading ICC_IAR0_EL1 and ICC_IAR1_EL1 on the state of a returned INTID are not guaranteed to be visible until after the execution of a DSB". Because of the GIC is an external component, a dsb sy is required. Without it the sysreg read may not have been made visible on the redistributor. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- This patch should be backported up to Xen 4.6. --- xen/arch/arm/gic-v3.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 57ed9d9..955591b 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -459,7 +459,11 @@ static void gicv3_dir_irq(struct irq_desc *irqd) static unsigned int gicv3_read_irq(void) { - return READ_SYSREG32(ICC_IAR1_EL1); + unsigned int irq = READ_SYSREG32(ICC_IAR1_EL1); + + dsb(sy); + + return irq; } static inline uint64_t gicv3_mpidr_to_affinity(int cpu)