From patchwork Tue Sep 12 10:03:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 112271 Delivered-To: patch@linaro.org Received: by 10.80.202.13 with SMTP id d13csp5674341edi; Tue, 12 Sep 2017 03:05:39 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBgoujxZQ3WyA0mHqX3Q2CtztppBwYXEduqnuC891WahAZeFrnBM0b0BmmBIK87DM8fPCru X-Received: by 10.36.9.206 with SMTP id 197mr212445itm.77.1505210739279; Tue, 12 Sep 2017 03:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505210739; cv=none; d=google.com; s=arc-20160816; b=BwHvN10+8mW8Ghb71vGJhFxP7xzov0SaimLJmLIjukNzgNBUdTsM34Z1n6G15iSndA hq1m8uKLTEIPcv0JEbM/zIrDjZLIs2QG/Su7PVmq0ad1tn3E46tEPcRrED7U8MSZF1Dv ajAU/4ACM8cVfOoFYkhWt7Gy65XH1yJN7qQ3xoktoyNG+WlSKu8xwEXAFpuSyoUuH7ga Dn1KEQIcCUJdyyNC9i2NHDqbsWbB7hYTfPwbjptnWxIcjfzb1gk1fOBeH53pApqfUyad NXXcwR6hVbYU5B95XgcunUqn157ZE9dzU3hqmVPZ5bMnETUZR0nilLisMcere1tdhuQO 6zQw== 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=LBXMZ5MKhJyKxTY4DTzQ55I+xGlIv+j7kpTInLoA9HE=; b=ojdp7QwXQQnb0si+tmw9Wpzm51DWSjcX3jLZYzvJuKAo8yssK3iHfC1tBtUzD2UdLv H/fRkI+SB+4ZO3gac3dH+Ewp5qtQ0H37lduAa+tS2j47RxosC7MOcX1uyV12bYpDQ34o J02uC9Jugvr/esFDLlpkB3hcp3tvfafKp7dtWO7v1dJqZ5lXqbY3a32jGEVsNjzLOqdT /grmz/wd+vX5oEm1sLA/TdtToTvTybVGMQo5WWeqLY+GoL9af6GrD49x1aDAYhG+NPxK dg9Ej8Jed4JaFcMY9v1h+ipDaGta5Lx94BaSLar42xlga5FB2BOz/L0uguL+sv5m+ohg hO6w== 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 t125si10580640itg.166.2017.09.12.03.05.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 03:05:39 -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 1dri2o-0002tL-OP; Tue, 12 Sep 2017 10:03:50 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dri2n-0002rb-Eg for xen-devel@lists.xen.org; Tue, 12 Sep 2017 10:03:49 +0000 Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id 20/FC-01910-401B7B95; Tue, 12 Sep 2017 10:03:48 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsVysyfVTZdl4/Z Ig2mLGS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oxXm1vYCl7wVly9+oWtgXEjVxcjF4eQwGZG iSc/TrFCOKcZJZa0rwZyODnYBDQl7nz+xARiiwhIS1z7fJkRxGYWiJQ4/OEHO4gtLOAhseHUD 2YQm0VAVeL8+uVsIDavgIXEit+HwOISAvISu9ougs3kFLCUWPHxF1iNEFDN95c/GCcwci9gZF jFqFGcWlSWWqRraK6XVJSZnlGSm5iZo2toYKyXm1pcnJiempOYVKyXnJ+7iRHoYQYg2MH48rT nIUZJDiYlUd4j67dHCvEl5adUZiQWZ8QXleakFh9ilOHgUJLgPQ+SEyxKTU+tSMvMAYYaTFqC g0dJhHc2SJq3uCAxtzgzHSJ1ilGXo+Pm3T9MQix5+XmpUuK8GSBFAiBFGaV5cCNgYX+JUVZKm JcR6CghnoLUotzMElT5V4ziHIxKwrzxIFN4MvNK4Da9AjqCCegInktbQI4oSURISTUwriq34n K8FuC18ox+a374is/3nCytpMXKOzpNutiCtiaWTbkovINpLs/kh1yvksTr+mIrfMXZTB/uujw h/VVoHGPczP2ekbdX23kueGsq5XrPryd09wWBhUbzTd/4asvM2MLa/urZ9tdRayb+LTb8+CC0 RV38gK39JFnZ88u7HXfwbb+zVOSsEktxRqKhFnNRcSIALpThAHYCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1505210627!114366351!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 53730 invoked from network); 12 Sep 2017 10:03:47 -0000 Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-3.tower-31.messagelabs.com with SMTP; 12 Sep 2017 10:03:47 -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 42D111529; Tue, 12 Sep 2017 03:03:47 -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 548CB3F578; Tue, 12 Sep 2017 03:03:46 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 12 Sep 2017 11:03:12 +0100 Message-Id: <20170912100330.2168-7-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170912100330.2168-1-julien.grall@arm.com> References: <20170912100330.2168-1-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH v2 06/24] 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 HIFAR. See D7.2.30 in ARM DDI 0487B.a. Open-code the alias instead. Signed-off-by: Julien Grall Reviewed-by: Andre Przywara --- Changes in v2: - Fix register name in the commit message - Add Andre's reviewed-by --- 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 7f6ec15b5e..967bfea4ed 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2579,11 +2579,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