aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2017-01-10 22:39:42 +0800
committerAlex Shi <alex.shi@linaro.org>2017-01-10 22:39:42 +0800
commit8e20db3c84b5391b73530e260886387596a26d4d (patch)
tree2ef404669aa935397995efeeac91bcf3a2d38c5f
parent6a90545e6e920c480f5d05e4d5c0aa105e932bd1 (diff)
parent805f373eb09de58cb4728ddeebbac5891cf768b8 (diff)
downloadlinux-linaro-stable-linux-linaro-lsk-v3.18-test.tar.gz
Merge branch 'v3.18/topic/fixes' into linux-linaro-lsk-v3.18linux-linaro-lsk-v3.18-test
For repect 'mem=' in cmdline.
-rw-r--r--arch/arm64/kernel/setup.c19
-rw-r--r--arch/arm64/mm/init.c19
2 files changed, 19 insertions, 19 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index b8c03206f2d9..d2dedbb9313d 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -317,25 +317,6 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
}
}
-/*
- * Limit the memory size that was specified via FDT.
- */
-static int __init early_mem(char *p)
-{
- phys_addr_t limit;
-
- if (!p)
- return 1;
-
- limit = memparse(p, &p) & PAGE_MASK;
- pr_notice("Memory limited to %lldMB\n", limit >> 20);
-
- memblock_enforce_memory_limit(limit);
-
- return 0;
-}
-early_param("mem", early_mem);
-
static void __init request_standard_resources(void)
{
struct memblock_region *region;
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 62e2588d99ef..c49a0a8152cf 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -136,10 +136,29 @@ static void arm64_memory_present(void)
}
#endif
+static phys_addr_t memory_limit = (phys_addr_t)ULLONG_MAX;
+
+/*
+ * Limit the memory size that was specified via FDT.
+ */
+static int __init early_mem(char *p)
+{
+ if (!p)
+ return 1;
+
+ memory_limit = memparse(p, &p) & PAGE_MASK;
+ pr_notice("Memory limited to %lldMB\n", memory_limit >> 20);
+
+ return 0;
+}
+early_param("mem", early_mem);
+
void __init arm64_memblock_init(void)
{
phys_addr_t dma_phys_limit = 0;
+ memblock_enforce_memory_limit(memory_limit);
+
/*
* Register the kernel text, kernel data, initrd, and initial
* pagetables with memblock.