From patchwork Thu Jun 19 14:02:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 32225 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 93382206A0 for ; Thu, 19 Jun 2014 14:04:34 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id j17sf15929355oag.0 for ; Thu, 19 Jun 2014 07:04:34 -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=gqjshMh4ajrUdlsGTvWIRZFplb05Kt74wZD6hbDa74A=; b=TSW7aUGaKE1zOlwHEuCBiN6PhXVfy2X30IFMZU4XKMalX8ECRFmaY5LhYo0pRBOeq+ 34/+HB/rxfdda+bwoyUqTuc9k15zj7e/sP9CTAVc2cX3GtxHGf+2yinLssDieXlN/ZK1 p+nrDwukxXfgYyoHrlEA8ENMy5pT3D41UVh9TMAQycikKT+zRmBWk40SndcsiB/xsz01 hdKDAM6mU9TecdcsVpKv3qagCNdgubdvlQaaBIilPccn+DYY42f9WriqyLy47SIWbDoj WbLnTe8xfGep+BigOBYWkfLFKmeZbhvAt1jhD23Df5XKD7lNp/Azr4uqxZCagEsE6DXz LqQw== X-Gm-Message-State: ALoCoQlLPvzfmSEwaK4zTtfrAW7Eh3W8qJ2aWZFBHMQSFarILII59MImfcp7RRhpqvYpotSRjUAZ X-Received: by 10.50.170.162 with SMTP id an2mr4118647igc.4.1403186674148; Thu, 19 Jun 2014 07:04:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.10 with SMTP id l10ls561670qga.72.gmail; Thu, 19 Jun 2014 07:04:34 -0700 (PDT) X-Received: by 10.221.58.144 with SMTP id wk16mr4062821vcb.23.1403186674042; Thu, 19 Jun 2014 07:04:34 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id fu13si2401458vdb.105.2014.06.19.07.04.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Jun 2014 07:04:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.175 as permitted sender) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id jx11so2314918veb.6 for ; Thu, 19 Jun 2014 07:04:34 -0700 (PDT) X-Received: by 10.220.44.141 with SMTP id a13mr414653vcf.71.1403186673970; Thu, 19 Jun 2014 07:04:33 -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.221.54.6 with SMTP id vs6csp364260vcb; Thu, 19 Jun 2014 07:04:33 -0700 (PDT) X-Received: by 10.140.44.72 with SMTP id f66mr6609138qga.78.1403186673472; Thu, 19 Jun 2014 07:04:33 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id d69si6478020qgd.88.2014.06.19.07.04.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Jun 2014 07:04:33 -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 1WxcvA-0007sd-Bn; Thu, 19 Jun 2014 14:02:32 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wxcv8-0007sT-S1 for xen-devel@lists.xenproject.org; Thu, 19 Jun 2014 14:02:31 +0000 Received: from [193.109.254.147:16395] by server-16.bemta-14.messagelabs.com id 00/EE-16986-67DE2A35; Thu, 19 Jun 2014 14:02:30 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-2.tower-27.messagelabs.com!1403186549!12378442!1 X-Originating-IP: [74.125.82.42] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6187 invoked from network); 19 Jun 2014 14:02:29 -0000 Received: from mail-wg0-f42.google.com (HELO mail-wg0-f42.google.com) (74.125.82.42) by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 19 Jun 2014 14:02:29 -0000 Received: by mail-wg0-f42.google.com with SMTP id z12so2303991wgg.13 for ; Thu, 19 Jun 2014 07:02:29 -0700 (PDT) X-Received: by 10.180.187.111 with SMTP id fr15mr6299730wic.57.1403186549191; Thu, 19 Jun 2014 07:02:29 -0700 (PDT) Received: from belegaer.uk.xensource.com ([185.25.64.249]) by mx.google.com with ESMTPSA id ch5sm65980wjb.18.2014.06.19.07.02.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jun 2014 07:02:28 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 19 Jun 2014 15:02:16 +0100 Message-Id: <1403186536-17770-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, Naresh Bhat Subject: [Xen-devel] [PATCH v2] xen/arm: Init traps very early 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.128.175 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 function init_traps setups the handler taken when Xen hits a BUG_ON/ASSERT. If an error happen before init_traps is called, we loose the backtrace. When a trap is taken from HYP mode, we need to: - get the processor ID, percpu has to be initialized and the smp_processor_id correctly set. - initialize current, even tho it's not used for the time being. Move the debug sanity ealier. Signed-off-by: Julien Grall Tested-by: Naresh Bhat --- Changes in v2: - Update a comment in the code to explain why we need to be set early. - Move the call after smp_processor_id as it's requires to be there. - Move set_current(...) ealier --- xen/arch/arm/setup.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index b9ce7a9..8c505cb 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -670,6 +670,12 @@ void __init start_xen(unsigned long boot_phys_offset, percpu_init_areas(); set_processor_id(0); /* needed early, for smp_processor_id() */ + set_current((struct vcpu *)0xfffff000); /* debug sanity */ + idle_vcpu[0] = current; + + /* Initialize traps early allow us to get backtrace when an error occured */ + init_traps(); + smp_clear_cpu_maps(); /* This is mapped by head.S */ @@ -706,11 +712,6 @@ void __init start_xen(unsigned long boot_phys_offset, gic_init(); - set_current((struct vcpu *)0xfffff000); /* debug sanity */ - idle_vcpu[0] = current; - - init_traps(); - setup_virt_paging(); p2m_vmid_allocator_init();