From patchwork Thu Feb 14 15:59:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10813123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B574E1390 for ; Thu, 14 Feb 2019 15:59:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F5E32EB7E for ; Thu, 14 Feb 2019 15:59:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F87B2EC4F; Thu, 14 Feb 2019 15:59:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1E20A2EB7E for ; Thu, 14 Feb 2019 15:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id: References:In-Reply-To:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=L/SFU5ES/op78zNilDJCFu3M7Q1kJLnCqTMPwRYsPVc=; b=ragmz/Ef89UuDfUFH6woE9+UFJ dzYVOtmax5wy86Id7VpL65jGUzG9LPBtXhr2+oCd5811Q7qGn06t3nr0hnAQTcYL/aiOPQsHBx59j 2IXfN0Ceyk6v7pV+f7U60JsoCEHf7cpmoT2kD3KvLH0GGjQaOdLViEFjoEaUwiVSWVzNKxBDSMvRD mcjZt160jYCUZnp2B/+A7duis4JfCyQg3vZzvkcacBWyIn2/PpiV5dD20KVz8gcFd6w6/XgsaPLaI Ssbq+tWy9d4FhUokgQx8as5kpaZpVJ5bCsuBCUS3paG6fyclcTxlGGdgJ70RaDKqzpHiOXDVH5UzA nlIKFL6g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1guJQZ-0002Dh-QK; Thu, 14 Feb 2019 15:59:55 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1guJQV-0002Aa-SE for linux-riscv@lists.infradead.org; Thu, 14 Feb 2019 15:59:53 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1EFgotg103937 for ; Thu, 14 Feb 2019 10:59:51 -0500 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2qnavjatpt-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Feb 2019 10:59:50 -0500 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Feb 2019 15:59:47 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 14 Feb 2019 15:59:44 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1EFxhpd7602456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 14 Feb 2019 15:59:43 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1C95AAE051; Thu, 14 Feb 2019 15:59:43 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 55394AE053; Thu, 14 Feb 2019 15:59:41 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.84]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 14 Feb 2019 15:59:41 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Thu, 14 Feb 2019 17:59:40 +0200 From: Mike Rapoport To: Andrew Morton Subject: [PATCH 1/4] init: provide a generic free_initmem implementation Date: Thu, 14 Feb 2019 17:59:34 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> References: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19021415-4275-0000-0000-0000030F8541 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021415-4276-0000-0000-0000381DA1A3 Message-Id: <1550159977-8949-2-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-14_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=726 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902140109 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190214_075952_031361_53BF23D0 X-CRM114-Status: GOOD ( 18.81 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-hexagon@vger.kernel.org, Palmer Dabbelt , linux-kernel@vger.kernel.org, Richard Kuo , linux-mm@kvack.org, linux-riscv@lists.infradead.org, Mike Rapoport , Christoph Hellwig MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP For most architectures free_initmem just a wrapper for the same free_initmem_default(-1) call. Provide that as a generic implementation marked __weak. Signed-off-by: Mike Rapoport --- arch/alpha/mm/init.c | 6 ------ arch/arc/mm/init.c | 8 -------- arch/c6x/mm/init.c | 5 ----- arch/h8300/mm/init.c | 6 ------ arch/microblaze/mm/init.c | 5 ----- arch/nds32/mm/init.c | 5 ----- arch/nios2/mm/init.c | 5 ----- arch/openrisc/mm/init.c | 5 ----- arch/sh/mm/init.c | 5 ----- arch/unicore32/mm/init.c | 5 ----- arch/xtensa/mm/init.c | 5 ----- init/main.c | 5 +++++ 12 files changed, 5 insertions(+), 60 deletions(-) diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c index a42fc5c..8a8ac09 100644 --- a/arch/alpha/mm/init.c +++ b/arch/alpha/mm/init.c @@ -286,12 +286,6 @@ mem_init(void) mem_init_print_info(NULL); } -void -free_initmem(void) -{ - free_initmem_default(-1); -} - #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c index e1ab2d7..1d08736 100644 --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c @@ -207,14 +207,6 @@ void __init mem_init(void) mem_init_print_info(NULL); } -/* - * free_initmem: Free all the __init memory. - */ -void __ref free_initmem(void) -{ - free_initmem_default(-1); -} - #ifdef CONFIG_BLK_DEV_INITRD void __init free_initrd_mem(unsigned long start, unsigned long end) { diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c index af5ada0..ca1c182 100644 --- a/arch/c6x/mm/init.c +++ b/arch/c6x/mm/init.c @@ -73,8 +73,3 @@ void __init free_initrd_mem(unsigned long start, unsigned long end) free_reserved_area((void *)start, (void *)end, -1, "initrd"); } #endif - -void __init free_initmem(void) -{ - free_initmem_default(-1); -} diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c index 6519252..fabf9e3 100644 --- a/arch/h8300/mm/init.c +++ b/arch/h8300/mm/init.c @@ -108,9 +108,3 @@ void free_initrd_mem(unsigned long start, unsigned long end) free_reserved_area((void *)start, (void *)end, -1, "initrd"); } #endif - -void -free_initmem(void) -{ - free_initmem_default(-1); -} diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c index b17fd8a..4d6fa630 100644 --- a/arch/microblaze/mm/init.c +++ b/arch/microblaze/mm/init.c @@ -193,11 +193,6 @@ void free_initrd_mem(unsigned long start, unsigned long end) } #endif -void free_initmem(void) -{ - free_initmem_default(-1); -} - void __init mem_init(void) { high_memory = (void *)__va(memory_start + lowmem_size - 1); diff --git a/arch/nds32/mm/init.c b/arch/nds32/mm/init.c index 253f79f..8a1563e 100644 --- a/arch/nds32/mm/init.c +++ b/arch/nds32/mm/init.c @@ -244,11 +244,6 @@ void __init mem_init(void) return; } -void free_initmem(void) -{ - free_initmem_default(-1); -} - #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) { diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c index 16cea57..362a7a7 100644 --- a/arch/nios2/mm/init.c +++ b/arch/nios2/mm/init.c @@ -89,11 +89,6 @@ void __init free_initrd_mem(unsigned long start, unsigned long end) } #endif -void __ref free_initmem(void) -{ - free_initmem_default(-1); -} - #define __page_aligned(order) __aligned(PAGE_SIZE << (order)) pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER); pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER); diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c index d157310..bf3a160 100644 --- a/arch/openrisc/mm/init.c +++ b/arch/openrisc/mm/init.c @@ -227,8 +227,3 @@ void free_initrd_mem(unsigned long start, unsigned long end) free_reserved_area((void *)start, (void *)end, -1, "initrd"); } #endif - -void free_initmem(void) -{ - free_initmem_default(-1); -} diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index a8e5c0e..bc59332 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -405,11 +405,6 @@ void __init mem_init(void) mem_init_done = 1; } -void free_initmem(void) -{ - free_initmem_default(-1); -} - #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) { diff --git a/arch/unicore32/mm/init.c b/arch/unicore32/mm/init.c index 85ef2c6..3aed4d5 100644 --- a/arch/unicore32/mm/init.c +++ b/arch/unicore32/mm/init.c @@ -312,11 +312,6 @@ void __init mem_init(void) } } -void free_initmem(void) -{ - free_initmem_default(-1); -} - #ifdef CONFIG_BLK_DEV_INITRD static int keep_initrd; diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index d498610..b51746f 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c @@ -216,11 +216,6 @@ void free_initrd_mem(unsigned long start, unsigned long end) } #endif -void free_initmem(void) -{ - free_initmem_default(-1); -} - static void __init parse_memmap_one(char *p) { char *oldp; diff --git a/init/main.c b/init/main.c index c86a1c8..38d69e0 100644 --- a/init/main.c +++ b/init/main.c @@ -1047,6 +1047,11 @@ static inline void mark_readonly(void) } #endif +void __weak free_initmem(void) +{ + free_initmem_default(-1); +} + static int __ref kernel_init(void *unused) { int ret; From patchwork Thu Feb 14 15:59:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10813129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0D971390 for ; Thu, 14 Feb 2019 16:00:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD0D02EC78 for ; Thu, 14 Feb 2019 16:00:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0F002ECC1; Thu, 14 Feb 2019 16:00:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42EB32EC78 for ; Thu, 14 Feb 2019 16:00:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id: References:In-Reply-To:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=z81KmuYsC1W1oIOTvgFsFXnq2Wy6tIo2VK87PcDJjaI=; b=bJ0XyjWKuf8kZLSIXfqigTySD6 qoPRfHIf8LBspouDvJG+22/5nSSWIx0Iy/BddjRaPT/7+aVH1a02Y9A3+OXguw0M12GGr7AyOkQa4 gRnCiVwAyI/Nm2hd56W79hAXPe8jHCEgqoKa4j0st9xmPxD6bagkRde0fvONlU5HC21V732esMjO+ /OI8KlWVR6I/9Kqz0cD/GkyzlJ8TwNQOALjNsTqkfkp+0/pcIPkPkQKnMo15I6z5PE3xGJXM5AMky InHufRvaqi+SE6V5m1kEE4BoMApodAaEN9YHSDn0QMgrNmLI9iYTRRikU35g6Lv0GTPuIAi5aGd8M YVcc+lvg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1guJQl-0002c2-71; Thu, 14 Feb 2019 16:00:07 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1guJQX-0002Cb-6S for linux-riscv@lists.infradead.org; Thu, 14 Feb 2019 15:59:58 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1EFhxOm053723 for ; Thu, 14 Feb 2019 10:59:52 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qnb3b1mwp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Feb 2019 10:59:52 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Feb 2019 15:59:49 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 14 Feb 2019 15:59:46 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1EFxjfa1114552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 14 Feb 2019 15:59:45 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8AAFD4C046; Thu, 14 Feb 2019 15:59:45 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C3AC44C040; Thu, 14 Feb 2019 15:59:43 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.84]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 14 Feb 2019 15:59:43 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Thu, 14 Feb 2019 17:59:43 +0200 From: Mike Rapoport To: Andrew Morton Subject: [PATCH 2/4] hexagon: switch over to generic free_initmem() Date: Thu, 14 Feb 2019 17:59:35 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> References: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19021415-0028-0000-0000-0000034898F5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021415-0029-0000-0000-00002406C568 Message-Id: <1550159977-8949-3-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-14_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=769 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902140109 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190214_075953_423739_CC1F72D5 X-CRM114-Status: GOOD ( 18.76 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-hexagon@vger.kernel.org, Palmer Dabbelt , linux-kernel@vger.kernel.org, Richard Kuo , linux-mm@kvack.org, linux-riscv@lists.infradead.org, Mike Rapoport , Christoph Hellwig MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP hexagon implementation of free_initmem() is currently empty and marked with comment * Todo: free pages between __init_begin and __init_end; possibly * some devtree related stuff as well. Switch it to the generic implementation. Signed-off-by: Mike Rapoport --- arch/hexagon/mm/init.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/arch/hexagon/mm/init.c b/arch/hexagon/mm/init.c index 1719ede..41cf342 100644 --- a/arch/hexagon/mm/init.c +++ b/arch/hexagon/mm/init.c @@ -85,16 +85,6 @@ void __init mem_init(void) } /* - * free_initmem - frees memory used by stuff declared with __init - * - * Todo: free pages between __init_begin and __init_end; possibly - * some devtree related stuff as well. - */ -void __ref free_initmem(void) -{ -} - -/* * free_initrd_mem - frees... initrd memory. * @start - start of init memory * @end - end of init memory From patchwork Thu Feb 14 15:59:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10813131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81F3C13A4 for ; Thu, 14 Feb 2019 16:00:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FFDE2EC78 for ; Thu, 14 Feb 2019 16:00:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6423F2ECC7; Thu, 14 Feb 2019 16:00:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4F13B2EBB5 for ; Thu, 14 Feb 2019 16:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id: References:In-Reply-To:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Uop5/4nr5TGchJ1TXjYUwc9j3xwI8ytKK+v786gy3o0=; b=uLHEl13ZJapHRfqMe0mLKzfDkm sIhh4HjviazB0hy7ywiyEQn+K5SAkhxbG8EIoqnf3Fge0lbgQTF2ZIUCtrGmUDtKxQUh5izBFFZOi JNkyvrepBnlAeG7hJ493uqxcZeD8SNyFTE/3GDgVCLedwtK8sSnP9xsgNlc2Aq/B0f5X0jI/keEK+ zhykuW06+BvT71BP3QU6TBqfhSbWM3BiBMX/CLHvTZLsGOmfIJ9qzhIYoCy8ZxREZD4YzDOpnXBE/ PnLf9B7fhJe7o4YuBOr39tp+VO0D2Hh0mRDHFfxYgqRX8PBdRwn2Zo9kbWfv/QwLSOstzGttYLIWv 0cBUp3Xg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1guJQm-0002kI-Vd; Thu, 14 Feb 2019 16:00:08 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1guJQa-0002Dp-B3 for linux-riscv@lists.infradead.org; Thu, 14 Feb 2019 16:00:00 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1EFiBn4003936 for ; Thu, 14 Feb 2019 10:59:55 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qna7gdke8-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Feb 2019 10:59:55 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Feb 2019 15:59:52 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 14 Feb 2019 15:59:49 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1EFxmF524445166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 14 Feb 2019 15:59:48 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 00D6F11C05C; Thu, 14 Feb 2019 15:59:48 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41C2311C04C; Thu, 14 Feb 2019 15:59:46 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.84]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 14 Feb 2019 15:59:46 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Thu, 14 Feb 2019 17:59:45 +0200 From: Mike Rapoport To: Andrew Morton Subject: [PATCH 3/4] init: free_initmem: poison freed init memory Date: Thu, 14 Feb 2019 17:59:36 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> References: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19021415-0008-0000-0000-000002C07EAB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021415-0009-0000-0000-0000222CA1C3 Message-Id: <1550159977-8949-4-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-14_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=839 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902140109 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190214_075956_917174_AB9B875E X-CRM114-Status: GOOD ( 19.32 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-hexagon@vger.kernel.org, Palmer Dabbelt , linux-kernel@vger.kernel.org, Richard Kuo , linux-mm@kvack.org, linux-riscv@lists.infradead.org, Mike Rapoport , Christoph Hellwig MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Various architectures including x86 poison the freed init memory. Do the same in the generic free_initmem implementation and switch sparc32 architecture that is identical to the generic code over to it now. Signed-off-by: Mike Rapoport --- arch/sparc/mm/init_32.c | 5 ----- init/main.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c index d900952..77e8341 100644 --- a/arch/sparc/mm/init_32.c +++ b/arch/sparc/mm/init_32.c @@ -294,11 +294,6 @@ void __init mem_init(void) mem_init_print_info(NULL); } -void free_initmem (void) -{ - free_initmem_default(POISON_FREE_INITMEM); -} - #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) { diff --git a/init/main.c b/init/main.c index 38d69e0..9a61e9c 100644 --- a/init/main.c +++ b/init/main.c @@ -1049,7 +1049,7 @@ static inline void mark_readonly(void) void __weak free_initmem(void) { - free_initmem_default(-1); + free_initmem_default(POISON_FREE_INITMEM); } static int __ref kernel_init(void *unused) From patchwork Thu Feb 14 15:59:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10813133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6311C13A4 for ; Thu, 14 Feb 2019 16:00:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FD672EB7E for ; Thu, 14 Feb 2019 16:00:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 432352ECC6; Thu, 14 Feb 2019 16:00:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F036E2ECC3 for ; Thu, 14 Feb 2019 16:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id: References:In-Reply-To:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=hrlYCucmgWa7Rd04Z/UD1d/cJMeEEsNGD0v6HtCqxIs=; b=Z7zwgtMhUAHsBXgV/YpLS+IkRR bqF3+8NId0MPa8eWmz3sE4USAjIvz0O+G8ESwqU5jSn4birFADztuJzn8lgKoIEDzf179P0ur6o5A C6x5UcO5T5LxOZBGr/1NmdTjeJrlOgdk1ZtNQeexx6qpLlyGYdAMGEvKoYiq4qf21rEmWW8yZUc4I ZtUo9QaNcbFUdTdYGiCtSyJ908GASApEmU4VdSCtpJ2sTV3b2McvmQhFDCDtUVrx30EsRqHdMSuV7 bYKf5vLRSbAbFMj6mNjnDahRShZX1HDLXmuraN4yiY+P32eYf2qMXmfhDqGUqhJhrGpcELnTdm+YY ynpjITFQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1guJQp-0002tY-Kx; Thu, 14 Feb 2019 16:00:11 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1guJQc-0002GP-8a for linux-riscv@lists.infradead.org; Thu, 14 Feb 2019 16:00:01 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1EFg1f1119685 for ; Thu, 14 Feb 2019 10:59:57 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qnaktv9b9-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Feb 2019 10:59:56 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Feb 2019 15:59:54 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 14 Feb 2019 15:59:51 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1EFxo6f48759004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Feb 2019 15:59:50 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 696F752054; Thu, 14 Feb 2019 15:59:50 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.84]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 987E052052; Thu, 14 Feb 2019 15:59:48 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Thu, 14 Feb 2019 17:59:48 +0200 From: Mike Rapoport To: Andrew Morton Subject: [PATCH 4/4] riscv: switch over to generic free_initmem() Date: Thu, 14 Feb 2019 17:59:37 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> References: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19021415-0016-0000-0000-000002567B00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021415-0017-0000-0000-000032B0AC03 Message-Id: <1550159977-8949-5-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-14_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=756 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902140109 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190214_075958_920115_8459622D X-CRM114-Status: GOOD ( 18.92 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-hexagon@vger.kernel.org, Palmer Dabbelt , linux-kernel@vger.kernel.org, Richard Kuo , linux-mm@kvack.org, linux-riscv@lists.infradead.org, Mike Rapoport , Christoph Hellwig MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The riscv version of free_initmem() differs from the generic one only in that it sets the freed memory to zero. Make ricsv use the generic version and poison the freed memory. Signed-off-by: Mike Rapoport Reviewed-by: Palmer Dabbelt --- arch/riscv/mm/init.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 658ebf6..2af0010 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -60,11 +60,6 @@ void __init mem_init(void) mem_init_print_info(NULL); } -void free_initmem(void) -{ - free_initmem_default(0); -} - #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) {