mm/memblock.c: add new infrastructure to address the mem limit issue
authorDennis Chen <[email protected]>
Thu, 28 Jul 2016 22:48:26 +0000 (15:48 -0700)
committerLinus Torvalds <[email protected]>
Thu, 28 Jul 2016 23:07:41 +0000 (16:07 -0700)
commita571d4eb55d83ff538d98870fa8a8497b24d39bc
tree84435c6a620b12ebdb3fed0181ff91bc68353e93
parent8b70ca65616b3588ea1907e87f0df6d2530350df
mm/memblock.c: add new infrastructure to address the mem limit issue

In some cases, memblock is queried by kernel to determine whether a
specified address is RAM or not.  For example, the ACPI core needs this
information to determine which attributes to use when mapping ACPI
regions(acpi_os_ioremap).  Use of incorrect memory types can result in
faults, data corruption, or other issues.

Removing memory with memblock_enforce_memory_limit() throws away this
information, and so a kernel booted with 'mem=' may suffer from the
issues described above.  To avoid this, we need to keep those NOMAP
regions instead of removing all above the limit, which preserves the
information we need while preventing other use of those regions.

This patch adds new infrastructure to retain all NOMAP memblock regions
while removing others, to cater for this.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Dennis Chen <[email protected]>
Acked-by: Steve Capper <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Tang Chen <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Matt Fleming <[email protected]>
Cc: Kaly Xin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/memblock.h
mm/memblock.c