Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
authorAlex Shi <alex.shi@linaro.org>
Thu, 23 Apr 2015 06:55:22 +0000 (14:55 +0800)
committerAlex Shi <alex.shi@linaro.org>
Thu, 23 Apr 2015 06:55:22 +0000 (14:55 +0800)
1  2 
arch/arm64/kernel/setup.c
arch/arm64/mm/init.c

index fedd56b36cf0e5c1150e5c734b6d7814f2bd35d6,9d704df65a6a4e79727a27b049a1d26066c6842c..3d0b5a285061a1feb081b5ee4b9f2df92bce376c
@@@ -369,25 -369,6 +369,6 @@@ void * __init early_init_dt_alloc_memor
        return __va(memblock_alloc(size, align));
  }
  
- /*
-  * 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;
@@@ -566,11 -547,7 +547,11 @@@ static int c_show(struct seq_file *m, v
                seq_puts(m, "\n");
  
                seq_printf(m, "CPU implementer\t: 0x%02x\n", (midr >> 24));
 -              seq_printf(m, "CPU architecture: 8\n");
 +              seq_printf(m, "CPU architecture: %s\n",
 +#if IS_ENABLED(CONFIG_ARMV7_COMPAT_CPUINFO)
 +                              is_compat_task() ? "8" :
 +#endif
 +                              "AArch64");
                seq_printf(m, "CPU variant\t: 0x%x\n", ((midr >> 20) & 0xf));
                seq_printf(m, "CPU part\t: 0x%03x\n", ((midr >> 4) & 0xfff));
                seq_printf(m, "CPU revision\t: %d\n\n", (midr & 0xf));
diff --combined arch/arm64/mm/init.c
index 109a0442b6a1766d182aea772e03f7d3e51ef1e6,f2bded0254c32a4aa4692fd4b022582a6e1c6bbb..9a9eaadb8634a6f370971d29acd1ac2bd43ec09c
@@@ -119,11 -119,9 +119,11 @@@ static void __init zone_sizes_init(unsi
  }
  
  #ifdef CONFIG_HAVE_ARCH_PFN_VALID
 +#define PFN_MASK ((1UL << (64 - PAGE_SHIFT)) - 1)
 +
  int pfn_valid(unsigned long pfn)
  {
 -      return memblock_is_memory(pfn << PAGE_SHIFT);
 +      return (pfn & PFN_MASK) == pfn && memblock_is_memory(pfn << PAGE_SHIFT);
  }
  EXPORT_SYMBOL(pfn_valid);
  #endif
@@@ -143,11 -141,30 +143,30 @@@ 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)
  {
        u64 *reserve_map, base, size;
        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.