linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] x86/setup: consolidate early memory reservations
@ 2021-01-15  8:32 Mike Rapoport
  2021-01-15  8:32 ` [PATCH 1/2] " Mike Rapoport
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Mike Rapoport @ 2021-01-15  8:32 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andrea Arcangeli, Baoquan He, Borislav Petkov, David Hildenbrand,
	H. Peter Anvin, Ingo Molnar, Mel Gorman, Michal Hocko,
	Mike Rapoport, Mike Rapoport, Qian Cai, Thomas Gleixner,
	Vlastimil Babka, linux-kernel, linux-mm, x86

From: Mike Rapoport <rppt@linux.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.

Mike Rapoport (2):
  x86/setup: consolidate early memory reservations
  x86/setup: merge several reservations of start of the memory

 arch/x86/kernel/setup.c | 85 +++++++++++++++++++++--------------------
 1 file changed, 43 insertions(+), 42 deletions(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-01-25 16:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15  8:32 [PATCH 0/2] x86/setup: consolidate early memory reservations Mike Rapoport
2021-01-15  8:32 ` [PATCH 1/2] " Mike Rapoport
2021-01-15 10:10   ` David Hildenbrand
2021-01-25 14:50   ` Borislav Petkov
2021-01-25 15:31     ` Mike Rapoport
2021-01-25 16:56       ` Borislav Petkov
2021-01-25 14:59   ` Borislav Petkov
2021-01-25 15:33     ` Mike Rapoport
2021-01-15  8:32 ` [PATCH 2/2] x86/setup: merge several reservations of start of the memory Mike Rapoport
2021-01-15 10:09   ` David Hildenbrand
2021-01-25 14:55   ` Borislav Petkov
2021-01-15 11:42 ` [PATCH 0/2] x86/setup: consolidate early memory reservations Baoquan He
2021-01-15 11:56   ` Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).