From patchwork Wed Jul 30 13:47: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: 34527 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f72.google.com (mail-qg0-f72.google.com [209.85.192.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8228321330 for ; Wed, 30 Jul 2014 13:55:56 +0000 (UTC) Received: by mail-qg0-f72.google.com with SMTP id q107sf2352124qgd.7 for ; Wed, 30 Jul 2014 06:55:56 -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=1yn+ZScFqXPOfhyD0o3veLDhA8fP8kehQ8QFnLIc4Z8=; b=KxN7c8RZ0w1yGxfk/IHiiHM6yeL69Oc8ArV50YmvJoTdzHC37VZa/Ic8Z8w1EukhF4 6DODlL7xexMXl7Cu5g5Gj3sexVwYI0TWVwsCNf2SPkgFDgMBQoZ2RVDA3lUYr+nte6Gg VzDH/5F3QWe2bYjf5VLmlqIEaYlAfn9zNkLrUy5+l31D8OM0nX7NMh0V92Jg2N8Acgti Rrsy95hloN+xTeK6P9KwXewF0t7dq2oMx4rCsTde2W9FvCCHuoVyPNtkUGk8d7vm2164 A5U5rU6BhbjVsWJd+9kCmCvEKXrQEkYBxSpLMf6pNBzFCGIkI5Rgms6HAQr8OQj+rGrt fd+A== X-Gm-Message-State: ALoCoQnbWE0PucjyX7kjmbPWoIC+dNIX+3UIC/ubyLprfQIjAYl2g3dyfEJGOmu3dwR+4mrxVlR1 X-Received: by 10.236.17.234 with SMTP id j70mr1556651yhj.26.1406728556384; Wed, 30 Jul 2014 06:55:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.80 with SMTP id y74ls530591qgd.0.gmail; Wed, 30 Jul 2014 06:55:56 -0700 (PDT) X-Received: by 10.221.24.7 with SMTP id rc7mr4688702vcb.54.1406728556243; Wed, 30 Jul 2014 06:55:56 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id mb10si1694009vcb.59.2014.07.30.06.55.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jul 2014 06:55:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so1815494vcb.31 for ; Wed, 30 Jul 2014 06:55:56 -0700 (PDT) X-Received: by 10.220.118.136 with SMTP id v8mr4689861vcq.50.1406728556157; Wed, 30 Jul 2014 06:55:56 -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.37.5 with SMTP id tc5csp29568vcb; Wed, 30 Jul 2014 06:55:55 -0700 (PDT) X-Received: by 10.50.134.136 with SMTP id pk8mr54916076igb.20.1406728555653; Wed, 30 Jul 2014 06:55:55 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id j11si6447509icm.57.2014.07.30.06.55.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Jul 2014 06:55:55 -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 1XCUKn-0006EZ-VR; Wed, 30 Jul 2014 13:54:25 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XCUKi-0006AA-QO for xen-devel@lists.xen.org; Wed, 30 Jul 2014 13:54:20 +0000 Received: from [85.158.143.35:63886] by server-3.bemta-4.messagelabs.com id DA/A4-06192-C09F8D35; Wed, 30 Jul 2014 13:54:20 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-11.tower-21.messagelabs.com!1406728457!12385597!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6996 invoked from network); 30 Jul 2014 13:54:18 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 30 Jul 2014 13:54:18 -0000 X-IronPort-AV: E=Sophos;i="5.01,764,1400025600"; d="scan'208";a="157142862" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 30 Jul 2014 13:54:17 +0000 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; Wed, 30 Jul 2014 09:54:16 -0400 Received: from drall.uk.xensource.com ([10.80.16.71]) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1XCUDx-0006vH-Cu; Wed, 30 Jul 2014 14:47:22 +0100 Received: by drall.uk.xensource.com (sSMTP sendmail emulation); Wed, 30 Jul 2014 14:47:21 +0100 From: Ian Campbell To: Date: Wed, 30 Jul 2014 14:47:13 +0100 Message-ID: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <3ef2b68c511f3e31de409b76757b95c78b99d750.1406728037.git.ian.campbell@citrix.com> References: <3ef2b68c511f3e31de409b76757b95c78b99d750.1406728037.git.ian.campbell@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , vijay.kilari@gmail.com, stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH RFC 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.172 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 --- xen/arch/arm/p2m.c | 16 +++++++++++++--- xen/arch/arm/setup.c | 4 ++-- xen/arch/arm/smpboot.c | 2 -- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 705b29b..225d125 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1059,8 +1059,17 @@ err: return page; } +static void setup_virt_paging_one(void *data) +{ + unsigned long val = (unsigned long)data; + WRITE_SYSREG32(val, VTCR_EL2); + isb(); +} + void __cpuinit 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) @@ -1070,11 +1079,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..ddaef7e 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(); @@ -838,6 +836,8 @@ void __init start_xen(unsigned long boot_phys_offset, do_initcalls(); + setup_virt_paging(); + /* Create initial domain 0. */ dom0 = domain_create(0, 0, 0); if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) ) 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();