• Dan Williams's avatar
    mm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports · a927bd6b
    Dan Williams authored
    The core-mm has a default __weak implementation of phys_to_target_node()
    to mirror the weak definition of memory_add_physaddr_to_nid().  That
    symbol is exported for modules.  However, while the export in
    mm/memory_hotplug.c exported the symbol in the configuration cases of:
    
    	CONFIG_NUMA_KEEP_MEMINFO=y
    	CONFIG_MEMORY_HOTPLUG=y
    
    ...and:
    
    	CONFIG_NUMA_KEEP_MEMINFO=n
    	CONFIG_MEMORY_HOTPLUG=y
    
    ...it failed to export the symbol in the case of:
    
    	CONFIG_NUMA_KEEP_MEMINFO=y
    	CONFIG_MEMORY_HOTPLUG=n
    
    Not only is that broken, but Christoph points out that the kernel should
    not be exporting any __weak symbol, which means that
    memory_add_physaddr_to_nid() example that phys_to_target_node() copied
    is broken too.
    
    Rework the definition of phys_to_target_node() and
    memory_add_physaddr_to_nid() to not require weak symbols.  Move to the
    common arch override design-pattern of an asm header defining a symbol
    to replace the default implementation.
    
    The o...
    a927bd6b
Kconfig 2.64 KB