Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile

Pull arch/tile updates from Chris Metcalf:
"Another grab-bag of miscellaneous changes"

* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
tile: use __ro_after_init instead of tile-specific __write_once
tile: migrate exception table users off module.h and onto extable.h
tile: remove #pragma unroll from finv_buffer_remote()
tile-module: Rename jump labels in module_alloc()
tile-module: Use kmalloc_array() in module_alloc()
tile/pci_gx: fix spelling mistake: "delievered" -> "delivered"

+31 -44
+2 -5
arch/tile/include/asm/cache.h
··· 50 50 51 51 /* 52 52 * Originally we used small TLB pages for kernel data and grouped some 53 - * things together as "write once", enforcing the property at the end 53 + * things together as ro-after-init, enforcing the property at the end 54 54 * of initialization by making those pages read-only and non-coherent. 55 55 * This allowed better cache utilization since cache inclusion did not 56 56 * need to be maintained. However, to do this requires an extra TLB 57 57 * entry, which on balance is more of a performance hit than the 58 58 * non-coherence is a performance gain, so we now just make "read 59 - * mostly" and "write once" be synonyms. We keep the attribute 59 + * mostly" and "ro-after-init" be synonyms. We keep the attribute 60 60 * separate in case we change our minds at a future date. 61 61 */ 62 - #define __write_once __read_mostly 63 - 64 - /* __ro_after_init is the generic name for the tile arch __write_once. */ 65 62 #define __ro_after_init __read_mostly 66 63 67 64 #endif /* _ASM_TILE_CACHE_H */
-3
arch/tile/include/asm/sections.h
··· 19 19 20 20 #include <asm-generic/sections.h> 21 21 22 - /* Write-once data is writable only till the end of initialization. */ 23 - extern char __w1data_begin[], __w1data_end[]; 24 - 25 22 extern char vdso_start[], vdso_end[]; 26 23 #ifdef CONFIG_COMPAT 27 24 extern char vdso32_start[], vdso32_end[];
+5 -6
arch/tile/kernel/module.c
··· 43 43 int npages; 44 44 45 45 npages = (size + PAGE_SIZE - 1) / PAGE_SIZE; 46 - pages = kmalloc(npages * sizeof(struct page *), GFP_KERNEL); 46 + pages = kmalloc_array(npages, sizeof(*pages), GFP_KERNEL); 47 47 if (pages == NULL) 48 48 return NULL; 49 49 for (; i < npages; ++i) { 50 50 pages[i] = alloc_page(GFP_KERNEL | __GFP_HIGHMEM); 51 51 if (!pages[i]) 52 - goto error; 52 + goto free_pages; 53 53 } 54 54 55 55 area = __get_vm_area(size, VM_ALLOC, MEM_MODULE_START, MEM_MODULE_END); 56 56 if (!area) 57 - goto error; 57 + goto free_pages; 58 58 area->nr_pages = npages; 59 59 area->pages = pages; 60 60 61 61 if (map_vm_area(area, prot_rwx, pages)) { 62 62 vunmap(area->addr); 63 - goto error; 63 + goto free_pages; 64 64 } 65 65 66 66 return area->addr; 67 - 68 - error: 67 + free_pages: 69 68 while (--i >= 0) 70 69 __free_page(pages[i]); 71 70 kfree(pages);
+1 -1
arch/tile/kernel/pci.c
··· 57 57 * This flag tells if the platform is TILEmpower that needs 58 58 * special configuration for the PLX switch chip. 59 59 */ 60 - int __write_once tile_plx_gen1; 60 + int __ro_after_init tile_plx_gen1; 61 61 62 62 static struct pci_controller controllers[TILE_NUM_PCIE]; 63 63 static int num_controllers;
+1 -1
arch/tile/kernel/pci_gx.c
··· 131 131 132 132 count = cpumask_weight(&intr_cpus_map); 133 133 if (unlikely(count == 0)) { 134 - pr_warn("intr_cpus_map empty, interrupts will be delievered to dataplane tiles\n"); 134 + pr_warn("intr_cpus_map empty, interrupts will be delivered to dataplane tiles\n"); 135 135 return irq % (smp_height * smp_width); 136 136 } 137 137
+9 -9
arch/tile/kernel/setup.c
··· 49 49 static inline int ABS(int x) { return x >= 0 ? x : -x; } 50 50 51 51 /* Chip information */ 52 - char chip_model[64] __write_once; 52 + char chip_model[64] __ro_after_init; 53 53 54 54 #ifdef CONFIG_VT 55 55 struct screen_info screen_info; ··· 97 97 #ifdef CONFIG_HIGHMEM 98 98 /* Map information from VAs to PAs */ 99 99 unsigned long pbase_map[1 << (32 - HPAGE_SHIFT)] 100 - __write_once __attribute__((aligned(L2_CACHE_BYTES))); 100 + __ro_after_init __attribute__((aligned(L2_CACHE_BYTES))); 101 101 EXPORT_SYMBOL(pbase_map); 102 102 103 103 /* Map information from PAs to VAs */ 104 104 void *vbase_map[NR_PA_HIGHBIT_VALUES] 105 - __write_once __attribute__((aligned(L2_CACHE_BYTES))); 105 + __ro_after_init __attribute__((aligned(L2_CACHE_BYTES))); 106 106 EXPORT_SYMBOL(vbase_map); 107 107 #endif 108 108 109 109 /* Node number as a function of the high PA bits */ 110 - int highbits_to_node[NR_PA_HIGHBIT_VALUES] __write_once; 110 + int highbits_to_node[NR_PA_HIGHBIT_VALUES] __ro_after_init; 111 111 EXPORT_SYMBOL(highbits_to_node); 112 112 113 113 static unsigned int __initdata maxmem_pfn = -1U; ··· 844 844 #ifdef CONFIG_NUMA 845 845 846 846 /* which logical CPUs are on which nodes */ 847 - struct cpumask node_2_cpu_mask[MAX_NUMNODES] __write_once; 847 + struct cpumask node_2_cpu_mask[MAX_NUMNODES] __ro_after_init; 848 848 EXPORT_SYMBOL(node_2_cpu_mask); 849 849 850 850 /* which node each logical CPU is on */ 851 - char cpu_2_node[NR_CPUS] __write_once __attribute__((aligned(L2_CACHE_BYTES))); 851 + char cpu_2_node[NR_CPUS] __ro_after_init __attribute__((aligned(L2_CACHE_BYTES))); 852 852 EXPORT_SYMBOL(cpu_2_node); 853 853 854 854 /* Return cpu_to_node() except for cpus not yet assigned, which return -1 */ ··· 1269 1269 * cpus plus any other cpus that are willing to share their cache. 1270 1270 * It is set by hv_inquire_tiles(HV_INQ_TILES_LOTAR). 1271 1271 */ 1272 - struct cpumask __write_once cpu_lotar_map; 1272 + struct cpumask __ro_after_init cpu_lotar_map; 1273 1273 EXPORT_SYMBOL(cpu_lotar_map); 1274 1274 1275 1275 /* ··· 1291 1291 * cache, those tiles will only appear in cpu_lotar_map, NOT in 1292 1292 * cpu_cacheable_map, as they are a special case. 1293 1293 */ 1294 - struct cpumask __write_once cpu_cacheable_map; 1294 + struct cpumask __ro_after_init cpu_cacheable_map; 1295 1295 EXPORT_SYMBOL(cpu_cacheable_map); 1296 1296 1297 1297 static __initdata struct cpumask disabled_map; ··· 1506 1506 * Set up per-cpu memory. 1507 1507 */ 1508 1508 1509 - unsigned long __per_cpu_offset[NR_CPUS] __write_once; 1509 + unsigned long __per_cpu_offset[NR_CPUS] __ro_after_init; 1510 1510 EXPORT_SYMBOL(__per_cpu_offset); 1511 1511 1512 1512 static size_t __initdata pfn_offset[MAX_NUMNODES] = { 0 };
+1 -1
arch/tile/kernel/smp.c
··· 27 27 * We write to width and height with a single store in head_NN.S, 28 28 * so make the variable aligned to "long". 29 29 */ 30 - HV_Topology smp_topology __write_once __aligned(sizeof(long)); 30 + HV_Topology smp_topology __ro_after_init __aligned(sizeof(long)); 31 31 EXPORT_SYMBOL(smp_topology); 32 32 33 33 #if CHIP_HAS_IPI()
+2 -2
arch/tile/kernel/time.c
··· 37 37 */ 38 38 39 39 /* How many cycles per second we are running at. */ 40 - static cycles_t cycles_per_sec __write_once; 40 + static cycles_t cycles_per_sec __ro_after_init; 41 41 42 42 cycles_t get_clock_rate(void) 43 43 { ··· 68 68 */ 69 69 #define SCHED_CLOCK_SHIFT 10 70 70 71 - static unsigned long sched_clock_mult __write_once; 71 + static unsigned long sched_clock_mult __ro_after_init; 72 72 73 73 static cycles_t clocksource_get_cycles(struct clocksource *cs) 74 74 {
+1 -1
arch/tile/kernel/unaligned.c
··· 22 22 #include <linux/mman.h> 23 23 #include <linux/types.h> 24 24 #include <linux/err.h> 25 - #include <linux/module.h> 25 + #include <linux/extable.h> 26 26 #include <linux/compat.h> 27 27 #include <linux/prctl.h> 28 28 #include <asm/cacheflush.h>
+1 -7
arch/tile/lib/cacheflush.c
··· 138 138 if ((unsigned long)base < (unsigned long)buffer) 139 139 base = buffer; 140 140 141 - /* 142 - * Fire all the loads we need. The MAF only has eight entries 143 - * so we can have at most eight outstanding loads, so we 144 - * unroll by that amount. 145 - */ 146 - #pragma unroll 8 141 + /* Fire all the loads we need. */ 147 142 for (; p >= base; p -= step_size) 148 143 force_load(p); 149 144 150 145 /* 151 146 * Repeat, but with finv's instead of loads, to get rid of the 152 147 * data we just loaded into our own cache and the old home L3. 153 - * No need to unroll since finv's don't target a register. 154 148 * The finv's are guaranteed not to actually flush the data in 155 149 * the buffer back to their home, since we just read it, so the 156 150 * lines are clean in cache; we will only invalidate those lines.
+1 -1
arch/tile/mm/extable.c
··· 12 12 * more details. 13 13 */ 14 14 15 - #include <linux/module.h> 15 + #include <linux/extable.h> 16 16 #include <linux/spinlock.h> 17 17 #include <linux/uaccess.h> 18 18
+1 -1
arch/tile/mm/fault.c
··· 29 29 #include <linux/tty.h> 30 30 #include <linux/vt_kern.h> /* For unblank_screen() */ 31 31 #include <linux/highmem.h> 32 - #include <linux/module.h> 32 + #include <linux/extable.h> 33 33 #include <linux/kprobes.h> 34 34 #include <linux/hugetlb.h> 35 35 #include <linux/syscalls.h>
+1 -1
arch/tile/mm/homecache.c
··· 47 47 * The noallocl2 option suppresses all use of the L2 cache to cache 48 48 * locally from a remote home. 49 49 */ 50 - static int __write_once noallocl2; 50 + static int __ro_after_init noallocl2; 51 51 static int __init set_noallocl2(char *str) 52 52 { 53 53 noallocl2 = 1;
+5 -5
arch/tile/mm/init.c
··· 190 190 191 191 static int __initdata ktext_hash = 1; /* .text pages */ 192 192 static int __initdata kdata_hash = 1; /* .data and .bss pages */ 193 - int __write_once hash_default = 1; /* kernel allocator pages */ 193 + int __ro_after_init hash_default = 1; /* kernel allocator pages */ 194 194 EXPORT_SYMBOL(hash_default); 195 - int __write_once kstack_hash = 1; /* if no homecaching, use h4h */ 195 + int __ro_after_init kstack_hash = 1; /* if no homecaching, use h4h */ 196 196 197 197 /* 198 198 * CPUs to use to for striping the pages of kernel data. If hash-for-home ··· 203 203 static __initdata struct cpumask kdata_mask; 204 204 static __initdata int kdata_arg_seen; 205 205 206 - int __write_once kdata_huge; /* if no homecaching, small pages */ 206 + int __ro_after_init kdata_huge; /* if no homecaching, small pages */ 207 207 208 208 209 209 /* Combine a generic pgprot_t with cache home to get a cache-aware pgprot. */ ··· 896 896 panic("pgtable_cache_init(): Cannot create pgd cache"); 897 897 } 898 898 899 - static long __write_once initfree = 1; 900 - static bool __write_once set_initfree_done; 899 + static long __ro_after_init initfree = 1; 900 + static bool __ro_after_init set_initfree_done; 901 901 902 902 /* Select whether to free (1) or mark unusable (0) the __init pages. */ 903 903 static int __init set_initfree(char *str)