From: David Daney Date: Wed, 12 Jun 2013 17:28:33 +0000 (+0000) Subject: MIPS: Octeon: Don't clobber bootloader data structures. X-Git-Tag: upstream/snapshot3+hdmi~4703^2^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d949b4fe6d23dd92b5fa48cbf7af90ca32beed2e;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git MIPS: Octeon: Don't clobber bootloader data structures. 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 Cc: Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/5449/ Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c index 1bcc144..2a75ff2 100644 --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c @@ -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;