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