From patchwork Tue Sep 30 14:56:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 38161 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1DEE020549 for ; Tue, 30 Sep 2014 15:03:41 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id n15sf5739218lbi.3 for ; Tue, 30 Sep 2014 08:03:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-post:list-help :list-subscribe:mime-version:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive :content-type:content-transfer-encoding; bh=Dn2O0HMziTWvvCdkN+g8ADEU2a3O+B4fZLvmi9jSOtc=; b=k5lNDzd7W7tlPcFppAXXj9KA2VoNfoqbuDIytikHRugFhtv/pw6EYgkNQoBqgIMfKb Xd3+KqVS1ed9lFb+TQQrQkBtIF4BQR8YjKe/lqAFx9KX+XA2yrH4gh6hvth7IgHEYwZx f6a2B05OQaRyMfZwav1tyFlo7VdGpXrNVU7RnVMtGtwIrFBn9eidIc0HZlvMFr4kwmyg Z6uEx1VUpO/39iGmYoNgKSAz7MpFX1/S0ZO6r5ywRRRNy9SmZmKNVOvG0IMHSo9ZbSVD E9IoxS0SrfJBbJHeY7ZflMIdmkAFWuhNzxz7YWdK1GEVHDyRxu5WQzeJghgDYtdB2NXX YUwA== X-Gm-Message-State: ALoCoQn4DhtKxKBqUJ9iCFuYiHwYsVMYs0ZHwukM73a+cvbYcNF2iT/mTm7fDmMHDwRqkTfaFVxS X-Received: by 10.112.17.3 with SMTP id k3mr4174164lbd.3.1412089420881; Tue, 30 Sep 2014 08:03:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.73 with SMTP id q9ls50317laq.27.gmail; Tue, 30 Sep 2014 08:03:40 -0700 (PDT) X-Received: by 10.152.170.227 with SMTP id ap3mr47803639lac.15.1412089420676; Tue, 30 Sep 2014 08:03:40 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com [209.85.215.50]) by mx.google.com with ESMTPS id wv4si23068169lbb.123.2014.09.30.08.03.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 08:03:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id s18so4776490lam.37 for ; Tue, 30 Sep 2014 08:03:40 -0700 (PDT) X-Received: by 10.112.134.229 with SMTP id pn5mr19344847lbb.22.1412089420275; Tue, 30 Sep 2014 08:03:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp365350lbb; Tue, 30 Sep 2014 08:03:39 -0700 (PDT) X-Received: by 10.52.158.8 with SMTP id wq8mr970781vdb.88.1412089419427; Tue, 30 Sep 2014 08:03:39 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id i75si12811772qge.103.2014.09.30.08.03.36 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 30 Sep 2014 08:03:37 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XYyvt-00036p-3w; Tue, 30 Sep 2014 15:01:41 +0000 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: from [85.158.137.68:49590] by server-2.bemta-3.messagelabs.com id 7F/BC-09149-2D5CA245; Tue, 30 Sep 2014 15:01:38 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-16.tower-31.messagelabs.com!1412089022!12970482!1 X-Originating-IP: [209.85.212.178] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23956 invoked from network); 30 Sep 2014 14:57:02 -0000 Received: from mail-wi0-f178.google.com (HELO mail-wi0-f178.google.com) (209.85.212.178) by server-16.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 30 Sep 2014 14:57:02 -0000 Received: by mail-wi0-f178.google.com with SMTP id ho1so4627283wib.11 for ; Tue, 30 Sep 2014 07:57:02 -0700 (PDT) X-Received: by 10.180.19.193 with SMTP id h1mr6498007wie.14.1412089021911; Tue, 30 Sep 2014 07:57:01 -0700 (PDT) Received: from belegaer.uk.xensource.com ([185.25.64.249]) by mx.google.com with ESMTPSA id cy10sm19491323wjb.21.2014.09.30.07.57.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Sep 2014 07:57:01 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 30 Sep 2014 15:56:53 +0100 Message-Id: <1412089013-404-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH for 4.5] xen/arm64: Make show_registers working even if current is not correctly set X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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 Acked-by: Ian Campbell --- 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);