Commit 82df8261 authored by Borislav Petkov's avatar Borislav Petkov

x86/boot: Fix randconfig build error due to MEMORY_HOTREMOVE

When building randconfigs, one of the failures is:

  ld: arch/x86/boot/compressed/kaslr.o: in function `choose_random_location':
  kaslr.c:(.text+0xbf7): undefined reference to `count_immovable_mem_regions'
  ld: kaslr.c:(.text+0xcbe): undefined reference to `immovable_mem'
  make[2]: *** [arch/x86/boot/compressed/vmlinux] Error 1

because CONFIG_ACPI is not enabled in this particular .config but
CONFIG_MEMORY_HOTREMOVE is and count_immovable_mem_regions() is
unresolvable because it is defined in compressed/acpi.c which is the
compilation unit that depends on CONFIG_ACPI.

Add CONFIG_ACPI to the explicit dependencies for MEMORY_HOTREMOVE.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Cc: Chao Fan <fanc.fnst@cn.fujitsu.com>
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20190205131033.9564-1-bp@alien8.de
parent 82f9ed3a
...@@ -670,7 +670,7 @@ static bool process_mem_region(struct mem_vector *region, ...@@ -670,7 +670,7 @@ static bool process_mem_region(struct mem_vector *region,
return 0; return 0;
} }
#ifdef CONFIG_MEMORY_HOTREMOVE #if defined(CONFIG_MEMORY_HOTREMOVE) && defined(CONFIG_ACPI)
/* /*
* If immovable memory found, filter the intersection between * If immovable memory found, filter the intersection between
* immovable memory and @region. * immovable memory and @region.
......
...@@ -129,7 +129,7 @@ acpi_physical_address get_rsdp_addr(void); ...@@ -129,7 +129,7 @@ acpi_physical_address get_rsdp_addr(void);
static inline acpi_physical_address get_rsdp_addr(void) { return 0; } static inline acpi_physical_address get_rsdp_addr(void) { return 0; }
#endif #endif
#if defined(CONFIG_RANDOMIZE_BASE) && defined(CONFIG_MEMORY_HOTREMOVE) #if defined(CONFIG_RANDOMIZE_BASE) && defined(CONFIG_MEMORY_HOTREMOVE) && defined(CONFIG_ACPI)
extern struct mem_vector immovable_mem[MAX_NUMNODES*2]; extern struct mem_vector immovable_mem[MAX_NUMNODES*2];
int count_immovable_mem_regions(void); int count_immovable_mem_regions(void);
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment