Skip to content

Commit f002488

Browse files
committed
Merge tag 'for-5.18/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc architecture fixes from Helge Deller: "Some reverts of existing patches, which were necessary because of boot issues due to wrong CPU clock handling and cache issues which led to userspace segfaults with 32bit kernels. Dave has a whole bunch of upcoming cache fixes which I then plan to push in the next merge window. Other than that just small updates and fixes, e.g. defconfig updates, spelling fixes, a clocksource fix, boot topology fixes and a fix for /proc/cpuinfo output to satisfy lscpu" * tag 'for-5.18/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: Revert "parisc: Increase parisc_cache_flush_threshold setting" parisc: Mark cr16 clock unstable on all SMP machines parisc: Fix typos in comments parisc: Change MAX_ADDRESS to become unsigned long long parisc: Merge model and model name into one line in /proc/cpuinfo parisc: Re-enable GENERIC_CPU_DEVICES for !SMP parisc: Update 32- and 64-bit defconfigs parisc: Only list existing CPUs in cpu_possible_mask Revert "parisc: Fix patch code locking and flushing" Revert "parisc: Mark sched_clock unstable only if clocks are not syncronized" Revert "parisc: Mark cr16 CPU clocksource unstable on all SMP machines"
2 parents e3de3a1 + ba0c041 commit f002488

File tree

15 files changed

+42
-42
lines changed

15 files changed

+42
-42
lines changed

arch/parisc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ config PARISC
3838
select ARCH_HAVE_NMI_SAFE_CMPXCHG
3939
select GENERIC_SMP_IDLE_THREAD
4040
select GENERIC_ARCH_TOPOLOGY if SMP
41+
select GENERIC_CPU_DEVICES if !SMP
4142
select GENERIC_LIB_DEVMEM_IS_ALLOWED
4243
select SYSCTL_ARCH_UNALIGN_ALLOW
4344
select SYSCTL_EXCEPTION_TRACE

arch/parisc/configs/generic-32bit_defconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ CONFIG_BSD_PROCESS_ACCT=y
66
CONFIG_IKCONFIG=y
77
CONFIG_IKCONFIG_PROC=y
88
CONFIG_LOG_BUF_SHIFT=16
9+
CONFIG_CGROUPS=y
10+
CONFIG_NAMESPACES=y
11+
CONFIG_USER_NS=y
912
CONFIG_BLK_DEV_INITRD=y
1013
CONFIG_EXPERT=y
1114
CONFIG_PERF_EVENTS=y
@@ -47,7 +50,6 @@ CONFIG_PARPORT=y
4750
CONFIG_PARPORT_PC=m
4851
CONFIG_PARPORT_1284=y
4952
CONFIG_BLK_DEV_LOOP=y
50-
CONFIG_BLK_DEV_CRYPTOLOOP=y
5153
CONFIG_BLK_DEV_RAM=y
5254
CONFIG_BLK_DEV_RAM_SIZE=6144
5355
CONFIG_BLK_DEV_SD=y

arch/parisc/configs/generic-64bit_defconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CONFIG_CGROUPS=y
1616
CONFIG_MEMCG=y
1717
CONFIG_CGROUP_PIDS=y
1818
CONFIG_CPUSETS=y
19+
CONFIG_USER_NS=y
1920
CONFIG_RELAY=y
2021
CONFIG_BLK_DEV_INITRD=y
2122
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -267,9 +268,9 @@ CONFIG_CRYPTO_DEFLATE=m
267268
CONFIG_CRC_CCITT=m
268269
CONFIG_LIBCRC32C=y
269270
CONFIG_PRINTK_TIME=y
271+
CONFIG_DEBUG_KERNEL=y
270272
CONFIG_STRIP_ASM_SYMS=y
271273
CONFIG_MAGIC_SYSRQ=y
272274
CONFIG_DEBUG_FS=y
273-
CONFIG_DEBUG_KERNEL=y
274275
CONFIG_DEBUG_STACKOVERFLOW=y
275276
# CONFIG_SCHED_DEBUG is not set

arch/parisc/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ extern void __update_cache(pte_t pte);
160160
#define SPACEID_SHIFT (MAX_ADDRBITS - 32)
161161
#else
162162
#define MAX_ADDRBITS (BITS_PER_LONG)
163-
#define MAX_ADDRESS (1UL << MAX_ADDRBITS)
163+
#define MAX_ADDRESS (1ULL << MAX_ADDRBITS)
164164
#define SPACEID_SHIFT 0
165165
#endif
166166

arch/parisc/kernel/cache.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ void __init parisc_setup_cache_timing(void)
403403
{
404404
unsigned long rangetime, alltime;
405405
unsigned long size;
406-
unsigned long threshold, threshold2;
406+
unsigned long threshold;
407407

408408
alltime = mfctl(16);
409409
flush_data_cache();
@@ -418,20 +418,8 @@ void __init parisc_setup_cache_timing(void)
418418
alltime, size, rangetime);
419419

420420
threshold = L1_CACHE_ALIGN(size * alltime / rangetime);
421-
422-
/*
423-
* The threshold computed above isn't very reliable since the
424-
* flush times depend greatly on the percentage of dirty lines
425-
* in the flush range. Further, the whole cache time doesn't
426-
* include the time to refill lines that aren't in the mm/vma
427-
* being flushed. By timing glibc build and checks on mako cpus,
428-
* the following formula seems to work reasonably well. The
429-
* value from the timing calculation is too small, and increases
430-
* build and check times by almost a factor two.
431-
*/
432-
threshold2 = cache_info.dc_size * num_online_cpus();
433-
if (threshold2 > threshold)
434-
threshold = threshold2;
421+
if (threshold > cache_info.dc_size)
422+
threshold = cache_info.dc_size;
435423
if (threshold)
436424
parisc_cache_flush_threshold = threshold;
437425
printk(KERN_INFO "Cache flush threshold set to %lu KiB\n",

arch/parisc/kernel/kprobes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ int __kprobes parisc_kprobe_ss_handler(struct pt_regs *regs)
152152
/* for absolute branch instructions we can copy iaoq_b. for relative
153153
* branch instructions we need to calculate the new address based on the
154154
* difference between iaoq_f and iaoq_b. We cannot use iaoq_b without
155-
* modificationt because it's based on our ainsn.insn address.
155+
* modifications because it's based on our ainsn.insn address.
156156
*/
157157

158158
if (p->post_handler)

arch/parisc/kernel/patch.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags,
4040

4141
*need_unmap = 1;
4242
set_fixmap(fixmap, page_to_phys(page));
43-
raw_spin_lock_irqsave(&patch_lock, *flags);
43+
if (flags)
44+
raw_spin_lock_irqsave(&patch_lock, *flags);
45+
else
46+
__acquire(&patch_lock);
4447

4548
return (void *) (__fix_to_virt(fixmap) + (uintaddr & ~PAGE_MASK));
4649
}
@@ -49,7 +52,10 @@ static void __kprobes patch_unmap(int fixmap, unsigned long *flags)
4952
{
5053
clear_fixmap(fixmap);
5154

52-
raw_spin_unlock_irqrestore(&patch_lock, *flags);
55+
if (flags)
56+
raw_spin_unlock_irqrestore(&patch_lock, *flags);
57+
else
58+
__release(&patch_lock);
5359
}
5460

5561
void __kprobes __patch_text_multiple(void *addr, u32 *insn, unsigned int len)
@@ -61,9 +67,8 @@ void __kprobes __patch_text_multiple(void *addr, u32 *insn, unsigned int len)
6167
int mapped;
6268

6369
/* Make sure we don't have any aliases in cache */
64-
flush_kernel_dcache_range_asm(start, end);
65-
flush_kernel_icache_range_asm(start, end);
66-
flush_tlb_kernel_range(start, end);
70+
flush_kernel_vmap_range(addr, len);
71+
flush_icache_range(start, end);
6772

6873
p = fixmap = patch_map(addr, FIX_TEXT_POKE0, &flags, &mapped);
6974

@@ -76,21 +81,19 @@ void __kprobes __patch_text_multiple(void *addr, u32 *insn, unsigned int len)
7681
* We're crossing a page boundary, so
7782
* need to remap
7883
*/
79-
flush_kernel_dcache_range_asm((unsigned long)fixmap,
80-
(unsigned long)p);
81-
flush_tlb_kernel_range((unsigned long)fixmap,
82-
(unsigned long)p);
84+
flush_kernel_vmap_range((void *)fixmap,
85+
(p-fixmap) * sizeof(*p));
8386
if (mapped)
8487
patch_unmap(FIX_TEXT_POKE0, &flags);
8588
p = fixmap = patch_map(addr, FIX_TEXT_POKE0, &flags,
8689
&mapped);
8790
}
8891
}
8992

90-
flush_kernel_dcache_range_asm((unsigned long)fixmap, (unsigned long)p);
91-
flush_tlb_kernel_range((unsigned long)fixmap, (unsigned long)p);
93+
flush_kernel_vmap_range((void *)fixmap, (p-fixmap) * sizeof(*p));
9294
if (mapped)
9395
patch_unmap(FIX_TEXT_POKE0, &flags);
96+
flush_icache_range(start, end);
9497
}
9598

9699
void __kprobes __patch_text(void *addr, u32 insn)

arch/parisc/kernel/processor.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ static int __init processor_probe(struct parisc_device *dev)
171171
p->cpu_num = cpu_info.cpu_num;
172172
p->cpu_loc = cpu_info.cpu_loc;
173173

174+
set_cpu_possible(cpuid, true);
174175
store_cpu_topology(cpuid);
175176

176177
#ifdef CONFIG_SMP
@@ -419,8 +420,7 @@ show_cpuinfo (struct seq_file *m, void *v)
419420
}
420421
seq_printf(m, " (0x%02lx)\n", boot_cpu_data.pdc.capabilities);
421422

422-
seq_printf(m, "model\t\t: %s\n"
423-
"model name\t: %s\n",
423+
seq_printf(m, "model\t\t: %s - %s\n",
424424
boot_cpu_data.pdc.sys_model_name,
425425
cpuinfo->dev ?
426426
cpuinfo->dev->name : "Unknown");
@@ -461,6 +461,13 @@ static struct parisc_driver cpu_driver __refdata = {
461461
*/
462462
void __init processor_init(void)
463463
{
464+
unsigned int cpu;
465+
464466
reset_cpu_topology();
467+
468+
/* reset possible mask. We will mark those which are possible. */
469+
for_each_possible_cpu(cpu)
470+
set_cpu_possible(cpu, false);
471+
465472
register_parisc_driver(&cpu_driver);
466473
}

arch/parisc/kernel/setup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ void __init setup_arch(char **cmdline_p)
161161
#ifdef CONFIG_PA11
162162
dma_ops_init();
163163
#endif
164+
165+
clear_sched_clock_stable();
164166
}
165167

166168
/*

arch/parisc/kernel/time.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,9 @@ void __init time_init(void)
251251
static int __init init_cr16_clocksource(void)
252252
{
253253
/*
254-
* The cr16 interval timers are not syncronized across CPUs, even if
255-
* they share the same socket.
254+
* The cr16 interval timers are not synchronized across CPUs.
256255
*/
257256
if (num_online_cpus() > 1 && !running_on_qemu) {
258-
/* mark sched_clock unstable */
259-
clear_sched_clock_stable();
260-
261257
clocksource_cr16.name = "cr16_unstable";
262258
clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
263259
clocksource_cr16.rating = 0;

0 commit comments

Comments
 (0)