From patchwork Fri Jan 10 03:50:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salter X-Patchwork-Id: 23075 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB8FF20555 for ; Fri, 10 Jan 2014 03:52:07 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id o6sf14826278oag.7 for ; Thu, 09 Jan 2014 19:52:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=uib5aL4D7MDg9mT4cxNuMxFUybPRT6I5a1N+r/kSBBE=; b=akipTIBgG04lQ+TUslD5l5sD7FrNJQeS9rGA355HrlwZoQ/eoYVu1Nb7Cdb1MUnYP/ SFjELnzTfBZ3gX2Z5XEN7BopEVbGh1dyc8/GEN3JRW9rAto6aU0UM2cYRlm6DCKTV8Nw oqJgUYJLPBDFZRcMgR7NJeXUckTI9YpyaFSgX6POdCjPIO9I2dhQiX+a0G2hQA8Rd/M4 1y9P1TUnuoOetYMilBh7zw1xZQWvK2IctvYKvWfupZ4ICEXrs8Odilhnpfl2iZVKKfqt dOKHYvbtMA0MeRPTsNPrwsR18ajXufLkK8hUwuW8UC5YP8QbesIGq/cMm0+6Dyd9i7vw nLUQ== X-Gm-Message-State: ALoCoQlEyJPNiRZZ5Wufo3RDatBAbxtatHfnr3CHpijRUUvfeyitqCywR6+4YPO1Eqm5c6ie20nf X-Received: by 10.50.88.72 with SMTP id be8mr238397igb.7.1389325927085; Thu, 09 Jan 2014 19:52:07 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.240 with SMTP id df16ls1262517qeb.82.gmail; Thu, 09 Jan 2014 19:52:07 -0800 (PST) X-Received: by 10.52.245.42 with SMTP id xl10mr4962045vdc.35.1389325926968; Thu, 09 Jan 2014 19:52:06 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id in16si3970708vec.118.2014.01.09.19.52.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 Jan 2014 19:52:06 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so3070567veb.25 for ; Thu, 09 Jan 2014 19:52:06 -0800 (PST) X-Received: by 10.52.241.103 with SMTP id wh7mr6658vdc.85.1389325926835; Thu, 09 Jan 2014 19:52:06 -0800 (PST) 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.59.13.131 with SMTP id ey3csp57819ved; Thu, 9 Jan 2014 19:52:06 -0800 (PST) X-Received: by 10.66.65.204 with SMTP id z12mr8157200pas.60.1389325925913; Thu, 09 Jan 2014 19:52:05 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si5718394pao.297.2014.01.09.19.52.04; Thu, 09 Jan 2014 19:52:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754987AbaAJDvx (ORCPT + 26 others); Thu, 9 Jan 2014 22:51:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11149 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbaAJDvu (ORCPT ); Thu, 9 Jan 2014 22:51:50 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0A3pN6h013408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Jan 2014 22:51:23 -0500 Received: from deneb.redhat.com (ovpn-113-39.phx2.redhat.com [10.3.113.39]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0A3pHH2010085; Thu, 9 Jan 2014 22:51:23 -0500 From: Mark Salter To: linux-kernel@vger.kernel.org Cc: Mark Salter , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [PATCH v3 5/6] arm64: initialize pgprot info earlier in boot Date: Thu, 9 Jan 2014 22:50:32 -0500 Message-Id: <1389325833-16535-6-git-send-email-msalter@redhat.com> In-Reply-To: <1389325833-16535-1-git-send-email-msalter@redhat.com> References: <1389325833-16535-1-git-send-email-msalter@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: msalter@redhat.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Presently, paging_init() calls init_mem_pgprot() to initialize pgprot values used by macros such as PAGE_KERNEL, PAGE_KERNEL_EXEC, etc. The new fixmap and early_ioremap support also needs to use these macros before paging_init() is called. This patch moves the init_mem_pgprot() call out of paging_init() and into setup_arch() so that pgprot_default gets initialized in time for fixmap and early_ioremap. Signed-off-by: Mark Salter CC: linux-arm-kernel@lists.infradead.org CC: Catalin Marinas CC: Will Deacon --- arch/arm64/include/asm/mmu.h | 1 + arch/arm64/kernel/setup.c | 2 ++ arch/arm64/mm/mmu.c | 3 +-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h index 2494fc0..f600d40 100644 --- a/arch/arm64/include/asm/mmu.h +++ b/arch/arm64/include/asm/mmu.h @@ -27,5 +27,6 @@ typedef struct { extern void paging_init(void); extern void setup_mm_for_reboot(void); extern void __iomem *early_io_map(phys_addr_t phys, unsigned long virt); +extern void init_mem_pgprot(void); #endif diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index bd9bbd0..029ecfe 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -221,6 +221,8 @@ void __init setup_arch(char **cmdline_p) *cmdline_p = boot_command_line; + init_mem_pgprot(); + parse_early_param(); arm64_memblock_init(); diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index f557ebb..541c782 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -125,7 +125,7 @@ early_param("cachepolicy", early_cachepolicy); /* * Adjust the PMD section entries according to the CPU in use. */ -static void __init init_mem_pgprot(void) +void __init init_mem_pgprot(void) { pteval_t default_pgprot; int i; @@ -349,7 +349,6 @@ void __init paging_init(void) { void *zero_page; - init_mem_pgprot(); map_mem(); /*