aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/tile/kernel/setup.c')
-rw-r--r--arch/tile/kernel/setup.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c
index e7d54c73d5c1..f3a50e74f9a4 100644
--- a/arch/tile/kernel/setup.c
+++ b/arch/tile/kernel/setup.c
@@ -187,11 +187,11 @@ early_param("vmalloc", parse_vmalloc);
187 187
188#ifdef CONFIG_HIGHMEM 188#ifdef CONFIG_HIGHMEM
189/* 189/*
190 * Determine for each controller where its lowmem is mapped and how 190 * Determine for each controller where its lowmem is mapped and how much of
191 * much of it is mapped there. On controller zero, the first few 191 * it is mapped there. On controller zero, the first few megabytes are
192 * megabytes are mapped at 0xfd000000 as code, so in principle we 192 * already mapped in as code at MEM_SV_INTRPT, so in principle we could
193 * could start our data mappings higher up, but for now we don't 193 * start our data mappings higher up, but for now we don't bother, to avoid
194 * bother, to avoid additional confusion. 194 * additional confusion.
195 * 195 *
196 * One question is whether, on systems with more than 768 Mb and 196 * One question is whether, on systems with more than 768 Mb and
197 * controllers of different sizes, to map in a proportionate amount of 197 * controllers of different sizes, to map in a proportionate amount of
@@ -311,7 +311,7 @@ static void __init setup_memory(void)
311#endif 311#endif
312 312
313 /* We are using a char to hold the cpu_2_node[] mapping */ 313 /* We are using a char to hold the cpu_2_node[] mapping */
314 BUG_ON(MAX_NUMNODES > 127); 314 BUILD_BUG_ON(MAX_NUMNODES > 127);
315 315
316 /* Discover the ranges of memory available to us */ 316 /* Discover the ranges of memory available to us */
317 for (i = 0; ; ++i) { 317 for (i = 0; ; ++i) {
@@ -876,6 +876,9 @@ void __cpuinit setup_cpu(int boot)
876#if CHIP_HAS_SN_PROC() 876#if CHIP_HAS_SN_PROC()
877 raw_local_irq_unmask(INT_SNITLB_MISS); 877 raw_local_irq_unmask(INT_SNITLB_MISS);
878#endif 878#endif
879#ifdef __tilegx__
880 raw_local_irq_unmask(INT_SINGLE_STEP_K);
881#endif
879 882
880 /* 883 /*
881 * Allow user access to many generic SPRs, like the cycle 884 * Allow user access to many generic SPRs, like the cycle
@@ -893,11 +896,12 @@ void __cpuinit setup_cpu(int boot)
893#endif 896#endif
894 897
895 /* 898 /*
896 * Set the MPL for interrupt control 0 to user level. 899 * Set the MPL for interrupt control 0 & 1 to the corresponding
897 * This includes access to the SYSTEM_SAVE and EX_CONTEXT SPRs, 900 * values. This includes access to the SYSTEM_SAVE and EX_CONTEXT
898 * as well as the PL 0 interrupt mask. 901 * SPRs, as well as the interrupt mask.
899 */ 902 */
900 __insn_mtspr(SPR_MPL_INTCTRL_0_SET_0, 1); 903 __insn_mtspr(SPR_MPL_INTCTRL_0_SET_0, 1);
904 __insn_mtspr(SPR_MPL_INTCTRL_1_SET_1, 1);
901 905
902 /* Initialize IRQ support for this cpu. */ 906 /* Initialize IRQ support for this cpu. */
903 setup_irq_regs(); 907 setup_irq_regs();
@@ -1033,7 +1037,7 @@ static void __init validate_va(void)
1033 * In addition, make sure we CAN'T use the end of memory, since 1037 * In addition, make sure we CAN'T use the end of memory, since
1034 * we use the last chunk of each pgd for the pgd_list. 1038 * we use the last chunk of each pgd for the pgd_list.
1035 */ 1039 */
1036 int i, fc_fd_ok = 0; 1040 int i, user_kernel_ok = 0;
1037 unsigned long max_va = 0; 1041 unsigned long max_va = 0;
1038 unsigned long list_va = 1042 unsigned long list_va =
1039 ((PGD_LIST_OFFSET / sizeof(pgd_t)) << PGDIR_SHIFT); 1043 ((PGD_LIST_OFFSET / sizeof(pgd_t)) << PGDIR_SHIFT);
@@ -1044,13 +1048,13 @@ static void __init validate_va(void)
1044 break; 1048 break;
1045 if (range.start <= MEM_USER_INTRPT && 1049 if (range.start <= MEM_USER_INTRPT &&
1046 range.start + range.size >= MEM_HV_INTRPT) 1050 range.start + range.size >= MEM_HV_INTRPT)
1047 fc_fd_ok = 1; 1051 user_kernel_ok = 1;
1048 if (range.start == 0) 1052 if (range.start == 0)
1049 max_va = range.size; 1053 max_va = range.size;
1050 BUG_ON(range.start + range.size > list_va); 1054 BUG_ON(range.start + range.size > list_va);
1051 } 1055 }
1052 if (!fc_fd_ok) 1056 if (!user_kernel_ok)
1053 early_panic("Hypervisor not configured for VAs 0xfc/0xfd\n"); 1057 early_panic("Hypervisor not configured for user/kernel VAs\n");
1054 if (max_va == 0) 1058 if (max_va == 0)
1055 early_panic("Hypervisor not configured for low VAs\n"); 1059 early_panic("Hypervisor not configured for low VAs\n");
1056 if (max_va < KERNEL_HIGH_VADDR) 1060 if (max_va < KERNEL_HIGH_VADDR)
@@ -1334,6 +1338,10 @@ static void __init pcpu_fc_populate_pte(unsigned long addr)
1334 pte_t *pte; 1338 pte_t *pte;
1335 1339
1336 BUG_ON(pgd_addr_invalid(addr)); 1340 BUG_ON(pgd_addr_invalid(addr));
1341 if (addr < VMALLOC_START || addr >= VMALLOC_END)
1342 panic("PCPU addr %#lx outside vmalloc range %#lx..%#lx;"
1343 " try increasing CONFIG_VMALLOC_RESERVE\n",
1344 addr, VMALLOC_START, VMALLOC_END);
1337 1345
1338 pgd = swapper_pg_dir + pgd_index(addr); 1346 pgd = swapper_pg_dir + pgd_index(addr);
1339 pud = pud_offset(pgd, addr); 1347 pud = pud_offset(pgd, addr);