Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp864762imm; Fri, 3 Aug 2018 13:00:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdDqgXsq+iLY+Zg+xbUSpurr/V2KRddJPgbchdv7g1iwUQXiFx+9Zbw3Qkq6iYwjzyembX0 X-Received: by 2002:a17:902:bc8b:: with SMTP id bb11-v6mr4768227plb.112.1533326420770; Fri, 03 Aug 2018 13:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533326420; cv=none; d=google.com; s=arc-20160816; b=jFGHXxeFTxe2xP9p4bpxipEwc1SbsFjGeZwSWuKhr9ehyvW5N2OO0yfIPwwn3D+HWh iC7hpeA7SYj4Grh3p5qvl1qrq9QEjVUlwB2s9bmC8AYlXjJ7rUG0JAOl4YWckVsT0og0 bTQURcJJ0YQPiBUSVAYWo/tT38+b5Wjxw7MbqmmP+FjeGyqRON8Nhk1wici4MFwMpfkV vKBQMZX/+FcoQw70+aB8cSq7uxvxsGZJLv4fpM1ZpZlppzYKOzdfIIrl7VwRflLPgXk9 FqYAVaHEWMzmjaFN3y+h++JoskXkwJcAA4rp2KjkzucfGYIv2f3XPwWu8Lli7LsmCmXG laDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=Cqm36fpOAU70frvWhQ9HoHzoDyPlisdeTImeBo/S3QE=; b=skxdp7jbC0Dz6ovrGsYLX8+ycrN8efQWuT19WOBnRIgAJo7Vx6sPoP5zBCHkD66tN4 aTZabNLR4FtJjducSToF0cWNHJWySCk3kOZcBmmcAFfQzBVpMWkpBWJiJn9xJgkWV1NU ntYHgwFhwZT+cQqHfKFXVNsicRNIhaNIv6ttiMPObf+yJOoMcv1zbDuw+gOYoRW8dMFJ jBBvOSpPiRH1HgRalvH8njW2yKwkHeQx0DIkMx20VPVCfgZvino8aJkPWSvJ1oUnjDvd YBRZ0YEPm0vjqZamP4jaYTlxfaIHbdawvsgKZDYoHJaGlkpueqv9zcWD0AMIgYv8wg04 usFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si4418273plu.65.2018.08.03.13.00.05; Fri, 03 Aug 2018 13:00:20 -0700 (PDT) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731689AbeHCV46 (ORCPT + 99 others); Fri, 3 Aug 2018 17:56:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58484 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732201AbeHCV45 (ORCPT ); Fri, 3 Aug 2018 17:56:57 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w73Jx4N0116444 for ; Fri, 3 Aug 2018 15:59:13 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2kmshah83a-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 03 Aug 2018 15:59:12 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 3 Aug 2018 20:59:11 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) 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) Fri, 3 Aug 2018 20:59:08 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w73Jx70C35586056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 Aug 2018 19:59:07 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4E861AE051; Fri, 3 Aug 2018 22:59:05 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0E923AE045; Fri, 3 Aug 2018 22:59:03 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.204.91]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 3 Aug 2018 22:59:02 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 03 Aug 2018 22:59:04 +0300 From: Mike Rapoport To: Andrew Morton Cc: Richard Kuo , Ley Foon Tan , Richard Weinberger , Guan Xuetao , Michal Hocko , linux-hexagon@vger.kernel.org, nios2-dev@lists.rocketboards.org, linux-um@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH 4/7] nios2: switch to NO_BOOTMEM Date: Fri, 3 Aug 2018 22:58:47 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18080319-0008-0000-0000-0000025C97DA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080319-0009-0000-0000-000021C33DCC Message-Id: <1533326330-31677-5-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-03_08:,, 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=964 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808030216 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove bootmem bitmap initialization and replace reserve_bootmem() with memblock_reserve(). Signed-off-by: Mike Rapoport Acked-by: Ley Foon Tan --- arch/nios2/Kconfig | 2 ++ arch/nios2/kernel/prom.c | 7 ------- arch/nios2/kernel/setup.c | 37 +++++-------------------------------- 3 files changed, 7 insertions(+), 39 deletions(-) diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig index 5db8fa1..661f7f9 100644 --- a/arch/nios2/Kconfig +++ b/arch/nios2/Kconfig @@ -20,6 +20,8 @@ config NIOS2 select USB_ARCH_HAS_HCD if USB_SUPPORT select CPU_NO_EFFICIENT_FFS select HAVE_MEMBLOCK + select ARCH_DISCARD_MEMBLOCK + select NO_BOOTMEM config GENERIC_CSUM def_bool y diff --git a/arch/nios2/kernel/prom.c b/arch/nios2/kernel/prom.c index ba96a49..a6d4f75 100644 --- a/arch/nios2/kernel/prom.c +++ b/arch/nios2/kernel/prom.c @@ -32,13 +32,6 @@ #include -int __init early_init_dt_reserve_memory_arch(phys_addr_t base, phys_addr_t size, - bool nomap) -{ - reserve_bootmem(base, size, BOOTMEM_DEFAULT); - return 0; -} - void __init early_init_devtree(void *params) { __be32 *dtb = (u32 *)__dtb_start; diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c index 0946840..2d0011d 100644 --- a/arch/nios2/kernel/setup.c +++ b/arch/nios2/kernel/setup.c @@ -144,10 +144,11 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, void __init setup_arch(char **cmdline_p) { - int bootmap_size; + int dram_start; console_verbose(); + dram_start = memblock_start_of_DRAM(); memory_size = memblock_phys_mem_size(); memory_start = PAGE_ALIGN((unsigned long)__pa(_end)); memory_end = (unsigned long) CONFIG_NIOS2_MEM_BASE + memory_size; @@ -165,39 +166,11 @@ void __init setup_arch(char **cmdline_p) max_low_pfn = PFN_DOWN(memory_end); max_mapnr = max_low_pfn; - /* - * give all the memory to the bootmap allocator, tell it to put the - * boot mem_map at the start of memory - */ - pr_debug("init_bootmem_node(?,%#lx, %#x, %#lx)\n", - min_low_pfn, PFN_DOWN(PHYS_OFFSET), max_low_pfn); - bootmap_size = init_bootmem_node(NODE_DATA(0), - min_low_pfn, PFN_DOWN(PHYS_OFFSET), - max_low_pfn); - - /* - * free the usable memory, we have to make sure we do not free - * the bootmem bitmap so we then reserve it after freeing it :-) - */ - pr_debug("free_bootmem(%#lx, %#lx)\n", - memory_start, memory_end - memory_start); - free_bootmem(memory_start, memory_end - memory_start); - - /* - * Reserve the bootmem bitmap itself as well. We do this in two - * steps (first step was init_bootmem()) because this catches - * the (very unlikely) case of us accidentally initializing the - * bootmem allocator with an invalid RAM area. - * - * Arguments are start, size - */ - pr_debug("reserve_bootmem(%#lx, %#x)\n", memory_start, bootmap_size); - reserve_bootmem(memory_start, bootmap_size, BOOTMEM_DEFAULT); - + memblock_reserve(dram_start, memory_start - dram_start); #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start) { - reserve_bootmem(virt_to_phys((void *)initrd_start), - initrd_end - initrd_start, BOOTMEM_DEFAULT); + memblock_reserve(virt_to_phys((void *)initrd_start), + initrd_end - initrd_start); } #endif /* CONFIG_BLK_DEV_INITRD */ -- 2.7.4