• Michael Ellerman's avatar
    powerpc/mm: Fix build failures due to arch_reserved_kernel_pages() · d8c3f243
    Michael Ellerman authored
    With NUMA=n and FA_DUMP=y or PRESERVE_FA_DUMP=y the build fails with:
    
      arch/powerpc/kernel/fadump.c:1739:22: error: no previous prototype for ‘arch_reserved_kernel_pages’ [-Werror=missing-prototypes]
      1739 | unsigned long __init arch_reserved_kernel_pages(void)
           |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
    
    The prototype for arch_reserved_kernel_pages() is in include/linux/mm.h,
    but it's guarded by __HAVE_ARCH_RESERVED_KERNEL_PAGES. The powerpc
    headers define __HAVE_ARCH_RESERVED_KERNEL_PAGES in asm/mmzone.h, which
    is not included into the generic headers when NUMA=n.
    
    Move the definition of __HAVE_ARCH_RESERVED_KERNEL_PAGES into asm/mmu.h
    which is included regardless of NUMA=n.
    
    Additionally the ifdef around __HAVE_ARCH_RESERVED_KERNEL_PAGES needs to
    also check for CONFIG_PRESERVE_FA_DUMP.
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://msgid.link/20231130114433.3053544-1-mpe@ellerman.id.au
    d8c3f243
mmu.h 10.9 KB