From patchwork Wed Jan 22 11:25:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 3522621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E2F929F2D6 for ; Wed, 22 Jan 2014 11:30:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 190A720171 for ; Wed, 22 Jan 2014 11:30:21 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9AA0920170 for ; Wed, 22 Jan 2014 11:30:19 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5w0A-0003TW-Bu; Wed, 22 Jan 2014 11:29:46 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5w00-0002hl-N9; Wed, 22 Jan 2014 11:29:36 +0000 Received: from szxga03-in.huawei.com ([119.145.14.66]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5vzs-0002e4-JL; Wed, 22 Jan 2014 11:29:31 +0000 Received: from 172.24.2.119 (EHLO szxeml207-edg.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AJQ35821; Wed, 22 Jan 2014 19:28:42 +0800 (CST) Received: from SZXEML421-HUB.china.huawei.com (10.82.67.160) by szxeml207-edg.china.huawei.com (172.24.2.56) with Microsoft SMTP Server (TLS) id 14.3.158.1; Wed, 22 Jan 2014 19:28:39 +0800 Received: from LGGEML424-HUB.china.huawei.com (10.72.61.124) by szxeml421-hub.china.huawei.com (10.82.67.160) with Microsoft SMTP Server (TLS) id 14.3.158.1; Wed, 22 Jan 2014 19:28:36 +0800 Received: from kernel-host.huawei (10.107.197.247) by lggeml424-hub.china.huawei.com (10.72.61.124) with Microsoft SMTP Server id 14.3.158.1; Wed, 22 Jan 2014 19:28:16 +0800 From: Wang Nan To: Subject: [PATCH 1/3] ARM: Premit ioremap() to map reserved pages Date: Wed, 22 Jan 2014 19:25:14 +0800 Message-ID: <1390389916-8711-2-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1390389916-8711-1-git-send-email-wangnan0@huawei.com> References: <1390389916-8711-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.197.247] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140122_062929_568603_626022F4 X-CRM114-Status: GOOD ( 10.61 ) X-Spam-Score: -3.2 (---) Cc: Wang Nan , stable@vger.kernel.org, linux-kernel@vger.kernel.org, Geng Hui , linux-mm@kvack.org, Eric Biederman , Russell King , Andrew Morton , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch relaxes the restriction set by commit 309caa9cc, which prohibit ioremap() on all kernel managed pages. Other architectures, such as x86 and (some specific platforms of) powerpc, allow such mapping. ioremap() pages is an efficient way to avoid arm's mysterious cache control. This feature will be used for arm kexec support to ensure copied data goes into RAM even without cache flushing, because we found that flush_cache_xxx can't reliably flush code to memory. Signed-off-by: Wang Nan Cc: # 3.4+ Cc: Eric Biederman Cc: Russell King Cc: Andrew Morton Cc: Geng Hui --- arch/arm/mm/ioremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index f123d6e..98b1c10 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@ -298,7 +298,7 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn, /* * Don't allow RAM to be mapped - this causes problems with ARMv6+ */ - if (WARN_ON(pfn_valid(pfn))) + if (WARN_ON(pfn_valid(pfn) && !PageReserved(pfn_to_page(pfn)))) return NULL; area = get_vm_area_caller(size, VM_IOREMAP, caller);