mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-30 08:04:13 +08:00
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 <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>
This commit is contained in:
parent
4f675e8a6b
commit
d949b4fe6d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user