Skip to content

Commit d9cb5bf

Browse files
committed
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"
2 parents 0f484e4 + 14e73e7 commit d9cb5bf

14 files changed

Lines changed: 31 additions & 44 deletions

File tree

‎arch/tile/include/asm/cache.h‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,15 @@
5050

5151
/*
5252
* 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
5454
* of initialization by making those pages read-only and non-coherent.
5555
* This allowed better cache utilization since cache inclusion did not
5656
* need to be maintained. However, to do this requires an extra TLB
5757
* entry, which on balance is more of a performance hit than the
5858
* 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
6060
* separate in case we change our minds at a future date.
6161
*/
62-
#define __write_once __read_mostly
63-
64-
/* __ro_after_init is the generic name for the tile arch __write_once. */
6562
#define __ro_after_init __read_mostly
6663

6764
#endif /* _ASM_TILE_CACHE_H */

‎arch/tile/include/asm/sections.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919

2020
#include <asm-generic/sections.h>
2121

22-
/* Write-once data is writable only till the end of initialization. */
23-
extern char __w1data_begin[], __w1data_end[];
24-
2522
extern char vdso_start[], vdso_end[];
2623
#ifdef CONFIG_COMPAT
2724
extern char vdso32_start[], vdso32_end[];

‎arch/tile/kernel/module.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,28 @@ void *module_alloc(unsigned long size)
4343
int npages;
4444

4545
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);
4747
if (pages == NULL)
4848
return NULL;
4949
for (; i < npages; ++i) {
5050
pages[i] = alloc_page(GFP_KERNEL | __GFP_HIGHMEM);
5151
if (!pages[i])
52-
goto error;
52+
goto free_pages;
5353
}
5454

5555
area = __get_vm_area(size, VM_ALLOC, MEM_MODULE_START, MEM_MODULE_END);
5656
if (!area)
57-
goto error;
57+
goto free_pages;
5858
area->nr_pages = npages;
5959
area->pages = pages;
6060

6161
if (map_vm_area(area, prot_rwx, pages)) {
6262
vunmap(area->addr);
63-
goto error;
63+
goto free_pages;
6464
}
6565

6666
return area->addr;
67-
68-
error:
67+
free_pages:
6968
while (--i >= 0)
7069
__free_page(pages[i]);
7170
kfree(pages);

‎arch/tile/kernel/pci.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static int pci_probe = 1;
5757
* This flag tells if the platform is TILEmpower that needs
5858
* special configuration for the PLX switch chip.
5959
*/
60-
int __write_once tile_plx_gen1;
60+
int __ro_after_init tile_plx_gen1;
6161

6262
static struct pci_controller controllers[TILE_NUM_PCIE];
6363
static int num_controllers;

‎arch/tile/kernel/pci_gx.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static int tile_irq_cpu(int irq)
131131

132132
count = cpumask_weight(&intr_cpus_map);
133133
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");
135135
return irq % (smp_height * smp_width);
136136
}
137137

‎arch/tile/kernel/setup.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
static inline int ABS(int x) { return x >= 0 ? x : -x; }
5050

5151
/* Chip information */
52-
char chip_model[64] __write_once;
52+
char chip_model[64] __ro_after_init;
5353

5454
#ifdef CONFIG_VT
5555
struct screen_info screen_info;
@@ -97,17 +97,17 @@ int node_controller[MAX_NUMNODES] = { [0 ... MAX_NUMNODES-1] = -1 };
9797
#ifdef CONFIG_HIGHMEM
9898
/* Map information from VAs to PAs */
9999
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)));
101101
EXPORT_SYMBOL(pbase_map);
102102

103103
/* Map information from PAs to VAs */
104104
void *vbase_map[NR_PA_HIGHBIT_VALUES]
105-
__write_once __attribute__((aligned(L2_CACHE_BYTES)));
105+
__ro_after_init __attribute__((aligned(L2_CACHE_BYTES)));
106106
EXPORT_SYMBOL(vbase_map);
107107
#endif
108108

109109
/* 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;
111111
EXPORT_SYMBOL(highbits_to_node);
112112

113113
static unsigned int __initdata maxmem_pfn = -1U;
@@ -844,11 +844,11 @@ static void __init zone_sizes_init(void)
844844
#ifdef CONFIG_NUMA
845845

846846
/* 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;
848848
EXPORT_SYMBOL(node_2_cpu_mask);
849849

850850
/* 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)));
852852
EXPORT_SYMBOL(cpu_2_node);
853853

854854
/* Return cpu_to_node() except for cpus not yet assigned, which return -1 */
@@ -1269,7 +1269,7 @@ static void __init validate_va(void)
12691269
* cpus plus any other cpus that are willing to share their cache.
12701270
* It is set by hv_inquire_tiles(HV_INQ_TILES_LOTAR).
12711271
*/
1272-
struct cpumask __write_once cpu_lotar_map;
1272+
struct cpumask __ro_after_init cpu_lotar_map;
12731273
EXPORT_SYMBOL(cpu_lotar_map);
12741274

12751275
/*
@@ -1291,7 +1291,7 @@ EXPORT_SYMBOL(hash_for_home_map);
12911291
* cache, those tiles will only appear in cpu_lotar_map, NOT in
12921292
* cpu_cacheable_map, as they are a special case.
12931293
*/
1294-
struct cpumask __write_once cpu_cacheable_map;
1294+
struct cpumask __ro_after_init cpu_cacheable_map;
12951295
EXPORT_SYMBOL(cpu_cacheable_map);
12961296

12971297
static __initdata struct cpumask disabled_map;
@@ -1506,7 +1506,7 @@ void __init setup_arch(char **cmdline_p)
15061506
* Set up per-cpu memory.
15071507
*/
15081508

1509-
unsigned long __per_cpu_offset[NR_CPUS] __write_once;
1509+
unsigned long __per_cpu_offset[NR_CPUS] __ro_after_init;
15101510
EXPORT_SYMBOL(__per_cpu_offset);
15111511

15121512
static size_t __initdata pfn_offset[MAX_NUMNODES] = { 0 };

‎arch/tile/kernel/smp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* We write to width and height with a single store in head_NN.S,
2828
* so make the variable aligned to "long".
2929
*/
30-
HV_Topology smp_topology __write_once __aligned(sizeof(long));
30+
HV_Topology smp_topology __ro_after_init __aligned(sizeof(long));
3131
EXPORT_SYMBOL(smp_topology);
3232

3333
#if CHIP_HAS_IPI()

‎arch/tile/kernel/time.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838

3939
/* 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;
4141

4242
cycles_t get_clock_rate(void)
4343
{
@@ -68,7 +68,7 @@ EXPORT_SYMBOL(get_cycles);
6868
*/
6969
#define SCHED_CLOCK_SHIFT 10
7070

71-
static unsigned long sched_clock_mult __write_once;
71+
static unsigned long sched_clock_mult __ro_after_init;
7272

7373
static cycles_t clocksource_get_cycles(struct clocksource *cs)
7474
{

‎arch/tile/kernel/unaligned.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <linux/mman.h>
2323
#include <linux/types.h>
2424
#include <linux/err.h>
25-
#include <linux/module.h>
25+
#include <linux/extable.h>
2626
#include <linux/compat.h>
2727
#include <linux/prctl.h>
2828
#include <asm/cacheflush.h>

‎arch/tile/lib/cacheflush.c‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,13 @@ finv_buffer_remote(void *buffer, size_t size, int hfh)
138138
if ((unsigned long)base < (unsigned long)buffer)
139139
base = buffer;
140140

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. */
147142
for (; p >= base; p -= step_size)
148143
force_load(p);
149144

150145
/*
151146
* Repeat, but with finv's instead of loads, to get rid of the
152147
* 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.
154148
* The finv's are guaranteed not to actually flush the data in
155149
* the buffer back to their home, since we just read it, so the
156150
* lines are clean in cache; we will only invalidate those lines.

0 commit comments

Comments
 (0)