[PATCH 07/11] x86/xip: make e820_add_kernel_range() a NOP

From: Jim Kukunas
Date: Mon Mar 23 2015 - 03:57:13 EST


e820_add_kernel_range() checks whether the kernel text is present
in the e820 map, and marked as usable RAM. If not, it modifies
the e820 map accordingly.

For XIP, that is unnecessary since the kernel text won't be loaded
in RAM.

Signed-off-by: Jim Kukunas <james.t.kukunas@xxxxxxxxxxxxxxx>
---
arch/x86/kernel/setup.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d276ebf..74fc6c8 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -787,6 +787,7 @@ static void __init trim_bios_range(void)
}

/* called before trim_bios_range() to spare extra sanitize */
+#ifndef CONFIG_XIP_KERNEL
static void __init e820_add_kernel_range(void)
{
u64 start = __pa_symbol(_text);
@@ -806,6 +807,11 @@ static void __init e820_add_kernel_range(void)
e820_remove_range(start, size, E820_RAM, 0);
e820_add_region(start, size, E820_RAM);
}
+#else
+static void __init e820_add_kernel_range(void)
+{
+}
+#endif

static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10;

--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/