lkml.org 
[lkml]   [2018]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [tip:x86/boot] ACPI/NUMA: Add warning message if the padding size for KASLR is not enough

Subject: ACPI/NUMA: Fix KASLR build error

There is no point in trying to compile KASLR specific code when there is
no KASLR.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 3d69834c692f..5767733976b3 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -436,7 +436,6 @@ acpi_table_parse_srat(enum acpi_srat_type id,
int __init acpi_numa_init(void)
{
int cnt = 0;
- u64 max_possible_phys, max_actual_phys, threshold;

if (acpi_disabled)
return -EINVAL;
@@ -466,8 +465,11 @@ int __init acpi_numa_init(void)
cnt = acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
acpi_parse_memory_affinity, 0);

+#ifdef CONFIG_RANDOMIZE_MEMORY
/* check the padding size for KASLR is enough. */
if (parsed_numa_memblks && kaslr_enabled()) {
+ u64 max_possible_phys, max_actual_phys, threshold;
+
max_actual_phys = roundup(PFN_PHYS(max_pfn), 1ULL << 40);
max_possible_phys = roundup(PFN_PHYS(max_possible_pfn), 1ULL << 40);
threshold = max_actual_phys + ((u64)rand_mem_physical_padding << 40);
@@ -477,6 +479,7 @@ int __init acpi_numa_init(void)
(max_possible_phys - max_actual_phys) >> 40);
}
}
+#endif
}

/* SLIT: System Locality Information Table */
\
 
 \ /
  Last update: 2018-10-03 14:35    [W:0.132 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site