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: 110021 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp4281882obb; Mon, 14 Aug 2017 07:26:34 -0700 (PDT) X-Received: by 10.36.146.11 with SMTP id l11mr6195811itd.159.1502720793989; Mon, 14 Aug 2017 07:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502720793; cv=none; d=google.com; s=arc-20160816; b=rnNZ/7l1rXuIS/YHvDu+0EKcmiecxrxMdLXJ1b47SaRWtPzjIe6PbKwhgCJk/OkHQW rBHbxWgulqk1f2ou3GJJ4pdGWxkQ7ARQpi4/i2LVZyHXsJvkk3BOOu1XREqpy7Z7YfoX fkBHi5IL5qZXdLdC4/Y0/MyR/di96EDEieaIy7X/0ECe4t+JrQ5YkC++PR7TV0kSGzIg omG8kO34vyIpIO44kG2rQ/unB1GmG+WHKkt4Ov2rBK/QV72cBQQmXYxBRSXFi8IX5Peq 41fA4wFehXdYPq6UK1VN8IWlxohrSq6//AG6Zzw0RZIflYTIrx2m3T9zeNIVjH4RQDGu SW4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=XkmVPCN13fb/VDSWit+e6FdctiMYqw5D5WSCXOePlHo=; b=S3l+31lpR+wiJo7BG+THl1nleyrnWkgg4yoHrBqs0yYvyX6Qeq1IMwj/VPhka1dT/Z ICMp2ClI8n83b+HRZn8R6N0D87kAt5iv4rNAdXd+SXbwrhkXEHROwzl3hlqGCYAOFATP yzNx7bqKX9w88VvhWsHjsJrixHlrEMRvLPYW1JMqPju0VW6tl+DnuJvvzeKiYTzdR5An KvkUT9DBsCP52lotR95qHc/DoLjc/ReJvCukgy8PNS3p2aASq6h/y+483HhMB5PYKYVt 74K30pWVzxcIIRCyVnrHmfcn75SrpiGuNqB5Hz6dWLAMXtk6sGdCDa5CcZjwY8jsT8G7 H+MQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 7si4909258iti.114.2017.08.14.07.26.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Aug 2017 07:26:33 -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 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" 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