From patchwork Wed Jul 24 17:01:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 18550 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8AB7225E5F for ; Wed, 24 Jul 2013 17:02:46 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id d41sf458243eek.7 for ; Wed, 24 Jul 2013 10:02:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=p1M7iqcCrCxbCm0zjYWJv5jQV+qdQlcN0quZgDBFVtk=; b=ChkJGwQAUt18So+mFf+VNJGCDQ9kjfQc2kVOROoKVZ/j0IP87WMnOmTQBvCjPtKOYy 25BYa1zu6tcSKcfandbDai80Gl3ZFM7aBLuT8ShMy3wezJgOhaztjU77fctzXKqdgptA E2033OJMBDVR7xl0F/MYBE4qgBUSMoERHzDHC6mgk3U5F4tbaMOcchlpwEeJCO/5ivuw cuGo0D/CjclDsmY4pABxlz7rBx3gERFTQCIAsIBwu+etLvxCYG6TI9wyNjlnOOUo/jMC 1jnOuJTmZpg/LQG9cvRwxcv0TexwnR4tYdY+3x3tIMlooYNOM4L6VCUGGy8h1s7u9BCB e6Tw== X-Received: by 10.15.75.201 with SMTP id l49mr39382310eey.3.1374685365218; Wed, 24 Jul 2013 10:02:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.16.195 with SMTP id i3ls311632qed.17.gmail; Wed, 24 Jul 2013 10:02:44 -0700 (PDT) X-Received: by 10.58.189.38 with SMTP id gf6mr15058477vec.90.1374685364735; Wed, 24 Jul 2013 10:02:44 -0700 (PDT) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id fw17si10383587vec.66.2013.07.24.10.02.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Jul 2013 10:02:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.43; Received: by mail-vb0-f43.google.com with SMTP id e12so6520927vbg.30 for ; Wed, 24 Jul 2013 10:02:42 -0700 (PDT) X-Received: by 10.58.2.137 with SMTP id 9mr15273557veu.50.1374685362016; Wed, 24 Jul 2013 10:02:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp37468veb; Wed, 24 Jul 2013 10:02:41 -0700 (PDT) X-Received: by 10.180.185.176 with SMTP id fd16mr3424066wic.20.1374685360902; Wed, 24 Jul 2013 10:02:40 -0700 (PDT) Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by mx.google.com with ESMTPS id k13si2502815wiv.33.2013.07.24.10.02.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Jul 2013 10:02:40 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.46 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.46; Received: by mail-wg0-f46.google.com with SMTP id k13so650853wgh.1 for ; Wed, 24 Jul 2013 10:02:40 -0700 (PDT) X-Received: by 10.194.122.71 with SMTP id lq7mr27202616wjb.77.1374685360357; Wed, 24 Jul 2013 10:02:40 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id u7sm6617457wiw.9.2013.07.24.10.02.37 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Jul 2013 10:02:39 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, Stefano.Stabellini@eu.citrix.com, patches@linaro.org, Julien Grall Subject: [PATCH] xen/arm: Initialize PERCPU variables at the beginning of start_xen Date: Wed, 24 Jul 2013 18:01:36 +0100 Message-Id: <1374685296-31812-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQnHI1nXDYCP4s/84uIykiG/ai6cQir8/KsLZqnEMcMKmw2sTCfhDfCUso7T2cp0dhgvlfJc X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , PERCPU variables rely on HTPIDR (TPIDR_EL2) which is in an unknown state when a processor boot. For the boot CPU, the first use of PERCPU is in setup_pagetables. So initialize PERCPU and set the processor ID before. Signed-off-by: Julien Grall Acked-by: Tim Deegan --- xen/arch/arm/setup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 2f9fdc8..1ec5e38 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -428,6 +428,9 @@ void __init start_xen(unsigned long boot_phys_offset, setup_cache(); + percpu_init_areas(); + set_processor_id(0); /* needed early, for smp_processor_id() */ + smp_clear_cpu_maps(); device_tree_flattened = (void *)BOOT_MISC_VIRT_START @@ -458,8 +461,6 @@ void __init start_xen(unsigned long boot_phys_offset, gic_init(); make_cpus_ready(cpus, 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;