From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751166AbeAVVri (ORCPT ); Mon, 22 Jan 2018 16:47:38 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:41690 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbeAVVrg (ORCPT ); Mon, 22 Jan 2018 16:47:36 -0500 X-Google-Smtp-Source: AH8x2248mOc7Lbv2JAvk1dLLiFtjira9DET1L6lLqOEo3ArRQGpE2GCKbRLKXGvU+DmGNHgqoyA/eQ== Date: Tue, 23 Jan 2018 00:47:46 +0300 From: Serge Semin To: Matt Redfearn Cc: ralf@linux-mips.org, miodrag.dinic@mips.com, jhogan@kernel.org, goran.ferenc@mips.com, david.daney@cavium.com, paul.gortmaker@windriver.com, paul.burton@mips.com, alex.belits@cavium.com, Steven.Hill@cavium.com, alexander.sverdlin@nokia.com, kumba@gentoo.org, marcin.nowakowski@mips.com, James.hogan@mips.com, Peter.Wotton@mips.com, Sergey.Semin@t-platforms.ru, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/14] MIPS: memblock: Surely map BSS kernel memory section Message-ID: <20180122214746.GC32024@mobilestation> References: <20180117222312.14763-1-fancer.lancer@gmail.com> <20180117222312.14763-3-fancer.lancer@gmail.com> <3fbb8850-bf34-d698-299a-f1cd62d063ae@mips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3fbb8850-bf34-d698-299a-f1cd62d063ae@mips.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Matt, On Mon, Jan 22, 2018 at 04:35:26PM +0000, Matt Redfearn wrote: > Hi Serge, > > On 17/01/18 22:23, Serge Semin wrote: > >The current MIPS code makes sure the kernel code/data/init > >sections are in the maps, but BSS should also be there. > > Quite right - it should. But this was protected against by reserving all > bootmem up to the _end symbol here: > http://elixir.free-electrons.com/linux/v4.15-rc8/source/arch/mips/kernel/setup.c#L388 > Which you remove in the next patch in this series. I'm not sure it is worth Right. Missed that part. The old code just doesn't set the kernel memory free calling the free_bootmem() method for non-reserved parts below reserved_end. > disentangling the reserved_end stuff from the next patch to make this into a > single logical change of reserving just .bss rather than everything below > _end. Good point. I'll move this change into the "[PATCH 05/14] MIPS: memblock: Add reserved memory regions to memblock". It logically belongs to that place. Since basically by the arch_mem_addpart() calls we reserve all the kernel memory now I'd also merged them into a single call for the range [_text, _end]. What do you think? Regards, -Sergey > > Reviewed-by: Matt Redfearn > > Thanks, > Matt > > > > >Signed-off-by: Serge Semin > >--- > > arch/mips/kernel/setup.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > >diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > >index 76e9e2075..0d21c9e04 100644 > >--- a/arch/mips/kernel/setup.c > >+++ b/arch/mips/kernel/setup.c > >@@ -845,6 +845,9 @@ static void __init arch_mem_init(char **cmdline_p) > > arch_mem_addpart(PFN_UP(__pa_symbol(&__init_begin)) << PAGE_SHIFT, > > PFN_DOWN(__pa_symbol(&__init_end)) << PAGE_SHIFT, > > BOOT_MEM_INIT_RAM); > >+ arch_mem_addpart(PFN_DOWN(__pa_symbol(&__bss_start)) << PAGE_SHIFT, > >+ PFN_UP(__pa_symbol(&__bss_stop)) << PAGE_SHIFT, > >+ BOOT_MEM_RAM); > > pr_info("Determined physical RAM map:\n"); > > print_memory_map(); > >