From: Julien Grall Subject: [PATCH for 4.5] xen/arm64: Make show_registers working even if current is not correctly set Date: Tue, 30 Sep 2014 15:56:53 +0100 Message-ID: <1412089013-404-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XYyvr-00036k-Qb for xen-devel@lists.xenproject.org; Tue, 30 Sep 2014 15:01:39 +0000 Received: by mail-wi0-f178.google.com with SMTP id ho1so4627283wib.11 for ; Tue, 30 Sep 2014 07:57:02 -0700 (PDT) List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org The commit 8ab802c "xen/arm: Restricted access to IFSR32_EL2 and FPEXC32_EL2" introduced the use of the variable current in show_registers. The variable is not correctly set until Xen has finished to boot. Therefore any call to show_registers will result to crash Xen. As the register IFSR32_EL2 is only printed when the registers represent a guest view, Xen can read the value only for this case. Signed-off-by: Julien Grall --- This is a bug fix for Xen 4.5. --- xen/arch/arm/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index cda0523..4b4b4e0 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -790,7 +790,7 @@ void show_registers(struct cpu_user_regs *regs) #else ctxt.far = READ_SYSREG(FAR_EL1); ctxt.esr_el1 = READ_SYSREG(ESR_EL1); - if ( is_32bit_domain(current->domain) ) + if ( guest_mode(regs) && is_32bit_domain(current->domain) ) ctxt.ifsr32_el2 = READ_SYSREG(IFSR32_EL2); #endif ctxt.vttbr_el2 = READ_SYSREG64(VTTBR_EL2); -- 1.7.10.4