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: 9161839 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 F2C5360571 for ; Tue, 7 Jun 2016 16:09:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2C7A27248 for ; Tue, 7 Jun 2016 16:09:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4FA028179; Tue, 7 Jun 2016 16:09:08 +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 D84B42723E for ; Tue, 7 Jun 2016 16:09:07 +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 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" X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Stefano Stabellini --- 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