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