]> git.baikalelectronics.ru Git - kernel.git/commit
x86/setup: Move trim_snb_memory() later in setup_arch() to fix boot hangs
authorMike Rapoport <rppt@linux.ibm.com>
Tue, 13 Apr 2021 18:08:39 +0000 (21:08 +0300)
committerBorislav Petkov <bp@suse.de>
Wed, 14 Apr 2021 06:16:48 +0000 (08:16 +0200)
commit74035816b0287ba530b74b624322c7cad9482ba2
treed5cada68dad8a404e442722cd815c9fb6268dbdb
parent1b38d780ca06e3cffd87ff6ddcf2c1e8f3f53f42
x86/setup: Move trim_snb_memory() later in setup_arch() to fix boot hangs

Commit

  89f8aa88fbbb ("x86/setup: Consolidate early memory reservations")

moved reservation of the memory inaccessible by Sandy Bride integrated
graphics very early, and, as a result, on systems with such devices
the first 1M was reserved by trim_snb_memory() which prevented the
allocation of the real mode trampoline and made the boot hang very
early.

Since the purpose of trim_snb_memory() is to prevent problematic pages
ever reaching the graphics device, it is safe to reserve these pages
after memblock allocations are possible.

Move trim_snb_memory() later in boot so that it will be called after
reserve_real_mode() and make comments describing trim_snb_memory()
operation more elaborate.

 [ bp: Massage a bit. ]

Fixes: 89f8aa88fbbb ("x86/setup: Consolidate early memory reservations")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Hugh Dickins <hughd@google.com>
Link: https://lkml.kernel.org/r/f67d3e03-af90-f790-baf4-8d412fe055af@infradead.org
arch/x86/kernel/setup.c