linux-hardened/arch/mips/cavium-octeon
David Daney 43064c0c8e MIPS: Handle initmem in systems with kernel not in add_memory_region() mem
This patch addresses a couple of related problems:

1) The kernel may reside in physical memory outside of the ranges set
   by plat_mem_setup().  If this is the case, init mem cannot be
   reused as it resides outside of the range of pages that the kernel
   memory allocators control.

2) initrd images might be loaded in physical memory outside of the
   ranges set by plat_mem_setup().  The memory likewise cannot be
   reused.  The patch doesn't handle this specific case, but the
   infrastructure is useful for future patches that do.

The crux of the problem is that there are memory regions that need be
memory_present(), but that cannot be free_bootmem() at the time of
arch_mem_init().  We create a new type of memory (BOOT_MEM_INIT_RAM)
for use with add_memory_region().  Then arch_mem_init() adds the init
mem with this type if the init mem is not already covered by existing
ranges.

When memory is being freed into the bootmem allocator, we skip the
BOOT_MEM_INIT_RAM ranges so they are not clobbered, but we do signal
them as memory_present().  This way when they are later freed, the
necessary memory manager structures have initialized and the Sparse
allocater is prevented from crashing.

The Octeon specific code that handled this case is removed, because
the new general purpose code handles the case.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/1988/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-12-07 22:03:45 +00:00
..
executive Fix common misspellings 2011-03-31 11:26:23 -03:00
cpu.c MIPS: Octeon: Place cnmips_cu2_setup in __init memory. 2010-10-04 18:34:00 +01:00
csrc-octeon.c mips: add export.h to files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:30:57 -04:00
dma-octeon.c mips: add export.h to files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:30:57 -04:00
flash_setup.c MIPS: Octeon: Fix compile error in arch/mips/cavium-octeon/flash_setup.c 2011-11-10 17:59:45 +00:00
Kconfig MIPS: Octeon: Guard the Kconfig body with CPU_CAVIUM_OCTEON 2011-05-10 18:15:24 +01:00
Makefile MIPS: Octeon: Migrate to new platform makefile style. 2010-08-05 13:25:54 +01:00
octeon-irq.c MIPS: Octeon: Simplify irq_cpu_on/offline irq chip functions 2011-03-29 14:48:07 +02:00
octeon-memcpy.S MIPS: Add Cavium OCTEON processor support files to arch/mips/cavium-octeon. 2009-01-11 09:57:21 +00:00
octeon-platform.c Fix common misspellings 2011-03-31 11:26:23 -03:00
octeon_boot.h MIPS: Octeon: HOTPLUG_CPU fixes. 2010-08-05 13:26:12 +01:00
Platform MIPS: Octeon: Migrate to new platform makefile style. 2010-08-05 13:25:54 +01:00
serial.c MIPS: Octeon: Use I/O clock rate for calculations. 2010-10-29 19:08:41 +01:00
setup.c MIPS: Handle initmem in systems with kernel not in add_memory_region() mem 2011-12-07 22:03:45 +00:00
smp.c MIPS: Octeon: Mark SMP-IPI interrupt as IRQF_NO_THREAD 2011-11-08 12:35:30 +00:00