Merge tag 'devicetree-for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh...
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / mm / mmu.c
index 79e01163a981424db584789f3936a37592e2d765..5b8b664422d369a00dc6f6bc78b6f28ffd32da1b 100644 (file)
@@ -40,6 +40,8 @@
 
 #include "mm.h"
 
+u64 idmap_t0sz = TCR_T0SZ(VA_BITS);
+
 /*
  * Empty_zero_page is a special page that is used for zero-initialized data
  * and COW.
@@ -454,6 +456,7 @@ void __init paging_init(void)
         */
        cpu_set_reserved_ttbr0();
        flush_tlb_all();
+       cpu_set_default_tcr_t0sz();
 }
 
 /*
@@ -461,8 +464,10 @@ void __init paging_init(void)
  */
 void setup_mm_for_reboot(void)
 {
-       cpu_switch_mm(idmap_pg_dir, &init_mm);
+       cpu_set_reserved_ttbr0();
        flush_tlb_all();
+       cpu_set_idmap_tcr_t0sz();
+       cpu_switch_mm(idmap_pg_dir, &init_mm);
 }
 
 /*
@@ -627,10 +632,7 @@ void __set_fixmap(enum fixed_addresses idx,
        unsigned long addr = __fix_to_virt(idx);
        pte_t *pte;
 
-       if (idx >= __end_of_fixed_addresses) {
-               BUG();
-               return;
-       }
+       BUG_ON(idx <= FIX_HOLE || idx >= __end_of_fixed_addresses);
 
        pte = fixmap_pte(addr);