From patchwork Tue Jun 7 16:06:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 69532 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2056759qgf; Tue, 7 Jun 2016 09:08:46 -0700 (PDT) X-Received: by 10.176.68.162 with SMTP id n31mr82986uan.150.1465315703366; Tue, 07 Jun 2016 09:08:23 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id f4si6846645vkd.135.2016.06.07.09.08.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 09:08:23 -0700 (PDT) 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 1bAJWq-0002eS-IG; Tue, 07 Jun 2016 16:06:56 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAJWp-0002bc-4F for xen-devel@lists.xen.org; Tue, 07 Jun 2016 16:06:55 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id F9/DA-24626-E11F6575; Tue, 07 Jun 2016 16:06:54 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTVf2Y1i 4wZwWM4slHxezODB6HN39mymAMYo1My8pvyKBNWPe3stsBb+FK/5cec3cwPicr4uRi0NIYAOj xKaWM6wQzmlGiY5zLcxdjJwcbAKaEnc+f2ICsUUEpCWufb7MCGIzCzQzSiw84NfFyMEhLOAj0 TM7EyTMIqAqMeVpFyuIzSvgInG3fRNYuYSAnMTJY5PB4pxA8bYHj9hAbCEBZ4mlvxoYJzByL2 BkWMWoUZxaVJZapGtooZdUlJmeUZKbmJmja2hgqpebWlycmJ6ak5hUrJecn7uJEehfBiDYwdi 03fMQoyQHk5Io7+dnYeFCfEn5KZUZicUZ8UWlOanFhxhlODiUJHgL3wHlBItS01Mr0jJzgIEG k5bg4FES4c0CSfMWFyTmFmemQ6ROMSpKifPqgCQEQBIZpXlwbbDgvsQoKyXMywh0iBBPQWpRb mYJqvwrRnEORiVhXjOQKTyZeSVw018BLWYCWrzsWjDI4pJEhJRUA6PAzNj6eNEdE5f+ToxYnT LhT6DCF53aRbMvTGj9LRi3t1tYbtLm9mf18+070kRqJ1+b8Njn5u8U0xtifxcuzbTfWd4dE2X v13xEzvhE3LVen9y45v25AvZNXvYVFRcd7MPd317qNH0Y6Zy6kz3v6e3JExOz7814cEqnocLt 1eb17LY9e9ZM4lFiKc5INNRiLipOBAAJ9o+qaQIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1465315613!27641107!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30063 invoked from network); 7 Jun 2016 16:06:53 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-2.tower-206.messagelabs.com with SMTP; 7 Jun 2016 16:06:53 -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 9BAF9F; Tue, 7 Jun 2016 09:07:27 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.215.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 173693F21A; Tue, 7 Jun 2016 09:06:51 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 7 Jun 2016 17:06:23 +0100 Message-Id: <1465315583-1278-17-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465315583-1278-1-git-send-email-julien.grall@arm.com> References: <1465315583-1278-1-git-send-email-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org, wei.chen@arm.com, steve.capper@arm.com Subject: [Xen-devel] [PATCH v3 16/16] xen/arm: arm64: Document Cortex-A57 erratum 834220 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" The ARM erratum applies to certain revisions of Cortex-A57. The processor may report a Stage 2 translation fault as the result of Stage 1 fault for load crossing a page boundary when there is a permission fault or device memory fault at stage 1 and a translation fault at Stage 2. So Xen needs to check that Stage 1 translation does not generate a fault before handling the Stage 2 fault. If it is a Stage 1 translation fault, return to the guest to let the processor injecting the correct fault. Only document it as this is already the behavior of the fault handlers. Note that some optimization could be done to avoid unnecessary translation fault. This is because HPFAR_EL2 is valid for more use case. For the moment, the code is left unmodified. Signed-off-by: Julien Grall --- Changes in v3: - s/unecessary/unnecessary - Rationalize the comment in the code. The full description can be found either in the errata document or in the commit message. --- docs/misc/arm/silicon-errata.txt | 1 + xen/arch/arm/traps.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt index 4b2c7c6..d620c2e 100644 --- a/docs/misc/arm/silicon-errata.txt +++ b/docs/misc/arm/silicon-errata.txt @@ -47,3 +47,4 @@ stable hypervisors. | ARM | Cortex-A53 | #819472 | ARM64_ERRATUM_819472 | | ARM | Cortex-A57 | #852523 | N/A | | ARM | Cortex-A57 | #832075 | ARM64_ERRATUM_832075 | +| ARM | Cortex-A57 | #834220 | N/A | diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 175033b..757be27 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2394,6 +2394,10 @@ static void do_trap_instr_abort_guest(struct cpu_user_regs *regs, .kind = hsr.iabt.s1ptw ? npfec_kind_in_gpt : npfec_kind_with_gla }; + /* + * Erratum #834220: Check Stage 1 translation does not generate + * a fault first! + */ if ( hsr.iabt.s1ptw ) gpa = get_faulting_ipa(); else @@ -2443,6 +2447,10 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs, info.gva = READ_SYSREG64(FAR_EL2); #endif + /* + * Erratum #834220: Check Stage 1 translation does not generate + * a fault first! + */ if ( dabt.s1ptw ) info.gpa = get_faulting_ipa(); else