aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Daney <david.daney@cavium.com>2013-06-12 13:28:33 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-25 17:07:42 -0400
commitd6d10b1dceba6ed2b3d74207b2a454c2f4427785 (patch)
treecb8d46a334ac4a6de4924106c470d8422b918513
parentd8724a91bc631690af241588936971214e55927e (diff)
MIPS: Octeon: Don't clobber bootloader data structures.
commit d949b4fe6d23dd92b5fa48cbf7af90ca32beed2e upstream. 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: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/5449/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/mips/cavium-octeon/setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index 01b1b3f94feb..1e1e18c5a534 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -996,7 +996,7 @@ void __init plat_mem_setup(void)
996 cvmx_bootmem_unlock(); 996 cvmx_bootmem_unlock();
997 /* Add the memory region for the kernel. */ 997 /* Add the memory region for the kernel. */
998 kernel_start = (unsigned long) _text; 998 kernel_start = (unsigned long) _text;
999 kernel_size = ALIGN(_end - _text, 0x100000); 999 kernel_size = _end - _text;
1000 1000
1001 /* Adjust for physical offset. */ 1001 /* Adjust for physical offset. */
1002 kernel_start &= ~0xffffffff80000000ULL; 1002 kernel_start &= ~0xffffffff80000000ULL;