[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181003123402.GA15494@hirez.programming.kicks-ass.net>
Date: Wed, 3 Oct 2018 14:34:02 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: m.mizuma@...fujitsu.com, bhe@...hat.com, bp@...en8.de,
torvalds@...ux-foundation.org, msys.mizuma@...il.com,
tglx@...utronix.de, linux-kernel@...r.kernel.org, mingo@...nel.org,
hpa@...or.com
Cc: linux-tip-commits@...r.kernel.org
Subject: Re: [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@...radead.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 */
Powered by blists - more mailing lists