From patchwork Thu Sep 18 00:09:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 37563 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6F9DB2057E for ; Thu, 18 Sep 2014 00:11:53 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id n12sf49422wgh.5 for ; Wed, 17 Sep 2014 17:11:52 -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:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=S8hi2qsaTWo4DADkR3xjDpfTjW4pzKWVM78SfJ+v4lg=; b=cmFzhrJKDRfKLsOuURZ6A89af/dJfLHYcKikXBATnDkZnSwRKq/1GH1pPtTmXrCaf4 6gqpWEFfPNE8aF9zpkGvKdoSBNiHv2PtpPE/SzN+0CqoED8ticHhNPb1A4vlT37ZkUv7 XpSR/0c9aq208uve9g5gaw9KrwEekvPN4lKdb30nSdsApesKxCcN33RQUQ2T20jeu6AZ /9hqi1mgwYYKlTo12uaPH3AMCvzs68f9UYnZPQJaRaTQZ0MJw+7G6SUCFWsPxuzDiXiF NBJACj3e3SnEfHZJXRtVi/DWkBjRSgwweQDWvaQuCbSH5G1N5RXbXfmIxe7zu7xpUmIJ jjNw== X-Gm-Message-State: ALoCoQnU+zOtJB2sJ3VKDRwj7U0283J3zcJNM+9CtYqVdIpZVygEJp09zaUkmUEF8fFGW8qtxp5Q X-Received: by 10.112.155.133 with SMTP id vw5mr5683lbb.14.1410999112631; Wed, 17 Sep 2014 17:11:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.138 with SMTP id jo10ls156655lab.56.gmail; Wed, 17 Sep 2014 17:11:52 -0700 (PDT) X-Received: by 10.112.134.101 with SMTP id pj5mr542564lbb.47.1410999112463; Wed, 17 Sep 2014 17:11:52 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx.google.com with ESMTPS id j10si10732069laf.95.2014.09.17.17.11.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 17:11:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id l4so126220lbv.5 for ; Wed, 17 Sep 2014 17:11:52 -0700 (PDT) X-Received: by 10.152.28.230 with SMTP id e6mr1042302lah.62.1410999112358; Wed, 17 Sep 2014 17:11:52 -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 of9csp673218lbb; Wed, 17 Sep 2014 17:11:51 -0700 (PDT) X-Received: by 10.224.11.10 with SMTP id r10mr1495927qar.53.1410999111201; Wed, 17 Sep 2014 17:11:51 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id w9si24320630qcj.42.2014.09.17.17.11.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 17 Sep 2014 17:11:51 -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 1XUPIU-0006Yu-6C; Thu, 18 Sep 2014 00:10:06 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XUPIR-0006Y3-Ua for xen-devel@lists.xen.org; Thu, 18 Sep 2014 00:10:04 +0000 Received: from [85.158.139.211:13416] by server-3.bemta-5.messagelabs.com id 95/C6-13873-BD22A145; Thu, 18 Sep 2014 00:10:03 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1410999000!15183601!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5802 invoked from network); 18 Sep 2014 00:10:02 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 18 Sep 2014 00:10:02 -0000 X-IronPort-AV: E=Sophos;i="5.04,542,1406592000"; d="scan'208";a="173531323" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Wed, 17 Sep 2014 20:10:00 -0400 Received: from drall.uk.xensource.com ([10.80.16.71]) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1XUPIN-0000t5-Jl; Thu, 18 Sep 2014 01:10:00 +0100 Received: by drall.uk.xensource.com (sSMTP sendmail emulation); Thu, 18 Sep 2014 01:09:59 +0100 From: Ian Campbell To: Date: Thu, 18 Sep 2014 01:09:51 +0100 Message-ID: <1410998995-27449-5-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1410998960.1920.2.camel@citrix.com> References: <1410998960.1920.2.camel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , vijay.kilari@gmail.com, stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH v3 for-4.5 5/9] xen: arm: Defer setting of VTCR_EL2 until after CPUs are up 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: , 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: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 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: Currently we retain the hardcoded values but soon we will want to calculate the correct values based upon the CPU properties common to all processors, which are only available once they are all up. Signed-off-by: Ian Campbell Reviewed-by: Julien Grall --- v2: - rewrap commit message. - setup_virt_paging(_one) are __init now. - setup_virt_paging called before do_initcalls(). --- xen/arch/arm/p2m.c | 18 ++++++++++++++---- xen/arch/arm/setup.c | 4 ++-- xen/arch/arm/smpboot.c | 2 -- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index a1fef0f..e953ca3 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1138,8 +1138,17 @@ err: return page; } -void __cpuinit setup_virt_paging(void) +static void __init setup_virt_paging_one(void *data) { + unsigned long val = (unsigned long)data; + WRITE_SYSREG32(val, VTCR_EL2); + isb(); +} + +void __init setup_virt_paging(void) +{ + unsigned long val; + /* Setup Stage 2 address translation */ /* SH0=11 (Inner-shareable) * ORGN0=IRGN0=01 (Normal memory, Write-Back Write-Allocate Cacheable) @@ -1149,11 +1158,12 @@ void __cpuinit setup_virt_paging(void) * PS=010 == 40 bits */ #ifdef CONFIG_ARM_32 - WRITE_SYSREG32(0x80003558, VTCR_EL2); + val = 0x80003558; #else - WRITE_SYSREG32(0x80023558, VTCR_EL2); + val = 0x80023558; #endif - isb(); + setup_virt_paging_one((void *)val); + smp_call_function(setup_virt_paging_one, (void *)val, 1); } /* diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 025349e..8844720 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -789,8 +789,6 @@ void __init start_xen(unsigned long boot_phys_offset, gic_init(); - setup_virt_paging(); - p2m_vmid_allocator_init(); softirq_init(); @@ -837,6 +835,8 @@ void __init start_xen(unsigned long boot_phys_offset, printk("Brought up %ld CPUs\n", (long)num_online_cpus()); /* TODO: smp_cpus_done(); */ + setup_virt_paging(); + do_initcalls(); /* Create initial domain 0. */ diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index cf149da..ee395a1 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -279,8 +279,6 @@ void __cpuinit start_secondary(unsigned long boot_phys_offset, init_traps(); - setup_virt_paging(); - mmu_init_secondary_cpu(); gic_init_secondary_cpu();