From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DC6FC433E0 for ; Fri, 5 Feb 2021 19:48:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1877B64E75 for ; Fri, 5 Feb 2021 19:48:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1877B64E75 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8CE796B006C; Fri, 5 Feb 2021 14:48:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 87F236B006E; Fri, 5 Feb 2021 14:48:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 794E96B0070; Fri, 5 Feb 2021 14:48:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id 5F1766B006C for ; Fri, 5 Feb 2021 14:48:06 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 23839181AC1F5 for ; Fri, 5 Feb 2021 19:48:06 +0000 (UTC) X-FDA: 77785250172.03.crib11_0a12ffa275e7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 03BD428A4E9 for ; Fri, 5 Feb 2021 19:48:05 +0000 (UTC) X-HE-Tag: crib11_0a12ffa275e7 X-Filterd-Recvd-Size: 3761 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 19:48:05 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8735764FB9; Fri, 5 Feb 2021 19:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612554484; bh=GZ+b1kU4JUoiFiBwyWo3d5VZBweulhY5fb5aylFJK0M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TNSRusS29OM3NmEFZXrF8kbEORqk9Y9/ujpQm2/Cd02gVQdkSRe9c/tTdpdIFVG+R Slv3/yry59xcJI5l2g8H2mF1l3NenR4n+eyhSK1+m+Tqt5IqeYCXMkB95c2UFACvzd O3HxgN6fcA43asBKrO8Z3Ue6YONW9PsVvzOTIFk5YFoAEvOLanH9RW9adE6c3tCbE1 kP211K7KRN55TEUfLh3rfklKH1x/qDAPSm1ccsQ3bqFKmzXpBWTDr9JdhCT4G8gyZn w0qrLcbxvfyw9ZYROSUj0HJsgkbCUrcpAuydwb5IXnuFR+HjFmSBx8IseTtRWGA2+X WSDlQLhJ5tLqg== Date: Fri, 5 Feb 2021 21:47:54 +0200 From: Mike Rapoport To: Andrew Morton Cc: Andrea Arcangeli , Baoquan He , Borislav Petkov , David Hildenbrand , "H. Peter Anvin" , Ingo Molnar , Mel Gorman , Michal Hocko , Mike Rapoport , Qian Cai , Thomas Gleixner , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Subject: Re: [PATCH v2 0/2] x86/setup: consolidate early memory reservations Message-ID: <20210205194754.GT242749@kernel.org> References: <20210128105711.10428-1-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210128105711.10428-1-rppt@kernel.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, Any comments on this? On Thu, Jan 28, 2021 at 12:57:09PM +0200, Mike Rapoport wrote: > From: Mike Rapoport > > Hi, > > David noticed that we do some of memblock_reserve() calls after allocations > are possible: > > https://lore.kernel.org/lkml/6ba6bde3-1520-5cd0-f987-32d543f0b79f@redhat.com > > For now there is no actual problem because in top-down mode we allocate > from the end of the memory and in bottom-up mode we allocate above the > kernel image. But there is a patch in the mm tree that allow bottom-up > allocations below the kernel: > > https://lore.kernel.org/lkml/20201217201214.3414100-2-guro@fb.com > > and with this change we may get a memory corruption if an allocation steps > on some of the firmware areas that are yet to be reserved. > > The below patches consolidate early memory reservations done during > setup_arch() so that memory used by firmware, bootloader, kernel text/data > and the memory that should be excluded from the available memory for > whatever other reason is reserved before memblock allocations are possible. > > The patches are vs v5.11-rc3-mmots-2021-01-12-02-00 as I think they are > prerequisite for the memblock bottom-up changes, but if needed I can rebase > then on another tree. > > v2: > * get rid of trim_platform_memory_ranges() and call trim_snb_memory() > directly, per Boris comments > * massage changelog and comments to use passive voice, per Boris > * add Acked-by and Reviewed-by, thanks Boris and David > > v1: https://lore.kernel.org/lkml/20210115083255.12744-1-rppt@kernel.org > > Mike Rapoport (2): > x86/setup: consolidate early memory reservations > x86/setup: merge several reservations of start of the memory > > arch/x86/kernel/setup.c | 96 ++++++++++++++++++----------------------- > 1 file changed, 42 insertions(+), 54 deletions(-) > > -- > 2.28.0 > -- Sincerely yours, Mike.