From patchwork Thu Sep 4 16:14:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 36742 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 396EF202E4 for ; Thu, 4 Sep 2014 16:17:22 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id eu11sf94725767pac.7 for ; Thu, 04 Sep 2014 09:17:19 -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=OwcBU7R+COp+1Ms7FSFzj5mx85m85l2FyZA+GZN4MGM=; b=MVTqpqCnqrhNaVYOKp938r9aEOuu+efToAIWTm5xsu5PPNuZqGuRIdHGW3Kk5WMMpz pqVsNoeABwsRCCnR33BR0bg4NRL005lN1ft6TDj1D7/cgzDohbFKtmYUOsohv9CD5zeE MyoxWPDjZrLiqlRvgdLq0vGozQHxbo2uSn+oWilDfD8p9rcwgfNB7bWkZNh87PiCHgAJ CZDAEUCSpbRqsBNbgtFq4MuSZEdy2Hoxo54LtLixHL+mQtuMweYgJUPyC9MDQ2MQbNCY FIm+bRZcb6jHPg1h2sMON0/FVhAzrw5gnQlsS5yTBV3NpGvcCza9J2nJGhvdSgoDtmFj IlEw== X-Gm-Message-State: ALoCoQmyV3iwTgc/Q+u0kDHtxKVVwjxKBjfXxcgRJ7bM6QZA3OZnriJ6oVrjZZeHYjxNHiUN+C4q X-Received: by 10.70.89.97 with SMTP id bn1mr2958334pdb.5.1409847439200; Thu, 04 Sep 2014 09:17:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.170 with SMTP id u39ls353176qga.21.gmail; Thu, 04 Sep 2014 09:17:19 -0700 (PDT) X-Received: by 10.52.98.130 with SMTP id ei2mr2100629vdb.87.1409847439063; Thu, 04 Sep 2014 09:17:19 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id pu11si3297294vdb.55.2014.09.04.09.17.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Sep 2014 09:17:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so10940092vcb.14 for ; Thu, 04 Sep 2014 09:17:19 -0700 (PDT) X-Received: by 10.52.120.51 with SMTP id kz19mr2003028vdb.95.1409847438966; Thu, 04 Sep 2014 09:17:18 -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.45.67 with SMTP id uj3csp863352vcb; Thu, 4 Sep 2014 09:17:18 -0700 (PDT) X-Received: by 10.224.44.14 with SMTP id y14mr8793421qae.34.1409847438528; Thu, 04 Sep 2014 09:17:18 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id h10si15127872qgf.118.2014.09.04.09.17.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Sep 2014 09:17:18 -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 1XPZgp-0001lp-9X; Thu, 04 Sep 2014 16:15:15 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XPZgi-0001jb-B3 for xen-devel@lists.xen.org; Thu, 04 Sep 2014 16:15:09 +0000 Received: from [193.109.254.147:25318] by server-5.bemta-14.messagelabs.com id 8A/14-28255-B0098045; Thu, 04 Sep 2014 16:15:07 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1409847304!13546273!3 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 29490 invoked from network); 4 Sep 2014 16:15:06 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 4 Sep 2014 16:15:06 -0000 X-IronPort-AV: E=Sophos;i="5.04,467,1406592000"; d="scan'208";a="169157085" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Thu, 4 Sep 2014 12:14:23 -0400 Received: from drall.uk.xensource.com ([10.80.16.71]) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1XPZfx-0004QY-T7; Thu, 04 Sep 2014 17:14:22 +0100 Received: by drall.uk.xensource.com (sSMTP sendmail emulation); Thu, 04 Sep 2014 17:14:21 +0100 From: Ian Campbell To: Date: Thu, 4 Sep 2014 17:14:13 +0100 Message-ID: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <4427aba8dad3155fca151a0b63bfdf78e3a91033.1409847257.git.ian.campbell@citrix.com> References: <4427aba8dad3155fca151a0b63bfdf78e3a91033.1409847257.git.ian.campbell@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 v2 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.220.169 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 6cd13c2..6e64f94 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1112,8 +1112,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) @@ -1123,11 +1132,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 446b4dc..35ee7f0 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -788,8 +788,6 @@ void __init start_xen(unsigned long boot_phys_offset, gic_init(); - setup_virt_paging(); - p2m_vmid_allocator_init(); softirq_init(); @@ -836,6 +834,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();