Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3867254pxb; Tue, 10 Nov 2020 02:01:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQmJiMV7xnoLz9ewK8ZbM5lbWlLmOTa95721V8n6vPblYCSy7UZtPEQU4C+88m2qEGtY5J X-Received: by 2002:a17:906:b104:: with SMTP id u4mr18567299ejy.121.1605002510303; Tue, 10 Nov 2020 02:01:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605002510; cv=none; d=google.com; s=arc-20160816; b=WE8d7G0VIb+FQs8EJhzTU3y0t94PxVMySMrGPsjzdIuK3IT3U+YfruB46MtJLqH2M0 WI3RIbIxaEiVsGC/eMKxUrUq2OpE6GUCvoFzBSliYKKBNUPiuJkVODjkhdAQqU5bBZHN pqUmTtt2csSd+MnARItMM3gBdl1ufWKRgw311fbItjYr3LzKbVuVAfNp/zhTphnt9Van Ani5IuQ3s6rszLiivEDs65DpCjWHKm2Vh1fg9kPkEp5BbxHn/yHqAj4h7z8QAVFvzdur WVAHcaRFoGo39Tv8H9tm6uJItW/GYEd560G+T5vi0+vyotT5Cl6fhv8IBxzSJOwLGXuP oddw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=rAwuCjc3b3O1Pv1EgdI/u7eNGroTu4vt5GouEpnP46g=; b=w0MGX9XEBaQ6RnhQQv8yQLlsnoMenWknCmh+E2aDqA9TmAJbpykLncdHYSVqtIjsF6 XtYlvAX6SYi7VGpaRIikUZ/26O3pTnM5X4JUhFZU1CalK+5nXYY3qHHWrIPg4S7EVX8g 3vdHxdGA3j/94qv0pkMIQrx6Z/vnKug6SEcQzD6SJ4WlwopxLNLSP46DEAhg5wtI+yNK nH6z2hb0f4cyIGZGMZC94ewvO6th3GgzLHGkvcObNQsb4iNNBSFFbr00/s7wX6dNfPk4 +sFvMmtY6XbrTzlK5haWA8gVzXvTqtvEuKJAFC0klErDw6Ufcgrie8fFwHfYdQAyonY3 OwRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si9296349ejb.196.2020.11.10.02.01.24; Tue, 10 Nov 2020 02:01:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726993AbgKJJ7s (ORCPT + 99 others); Tue, 10 Nov 2020 04:59:48 -0500 Received: from elvis.franken.de ([193.175.24.41]:50392 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbgKJJ7s (ORCPT ); Tue, 10 Nov 2020 04:59:48 -0500 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1kcQRE-0003z6-00; Tue, 10 Nov 2020 10:59:44 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 028BDC4DDC; Tue, 10 Nov 2020 10:55:03 +0100 (CET) Date: Tue, 10 Nov 2020 10:55:03 +0100 From: Thomas Bogendoerfer To: Alexander Sverdlin Cc: Jiaxun Yang , linux-mips@vger.kernel.org, Paul Burton , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] MIPS: reserve the memblock right after the kernel Message-ID: <20201110095503.GA10357@alpha.franken.de> References: <20201106141001.57637-1-alexander.sverdlin@nokia.com> <20201107094028.GA4918@alpha.franken.de> <1d6a424e-944e-7f21-1f30-989fb61018a8@nokia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1d6a424e-944e-7f21-1f30-989fb61018a8@nokia.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 09, 2020 at 11:34:33AM +0100, Alexander Sverdlin wrote: > Hello Thomas, > > On 07/11/2020 10:40, Thomas Bogendoerfer wrote: > >> Linux doesn't own the memory immediately after the kernel image. On Octeon > >> bootloader places a shared structure right close after the kernel _end, > >> refer to "struct cvmx_bootinfo *octeon_bootinfo" in cavium-octeon/setup.c. > >> > >> If check_kernel_sections_mem() rounds the PFNs up, first memblock_alloc() > >> inside early_init_dt_alloc_memory_arch() <= device_tree_init() returns > >> memory block overlapping with the above octeon_bootinfo structure, which > >> is being overwritten afterwards. > > as this special for Octeon how about added the memblock_reserve > > in octen specific code ? > > while the shared structure which is being corrupted is indeed Octeon-specific, > the wrong assumption that the memory right after the kernel can be allocated by memblock > allocator and re-used somewhere in Linux is in MIPS-generic check_kernel_sections_mem(). ok, I see your point. IMHO this whole check_kernel_sections_mem() should be removed. IMHO memory adding should only be done my memory detection code. Could you send a patch, which removes check_kernel_section_mem completly ? Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]