]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: Octeon: Don't clobber bootloader data structures.
authorDavid Daney <david.daney@cavium.com>
Wed, 12 Jun 2013 17:28:33 +0000 (17:28 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 18 Jun 2013 19:26:55 +0000 (21:26 +0200)
Commit abe77f90dc (MIPS: Octeon: Add kexec and kdump support) added a
bootmem region for the kernel image itself.  The problem is that this
is rounded up to a 0x100000 boundary, which is memory that may not be
owned by the kernel.  Depending on the kernel's configuration based
size, this 'extra' memory may contain data passed from the bootloader
to the kernel itself, which if clobbered makes the kernel crash in
various ways.

The fix: Quit rounding the size up, so that we only use memory
assigned to the kernel.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: <stable@vger.kernel.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5449/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/cavium-octeon/setup.c

index 1bcc144da287c430b8b3dab8a35bb4dc6f95e14f..2a75ff249e7156cec2e424f79e2caedf6163c78e 100644 (file)
@@ -997,7 +997,7 @@ void __init plat_mem_setup(void)
        cvmx_bootmem_unlock();
        /* Add the memory region for the kernel. */
        kernel_start = (unsigned long) _text;
-       kernel_size = ALIGN(_end - _text, 0x100000);
+       kernel_size = _end - _text;
 
        /* Adjust for physical offset. */
        kernel_start &= ~0xffffffff80000000ULL;