• Serge Semin's avatar
    mips: Reserve memory for the kernel image resources · b93ddc4f
    Serge Semin authored
    The reserved_end variable had been used by the bootmem_init() code
    to find a lowest limit of memory available for memmap blob. The original
    code just tried to find a free memory space higher than kernel was placed.
    This limitation seems justified for the memmap ragion search process, but
    I can't see any obvious reason to reserve the unused space below kernel
    seeing some platforms place it much higher than standard 1MB. Moreover
    the RELOCATION config enables it to be loaded at any memory address.
    So lets reserve the memory occupied by the kernel only, leaving the region
    below being free for allocations. After doing this we can now discard the
    code freeing a space between kernel _text and VMLINUX_LOAD_ADDRESS symbols
    since it's going to be free anyway (unless marked as reserved by
    platforms).
    Signed-off-by: default avatarSerge Semin <fancer.lancer@gmail.com>
    Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: James Hogan <jhogan@kernel.org>
    Cc: Matt Redfearn <matt.redfearn@mips.com>
    Cc: Mike Rapoport <rppt@linux.ibm.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Thomas Bogendoerfer <tbogendoerfer@suse.de>
    Cc: Huacai Chen <chenhc@lemote.com>
    Cc: Stefan Agner <stefan@agner.ch>
    Cc: Stephen Rothwell <sfr@canb.auug.org.au>
    Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
    Cc: Juergen Gross <jgross@suse.com>
    Cc: linux-mips@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    b93ddc4f
setup.c 24.1 KB