From patchwork Tue Jan 7 02:35:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salter X-Patchwork-Id: 22902 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AE42B218DC for ; Tue, 7 Jan 2014 02:35:37 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id e14sf97747071iej.8 for ; Mon, 06 Jan 2014 18:35:36 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Wv8AociZCSTtQxxcV4GUAki/M3CHmT6AZ0XT5CpK/Jg=; b=Y+vfz3L4ZA5osTvnmnyZpDmQE/cpNKqcRNfMWbjQW//Bu9J3t1oG0+qCF/z2CeIlra gsovWG4grs/LwwDR+2kq+7Noaw/dnXwzXduiQV36ho/yYOlOwpsBdP4hBWiM1ksNuDZL +RjIj9/hvPdCrA6DTx+Lc+p4bLTiR4BRpfzvTvYISsfJOU83V8xdjsLsGpmOd7/l4vuw TnZcEvWB0SjGy0zPkd7TwtdEiy+uICfLStGNyT3jEYa6xydWiFAOA5m4lHdRoy56abJu Y3hsXr3cXKVshd7wbVOHtY3M1FYUxX97JBrwci5BDQRz0FAqrxMArsjMg2D+Qxy5uUzP hZ9A== X-Gm-Message-State: ALoCoQnEk8fruBKCtxkloOxgpbf/CgorWhVFF6mE14PKsyVljyChAGapZpbRykqi6BYC5U7ujyAv X-Received: by 10.43.4.4 with SMTP id oa4mr8504149icb.2.1389062136296; Mon, 06 Jan 2014 18:35:36 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.97.201 with SMTP id ec9ls6136957qeb.60.gmail; Mon, 06 Jan 2014 18:35:36 -0800 (PST) X-Received: by 10.58.6.239 with SMTP id e15mr39355848vea.14.1389062136068; Mon, 06 Jan 2014 18:35:36 -0800 (PST) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id pu5si32321667veb.135.2014.01.06.18.35.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Jan 2014 18:35:36 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.43; Received: by mail-vb0-f43.google.com with SMTP id p6so9382651vbe.2 for ; Mon, 06 Jan 2014 18:35:36 -0800 (PST) X-Received: by 10.52.135.201 with SMTP id pu9mr58487371vdb.13.1389062135972; Mon, 06 Jan 2014 18:35:35 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp131859ved; Mon, 6 Jan 2014 18:35:35 -0800 (PST) X-Received: by 10.49.116.5 with SMTP id js5mr189796952qeb.36.1389062135297; Mon, 06 Jan 2014 18:35:35 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTP id r5si74123193qat.48.2014.01.06.18.35.34 for ; Mon, 06 Jan 2014 18:35:35 -0800 (PST) Received-SPF: pass (google.com: domain of msalter@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s072ZSXh023583 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Jan 2014 21:35:29 -0500 Received: from deneb.redhat.com (ovpn-113-105.phx2.redhat.com [10.3.113.105]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s072ZMva029190; Mon, 6 Jan 2014 21:35:28 -0500 From: Mark Salter To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, patches@linaro.org, linux-mm@kvack.org, Mark Salter , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon Subject: [PATCH v2 4/5] arm64: initialize pgprot info earlier in boot Date: Mon, 6 Jan 2014 21:35:19 -0500 Message-Id: <1389062120-31896-5-git-send-email-msalter@redhat.com> In-Reply-To: <1389062120-31896-1-git-send-email-msalter@redhat.com> References: <1389062120-31896-1-git-send-email-msalter@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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.212.43 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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(); /*