Skip to content

Commit d5fd43b

Browse files
committed
Merge tag 'for-5.18/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull more parisc architecture updates from Helge Deller: - Revert a patch to the invalidate/flush vmap routines which broke kernel patching functions on older PA-RISC machines. - Fix the kernel patching code wrt locking and flushing. Works now on B160L machine as well. - Fix CPU IRQ affinity for LASI, WAX and Dino chips - Add CPU hotplug support - Detect the hppa-suse-linux-gcc compiler when cross-compiling * tag 'for-5.18/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix patch code locking and flushing parisc: Find a new timesync master if current CPU is removed parisc: Move common_stext into .text section when CONFIG_HOTPLUG_CPU=y parisc: Rewrite arch_cpu_idle_dead() for CPU hotplugging parisc: Implement __cpu_die() and __cpu_disable() for CPU hotplugging parisc: Add PDC locking functions for rendezvous code parisc: Move disable_sr_hashing_asm() into .text section parisc: Move CPU startup-related functions into .text section parisc: Move store_cpu_topology() into text section parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY parisc: Ensure set_firmware_width() is called only once parisc: Add constants for control registers and clean up mfctl() parisc: Detect hppa-suse-linux-gcc compiler for cross-building parisc: Clean up cpu_check_affinity() and drop cpu_set_affinity_irq() parisc: Fix CPU affinity for Lasi, WAX and Dino chips Revert "parisc: Fix invalidate/flush vmap routines"
2 parents 57c06b6 + a9fe7fa commit d5fd43b

File tree

25 files changed

+312
-206
lines changed

25 files changed

+312
-206
lines changed

arch/parisc/Kconfig

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ config PARISC
3737
select GENERIC_PCI_IOMAP
3838
select ARCH_HAVE_NMI_SAFE_CMPXCHG
3939
select GENERIC_SMP_IDLE_THREAD
40-
select GENERIC_CPU_DEVICES
40+
select GENERIC_ARCH_TOPOLOGY if SMP
4141
select GENERIC_LIB_DEVMEM_IS_ALLOWED
4242
select SYSCTL_ARCH_UNALIGN_ALLOW
4343
select SYSCTL_EXCEPTION_TRACE
@@ -56,6 +56,7 @@ config PARISC
5656
select HAVE_ARCH_TRACEHOOK
5757
select HAVE_REGS_AND_STACK_ACCESS_API
5858
select GENERIC_SCHED_CLOCK
59+
select GENERIC_IRQ_MIGRATION if SMP
5960
select HAVE_UNSTABLE_SCHED_CLOCK if SMP
6061
select LEGACY_TIMER_TICK
6162
select CPU_NO_EFFICIENT_FFS
@@ -279,16 +280,9 @@ config SMP
279280

280281
If you don't know what to do here, say N.
281282

282-
config PARISC_CPU_TOPOLOGY
283-
bool "Support cpu topology definition"
284-
depends on SMP
285-
default y
286-
help
287-
Support PARISC cpu topology definition.
288-
289283
config SCHED_MC
290284
bool "Multi-core scheduler support"
291-
depends on PARISC_CPU_TOPOLOGY && PA8X00
285+
depends on GENERIC_ARCH_TOPOLOGY && PA8X00
292286
help
293287
Multi-core scheduler support improves the CPU scheduler's decision
294288
making when dealing with multi-core CPU chips at a cost of slightly

arch/parisc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export LD_BFD
4242

4343
# Set default 32 bits cross compilers for vdso
4444
CC_ARCHES_32 = hppa hppa2.0 hppa1.1
45-
CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
45+
CC_SUFFIXES = linux linux-gnu unknown-linux-gnu suse-linux
4646
CROSS32_COMPILE := $(call cc-cross-prefix, \
4747
$(foreach a,$(CC_ARCHES_32), \
4848
$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
@@ -52,7 +52,7 @@ export CROSS32CC
5252
# Set default cross compiler for kernel build
5353
ifdef cross_compiling
5454
ifeq ($(CROSS_COMPILE),)
55-
CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
55+
CC_SUFFIXES = linux linux-gnu unknown-linux-gnu suse-linux
5656
CROSS_COMPILE := $(call cc-cross-prefix, \
5757
$(foreach a,$(CC_ARCHES), \
5858
$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))

arch/parisc/include/asm/pdc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ int pdc_sti_call(unsigned long func, unsigned long flags,
9494
unsigned long glob_cfg);
9595

9696
int __pdc_cpu_rendezvous(void);
97+
void pdc_cpu_rendezvous_lock(void);
98+
void pdc_cpu_rendezvous_unlock(void);
99+
97100
static inline char * os_id_to_string(u16 os_id) {
98101
switch(os_id) {
99102
case OS_ID_NONE: return "No OS";

arch/parisc/include/asm/pdcpat.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
#define PDC_PAT_CPU_RENDEZVOUS 6L /* Rendezvous CPU */
8484
#define PDC_PAT_CPU_GET_CLOCK_INFO 7L /* Return CPU Clock info */
8585
#define PDC_PAT_CPU_GET_RENDEZVOUS_STATE 8L /* Return Rendezvous State */
86+
#define PDC_PAT_CPU_GET_PDC_ENTRYPOINT 11L /* Return PDC Entry point */
8687
#define PDC_PAT_CPU_PLUNGE_FABRIC 128L /* Plunge Fabric */
8788
#define PDC_PAT_CPU_UPDATE_CACHE_CLEANSING 129L /* Manipulate Cache
8889
* Cleansing Mode */
@@ -356,7 +357,7 @@ struct pdc_pat_cell_mod_maddr_block { /* PDC_PAT_CELL_MODULE */
356357

357358
typedef struct pdc_pat_cell_mod_maddr_block pdc_pat_cell_mod_maddr_block_t;
358359

359-
360+
extern int pdc_pat_get_PDC_entrypoint(unsigned long *pdc_entry);
360361
extern int pdc_pat_chassis_send_log(unsigned long status, unsigned long data);
361362
extern int pdc_pat_cell_get_number(struct pdc_pat_cell_num *cell_info);
362363
extern int pdc_pat_cell_info(struct pdc_pat_cell_info_rtn_block *info,

arch/parisc/include/asm/processor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ struct cpuinfo_parisc {
9595

9696
extern struct system_cpuinfo_parisc boot_cpu_data;
9797
DECLARE_PER_CPU(struct cpuinfo_parisc, cpu_data);
98+
extern int time_keeper_id; /* CPU used for timekeeping */
9899

99100
#define CPU_HVERSION ((boot_cpu_data.hversion >> 4) & 0x0FFF)
100101

arch/parisc/include/asm/smp.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ static inline void smp_send_all_nop(void) { return; }
4444

4545
#define NO_PROC_ID 0xFF /* No processor magic marker */
4646
#define ANY_PROC_ID 0xFF /* Any processor magic marker */
47-
static inline int __cpu_disable (void) {
48-
return 0;
49-
}
50-
static inline void __cpu_die (unsigned int cpu) {
51-
while(1)
52-
;
53-
}
47+
int __cpu_disable(void);
48+
void __cpu_die(unsigned int cpu);
5449

5550
#endif /* __ASM_SMP_H */

arch/parisc/include/asm/special_insns.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@
3030
pa; \
3131
})
3232

33+
#define CR_EIEM 15 /* External Interrupt Enable Mask */
34+
#define CR_CR16 16 /* CR16 Interval Timer */
35+
#define CR_EIRR 23 /* External Interrupt Request Register */
36+
3337
#define mfctl(reg) ({ \
3438
unsigned long cr; \
3539
__asm__ __volatile__( \
36-
"mfctl " #reg ",%0" : \
37-
"=r" (cr) \
40+
"mfctl %1,%0" : \
41+
"=r" (cr) : "i" (reg) \
3842
); \
3943
cr; \
4044
})
@@ -44,13 +48,8 @@
4448
: /* no outputs */ \
4549
: "r" (gr), "i" (cr) : "memory")
4650

47-
/* these are here to de-mystefy the calling code, and to provide hooks */
48-
/* which I needed for debugging EIEM problems -PB */
49-
#define get_eiem() mfctl(15)
50-
static inline void set_eiem(unsigned long val)
51-
{
52-
mtctl(val, 15);
53-
}
51+
#define get_eiem() mfctl(CR_EIEM)
52+
#define set_eiem(val) mtctl(val, CR_EIEM)
5453

5554
#define mfsp(reg) ({ \
5655
unsigned long cr; \

arch/parisc/include/asm/topology.h

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,16 @@
11
#ifndef _ASM_PARISC_TOPOLOGY_H
22
#define _ASM_PARISC_TOPOLOGY_H
33

4-
#ifdef CONFIG_PARISC_CPU_TOPOLOGY
4+
#ifdef CONFIG_GENERIC_ARCH_TOPOLOGY
55

66
#include <linux/cpumask.h>
7-
8-
struct cputopo_parisc {
9-
int thread_id;
10-
int core_id;
11-
int socket_id;
12-
cpumask_t thread_sibling;
13-
cpumask_t core_sibling;
14-
};
15-
16-
extern struct cputopo_parisc cpu_topology[NR_CPUS];
17-
18-
#define topology_physical_package_id(cpu) (cpu_topology[cpu].socket_id)
19-
#define topology_core_id(cpu) (cpu_topology[cpu].core_id)
20-
#define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling)
21-
#define topology_sibling_cpumask(cpu) (&cpu_topology[cpu].thread_sibling)
22-
23-
void init_cpu_topology(void);
24-
void store_cpu_topology(unsigned int cpuid);
25-
const struct cpumask *cpu_coregroup_mask(int cpu);
7+
#include <linux/arch_topology.h>
268

279
#else
2810

2911
static inline void init_cpu_topology(void) { }
3012
static inline void store_cpu_topology(unsigned int cpuid) { }
13+
static inline void reset_cpu_topology(void) { }
3114

3215
#endif
3316

arch/parisc/kernel/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ obj-$(CONFIG_AUDIT) += audit.o
3131
obj64-$(CONFIG_AUDIT) += compat_audit.o
3232
# only supported for PCX-W/U in 64-bit mode at the moment
3333
obj-$(CONFIG_64BIT) += perf.o perf_asm.o $(obj64-y)
34-
obj-$(CONFIG_PARISC_CPU_TOPOLOGY) += topology.o
34+
obj-$(CONFIG_GENERIC_ARCH_TOPOLOGY) += topology.o
3535
obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o
3636
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
3737
obj-$(CONFIG_JUMP_LABEL) += jump_label.o

arch/parisc/kernel/cache.c

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ parisc_cache_init(void)
273273
}
274274
}
275275

276-
void __init disable_sr_hashing(void)
276+
void disable_sr_hashing(void)
277277
{
278278
int srhash_type, retval;
279279
unsigned long space_bits;
@@ -611,8 +611,8 @@ void
611611
flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long pfn)
612612
{
613613
if (pfn_valid(pfn)) {
614-
flush_tlb_page(vma, vmaddr);
615614
if (likely(vma->vm_mm->context.space_id)) {
615+
flush_tlb_page(vma, vmaddr);
616616
__flush_cache_page(vma, vmaddr, PFN_PHYS(pfn));
617617
} else {
618618
__purge_cache_page(vma, vmaddr, PFN_PHYS(pfn));
@@ -624,7 +624,6 @@ void flush_kernel_vmap_range(void *vaddr, int size)
624624
{
625625
unsigned long start = (unsigned long)vaddr;
626626
unsigned long end = start + size;
627-
unsigned long flags, physaddr;
628627

629628
if ((!IS_ENABLED(CONFIG_SMP) || !arch_irqs_disabled()) &&
630629
(unsigned long)size >= parisc_cache_flush_threshold) {
@@ -633,22 +632,15 @@ void flush_kernel_vmap_range(void *vaddr, int size)
633632
return;
634633
}
635634

636-
while (start < end) {
637-
physaddr = lpa(start);
638-
purge_tlb_start(flags);
639-
pdtlb(SR_KERNEL, start);
640-
purge_tlb_end(flags);
641-
flush_dcache_page_asm(physaddr, start);
642-
start += PAGE_SIZE;
643-
}
635+
flush_kernel_dcache_range_asm(start, end);
636+
flush_tlb_kernel_range(start, end);
644637
}
645638
EXPORT_SYMBOL(flush_kernel_vmap_range);
646639

647640
void invalidate_kernel_vmap_range(void *vaddr, int size)
648641
{
649642
unsigned long start = (unsigned long)vaddr;
650643
unsigned long end = start + size;
651-
unsigned long flags, physaddr;
652644

653645
if ((!IS_ENABLED(CONFIG_SMP) || !arch_irqs_disabled()) &&
654646
(unsigned long)size >= parisc_cache_flush_threshold) {
@@ -657,13 +649,7 @@ void invalidate_kernel_vmap_range(void *vaddr, int size)
657649
return;
658650
}
659651

660-
while (start < end) {
661-
physaddr = lpa(start);
662-
purge_tlb_start(flags);
663-
pdtlb(SR_KERNEL, start);
664-
purge_tlb_end(flags);
665-
purge_dcache_page_asm(physaddr, start);
666-
start += PAGE_SIZE;
667-
}
652+
purge_kernel_dcache_range_asm(start, end);
653+
flush_tlb_kernel_range(start, end);
668654
}
669655
EXPORT_SYMBOL(invalidate_kernel_vmap_range);

0 commit comments

Comments
 (0)