From patchwork Wed Jul 30 13:47:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 34532 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5A07E20DCC for ; Wed, 30 Jul 2014 13:56:19 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ij19sf3582720vcb.8 for ; Wed, 30 Jul 2014 06:56: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=6u4SDoS/+2EP3SumXCd8BwQzva5c+K1GlciNQofD21U=; b=bskWs7GCdH+JrTo/GRIDdU7qOdN6Zk2Eu6yroeBQ5XF8ppLTTJFhkQyN233cQ6BZtB 38sy5law52Y+B/bU5NQVmyv8pqQ3yccuWiNNbIpL/S0N/dI17ih7FV6jfSG10JlwXz+I ozHovtpsdpgyHrtawqEaWeZcjNjsrxV8EuaN9k8842GoFFopD6pl5Gf/TogTedwCli9O aFXM8zgkNGY2sKmlXGzjQ8I3O13S21cXdkn6z1gBAhJMJy1qD7nB6mirB3JiFrYUfP3P wzm2ouEXcY6hXwwHo6Ajo+beoKQQy612FNJFIYTgM1ZP3UV6pYjmFgQmTMwG3qQgENq7 FWJw== X-Gm-Message-State: ALoCoQnP7AXYIarJcXSNGjBvksJBSO5VPnYkEoROW0QGmJqfrkYvPy/cs5urYM5jbtpdQO9dzRpP X-Received: by 10.236.117.141 with SMTP id j13mr1511173yhh.3.1406728578982; Wed, 30 Jul 2014 06:56:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.16.53 with SMTP id 50ls511149qga.25.gmail; Wed, 30 Jul 2014 06:56:18 -0700 (PDT) X-Received: by 10.52.157.41 with SMTP id wj9mr7938050vdb.1.1406728578917; Wed, 30 Jul 2014 06:56:18 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id q6si1699449veh.50.2014.07.30.06.56.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jul 2014 06:56:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hy4so1834736vcb.13 for ; Wed, 30 Jul 2014 06:56:18 -0700 (PDT) X-Received: by 10.52.248.146 with SMTP id ym18mr8068968vdc.8.1406728578798; Wed, 30 Jul 2014 06:56: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.37.5 with SMTP id tc5csp29590vcb; Wed, 30 Jul 2014 06:56:18 -0700 (PDT) X-Received: by 10.42.178.133 with SMTP id bm5mr5558620icb.75.1406728578316; Wed, 30 Jul 2014 06:56:18 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id fs5si6500823igb.9.2014.07.30.06.56.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Jul 2014 06:56: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 1XCUKk-0006Bv-PJ; Wed, 30 Jul 2014 13:54:22 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XCUKi-0006A8-H3 for xen-devel@lists.xen.org; Wed, 30 Jul 2014 13:54:20 +0000 Received: from [85.158.139.211:37659] by server-4.bemta-5.messagelabs.com id 03/7E-10551-B09F8D35; Wed, 30 Jul 2014 13:54:19 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-9.tower-206.messagelabs.com!1406728456!10888057!3 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 8779 invoked from network); 30 Jul 2014 13:54:19 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-9.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 30 Jul 2014 13:54:19 -0000 X-IronPort-AV: E=Sophos;i="5.01,764,1400025600"; d="scan'208";a="157142864" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 30 Jul 2014 13:54:18 +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:17 -0400 Received: from drall.uk.xensource.com ([10.80.16.71]) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1XCUDw-0006vE-Bv; Wed, 30 Jul 2014 14:47:21 +0100 Received: by drall.uk.xensource.com (sSMTP sendmail emulation); Wed, 30 Jul 2014 14:47:20 +0100 From: Ian Campbell To: Date: Wed, 30 Jul 2014 14:47:12 +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: MIA1 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , vijay.kilari@gmail.com, stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH RFC 4/9] xen: arm: move setup_virt_paging to p2m.c 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.182 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: This file is where most of the P2M logic lives and this function will eventually need to poke at some internals, so move it. This is pure code motion. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/arch/arm/mm.c | 18 ------------------ xen/arch/arm/p2m.c | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 4ff783a..cf0b0cf 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -414,24 +414,6 @@ void __init arch_init_memory(void) BUG_ON(IS_ERR(dom_cow)); } -void __cpuinit setup_virt_paging(void) -{ - /* Setup Stage 2 address translation */ - /* SH0=11 (Inner-shareable) - * ORGN0=IRGN0=01 (Normal memory, Write-Back Write-Allocate Cacheable) - * SL0=01 (Level-1) - * ARVv7: T0SZ=(1)1000 = -8 (32-(-8) = 40 bit physical addresses) - * ARMv8: T0SZ=01 1000 = 24 (64-24 = 40 bit physical addresses) - * PS=010 == 40 bits - */ -#ifdef CONFIG_ARM_32 - WRITE_SYSREG32(0x80003558, VTCR_EL2); -#else - WRITE_SYSREG32(0x80023558, VTCR_EL2); -#endif - isb(); -} - static inline lpae_t pte_of_xenaddr(vaddr_t va) { paddr_t ma = va + phys_offset; diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 6839acf..705b29b 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1059,6 +1059,24 @@ err: return page; } +void __cpuinit setup_virt_paging(void) +{ + /* Setup Stage 2 address translation */ + /* SH0=11 (Inner-shareable) + * ORGN0=IRGN0=01 (Normal memory, Write-Back Write-Allocate Cacheable) + * SL0=01 (Level-1) + * ARVv7: T0SZ=(1)1000 = -8 (32-(-8) = 40 bit physical addresses) + * ARMv8: T0SZ=01 1000 = 24 (64-24 = 40 bit physical addresses) + * PS=010 == 40 bits + */ +#ifdef CONFIG_ARM_32 + WRITE_SYSREG32(0x80003558, VTCR_EL2); +#else + WRITE_SYSREG32(0x80023558, VTCR_EL2); +#endif + isb(); +} + /* * Local variables: * mode: C