From patchwork Sun May 26 13:38:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2615891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 2D8F1DFB79 for ; Sun, 26 May 2013 13:42:38 +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 1UgbD2-0004ol-Vg; Sun, 26 May 2013 13:42:05 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UgbCs-0005Xk-Sz; Sun, 26 May 2013 13:41:54 +0000 Received: from mail-pd0-f179.google.com ([209.85.192.179]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UgbCn-0005V7-QQ for linux-arm-kernel@lists.infradead.org; Sun, 26 May 2013 13:41:50 +0000 Received: by mail-pd0-f179.google.com with SMTP id q11so5690992pdj.24 for ; Sun, 26 May 2013 06:41:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=5mrl5hsltF60+305gMZmtVQv5GgukXKjf8/CLlJYtB4=; b=G8pRYgWexE3zTgzTVp0LEsY4/D7mKYyszjCctXy3F7NnbLnhviGYnLwt/1LMuSB7CA Wut0rqyBWrlCNu8ZMOSmrCrU9aoiigw6FlYCfboHHaTact+nd0khQcY9GZzDVVy7ayrb +Xg87kYHCSTuoEL9ezEmVoV5aQRq0q0U7qPDUMAN6eUWKpvJRbN/LOr8Uz61VJiJOHOF 1JijecEloVKhCc3hyH7YMrVuz9xCnijXSX35NivmjDUCzCHm+LRHIdiFp21vXVuiYgXk lP40Yuh+mTR1L8e4BZgmOc+ScDNGgz8qn3j2RsC00yGpilqFSqHJNBKgFMinZR8bsKZb bllQ== X-Received: by 10.66.150.106 with SMTP id uh10mr26270302pab.118.1369575688379; Sun, 26 May 2013 06:41:28 -0700 (PDT) Received: from localhost.localdomain ([111.196.197.202]) by mx.google.com with ESMTPSA id fp2sm24438093pbb.36.2013.05.26.06.41.22 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 May 2013 06:41:27 -0700 (PDT) From: Jiang Liu To: Andrew Morton Subject: [PATCH v8, part3 03/14] mm/ARM64: kill poison_init_mem() Date: Sun, 26 May 2013 21:38:31 +0800 Message-Id: <1369575522-26405-4-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369575522-26405-1-git-send-email-jiang.liu@huawei.com> References: <1369575522-26405-1-git-send-email-jiang.liu@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130526_094149_974170_60011CEB X-CRM114-Status: GOOD ( 12.03 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.179 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liuj97[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (liuj97[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: linux-arch@vger.kernel.org, James Bottomley , David Howells , Jiang Liu , Wen Congyang , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Mark Salter , Will Deacon , linux-kernel@vger.kernel.org, Michal Hocko , Minchan Kim , Mel Gorman , David Rientjes , Sergei Shtylyov , KAMEZAWA Hiroyuki , Jianguo Wu 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Use free_reserved_area() to poison initmem memory pages and kill poison_init_mem() on ARM64. Signed-off-by: Jiang Liu Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Acked-by: Catalin Marinas --- arch/arm64/mm/init.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 997c634..a398eb9 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -197,14 +197,6 @@ void __init bootmem_init(void) max_pfn = max_low_pfn = max; } -/* - * Poison init memory with an undefined instruction (0x0). - */ -static inline void poison_init_mem(void *s, size_t count) -{ - memset(s, 0, count); -} - #ifndef CONFIG_SPARSEMEM_VMEMMAP static inline void free_memmap(unsigned long start_pfn, unsigned long end_pfn) { @@ -386,8 +378,7 @@ void __init mem_init(void) void free_initmem(void) { - poison_init_mem(__init_begin, __init_end - __init_begin); - free_initmem_default(-1); + free_initmem_default(0); } #ifdef CONFIG_BLK_DEV_INITRD @@ -396,10 +387,8 @@ static int keep_initrd; void free_initrd_mem(unsigned long start, unsigned long end) { - if (!keep_initrd) { - poison_init_mem((void *)start, PAGE_ALIGN(end) - start); - free_reserved_area((void *)start, (void *)end, -1, "initrd"); - } + if (!keep_initrd) + free_reserved_area((void *)start, (void *)end, 0, "initrd"); } static int __init keepinitrd_setup(char *__unused)