[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210128105711.10428-1-rppt@kernel.org>
Date: Thu, 28 Jan 2021 12:57:09 +0200
From: Mike Rapoport <rppt@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrea Arcangeli <aarcange@...hat.com>,
Baoquan He <bhe@...hat.com>, Borislav Petkov <bp@...en8.de>,
David Hildenbrand <david@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
Mel Gorman <mgorman@...e.de>, Michal Hocko <mhocko@...nel.org>,
Mike Rapoport <rppt@...nel.org>,
Mike Rapoport <rppt@...ux.ibm.com>, Qian Cai <cai@....pw>,
Thomas Gleixner <tglx@...utronix.de>,
Vlastimil Babka <vbabka@...e.cz>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, x86@...nel.org
Subject: [PATCH v2 0/2] x86/setup: consolidate early memory reservations
From: Mike Rapoport <rppt@...ux.ibm.com>
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
Powered by blists - more mailing lists