From patchwork Mon Aug 14 14:24:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 9899047 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 F3D5D602CA for ; Mon, 14 Aug 2017 14:27:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E69A5205F7 for ; Mon, 14 Aug 2017 14:27:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB64D284D1; Mon, 14 Aug 2017 14:27:24 +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 EEEC52867B for ; Mon, 14 Aug 2017 14:27:18 +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 1dhGIR-0000O7-GF; Mon, 14 Aug 2017 14:24:47 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhGIQ-0000Ma-Es for xen-devel@lists.xen.org; Mon, 14 Aug 2017 14:24:46 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id A6/BA-03612-DA2B1995; Mon, 14 Aug 2017 14:24:45 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRWlGSWpSXmKPExsVysyfVTXftpom RBstm8lss+biYxYHR4+ju30wBjFGsmXlJ+RUJrBmL/zWzF5zkqWha/I2lgXE3ZxcjF4eQwGZG iZWn25i6GDmBnNOMEmsnOYDYbAKaEnc+fwKLiwhIS1z7fJkRxGYWiJQ4/OEHO4gtLOAq8WLuC jYQm0VAVeLXug1gcV4BK4lpX6axgtgSAvISu9ougtmcQPHOuztZIHZZSpxYPZttAiP3AkaGVY waxalFZalFukameklFmekZJbmJmTm6hgZmermpxcWJ6ak5iUnFesn5uZsYgf5lAIIdjKsWBB5 ilORgUhLlTfDpjRTiS8pPqcxILM6ILyrNSS0+xCjDwaEkwXtj48RIIcGi1PTUirTMHGCgwaQl OHiURHhFgMEmxFtckJhbnJkOkTrFqMvxasL/b0xCLHn5ealS4ryvNgAVCYAUZZTmwY2ABf0lR lkpYV5GoKOEeApSi3IzS1DlXzGKczAqCfNeXQ80hSczrwRu0yugI5iAjugDuZ+3uCQRISXVwM ihGTjdWrZzl/uGGblLUpllj0oEuJi6b14nevfpmQRdVv8pTUrrdK9Yae1OrHNct0SR1am56qq 1w4qlsV1KWZ9fP474Hsf/csoc0Z1MxzPfr6l+uMTr1PuSHyG3Zdvbfmp5MS+LWGs492uLoe6+ TxqH9vGselX/Qd35C+d8zdw3Ahn2V9Yd+KnEUpyRaKjFXFScCACI/ueudQIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-5.tower-27.messagelabs.com!1502720684!106249368!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.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8774 invoked from network); 14 Aug 2017 14:24:45 -0000 Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-5.tower-27.messagelabs.com with SMTP; 14 Aug 2017 14:24:45 -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 8AB0E1713; Mon, 14 Aug 2017 07:24:44 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9F1673F483; Mon, 14 Aug 2017 07:24:43 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 14 Aug 2017 15:24:00 +0100 Message-Id: <20170814142418.13267-10-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170814142418.13267-1-julien.grall@arm.com> References: <20170814142418.13267-1-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH 09/27] xen/arm: traps: Don't define FAR_EL2 for ARM32 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 Aliasing FAR_EL2 to HIFAR makes the code confusing because on ARMv8 FAR_EL2[31:0] is architecturally mapped to HDFAR and FAR_EL2[63:32] to FAR_EL2. See D7.2.30 in ARM DDI 0487B.a. Open-code the alias instead. Signed-off-by: Julien Grall Reviewed-by: Andre Przywara --- xen/arch/arm/traps.c | 8 +++++++- xen/include/asm-arm/cpregs.h | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index c07999b518..498d8c594a 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2560,11 +2560,17 @@ static void do_trap_instr_abort_guest(struct cpu_user_regs *regs, const union hsr hsr) { int rc; - register_t gva = READ_SYSREG(FAR_EL2); + register_t gva; uint8_t fsc = hsr.iabt.ifsc & ~FSC_LL_MASK; paddr_t gpa; mfn_t mfn; +#ifdef CONFIG_ARM_32 + gva = READ_CP32(HIFAR); +#else + gva = READ_SYSREG64(FAR_EL2); +#endif + /* * If this bit has been set, it means that this instruction abort is caused * by a guest external abort. We can handle this instruction abort as guest diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h index af45ec7a65..1889d7cbfb 100644 --- a/xen/include/asm-arm/cpregs.h +++ b/xen/include/asm-arm/cpregs.h @@ -307,7 +307,6 @@ #define ESR_EL1 DFSR #define ESR_EL2 HSR #define FAR_EL1 HIFAR -#define FAR_EL2 HIFAR #define HCR_EL2 HCR #define HPFAR_EL2 HPFAR #define HSTR_EL2 HSTR