x86, numa: Avoid compiling NUMA emulation functions without CONFIG_NUMA_EMU

Both acpi_get_nodes() and amd_get_nodes() are only necessary when
CONFIG_NUMA_EMU is enabled, so avoid compiling them when the option is
disabled.

Signed-off-by: David Rientjes <rientjes@google.com>
LKML-Reference: <alpine.DEB.2.00.1012221701210.3701@chino.kir.corp.google.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>

authored by David Rientjes and committed by H. Peter Anvin 4e76f4e6 34dc9e74

+12 -2
+4 -1
arch/x86/include/asm/acpi.h
··· 188 188 extern int acpi_get_nodes(struct bootnode *physnodes); 189 189 extern int acpi_scan_nodes(unsigned long start, unsigned long end); 190 190 #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) 191 + 192 + #ifdef CONFIG_NUMA_EMU 191 193 extern void acpi_fake_nodes(const struct bootnode *fake_nodes, 192 194 int num_nodes); 195 + #endif 193 196 #else 194 197 static inline void acpi_fake_nodes(const struct bootnode *fake_nodes, 195 198 int num_nodes) 196 199 { 197 200 } 198 - #endif 201 + #endif /* CONFIG_ACPI_NUMA */ 199 202 200 203 #define acpi_unlazy_tlb(x) leave_mm(x) 201 204
+4 -1
arch/x86/include/asm/amd_nb.h
··· 9 9 extern int early_is_amd_nb(u32 value); 10 10 extern int amd_cache_northbridges(void); 11 11 extern void amd_flush_garts(void); 12 - extern int amd_get_nodes(struct bootnode *nodes); 13 12 extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn); 14 13 extern int amd_scan_nodes(void); 14 + 15 + #ifdef CONFIG_NUMA_EMU 16 + extern int amd_get_nodes(struct bootnode *nodes); 17 + #endif 15 18 16 19 struct amd_northbridge { 17 20 struct pci_dev *misc;
+2
arch/x86/mm/amdtopology_64.c
··· 69 69 early_init_lapic_mapping(); 70 70 } 71 71 72 + #ifdef CONFIG_NUMA_EMU 72 73 int __init amd_get_nodes(struct bootnode *physnodes) 73 74 { 74 75 int i; ··· 82 81 } 83 82 return ret; 84 83 } 84 + #endif /* CONFIG_NUMA_EMU */ 85 85 86 86 int __init amd_numa_init(unsigned long start_pfn, unsigned long end_pfn) 87 87 {
+2
arch/x86/mm/srat_64.c
··· 339 339 340 340 void __init acpi_numa_arch_fixup(void) {} 341 341 342 + #ifdef CONFIG_NUMA_EMU 342 343 int __init acpi_get_nodes(struct bootnode *physnodes) 343 344 { 344 345 int i; ··· 352 351 } 353 352 return ret; 354 353 } 354 + #endif /* CONFIG_NUMA_EMU */ 355 355 356 356 /* Use the information discovered above to actually set up the nodes. */ 357 357 int __init acpi_scan_nodes(unsigned long start, unsigned long end)