Skip to content

Commit

Permalink
MIPS: fix memory setup for platforms with PHYS_OFFSET != 0
Browse files Browse the repository at this point in the history
commit e0bf304 upstream.

For platforms, which use a PHYS_OFFSET != 0, symbol _end also
contains that offset. So when calling memblock_reserve() for
reserving kernel the size argument needs to be adjusted.

Fixes: bcec54b ("mips: switch to NO_BOOTMEM")
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org # v4.20+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Thomas Bogendoerfer authored and Greg Kroah-Hartman committed Mar 5, 2019
1 parent 3a5a238 commit f0e4c02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/mips/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ static void __init bootmem_init(void)
init_initrd();
reserved_end = (unsigned long) PFN_UP(__pa_symbol(&_end));

memblock_reserve(PHYS_OFFSET, reserved_end << PAGE_SHIFT);
memblock_reserve(PHYS_OFFSET,
(reserved_end << PAGE_SHIFT) - PHYS_OFFSET);

/*
* max_low_pfn is not a number of pages. The number of pages
Expand Down

0 comments on commit f0e4c02

Please sign in to comment.