Skip to content

Commit 54450af

Browse files
committed
Merge tag 'parisc-for-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc architecture updates from Helge Deller: - On parisc we now use the generic clockevent framework for timekeeping - Although there is no 64-bit glibc/userspace for parisc yet, for testing purposes one can run statically linked 64-bit binaries. This patchset contains two patches which fix 64-bit userspace which has been broken since kernel 4.19 - Fix the userspace stack position and size when the ADDR_NO_RANDOMIZE personality is enabled - On other architectures mmap(MAP_GROWSDOWN | MAP_STACK) creates a downward-growing stack. On parisc mmap(MAP_STACK) is now sufficient to create an upward-growing stack * tag 'parisc-for-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Allow mmap(MAP_STACK) memory to automatically expand upwards parisc: Use PRIV_USER instead of hardcoded value parisc: Fix itlb miss handler for 64-bit programs parisc: Fix 64-bit userspace syscall path parisc: Fix stack start for ADDR_NO_RANDOMIZE personality parisc: Convert to generic clockevents parisc: pdc_stable: Constify struct kobj_type
2 parents 932d2d1 + 5d69896 commit 54450af

File tree

10 files changed

+136
-172
lines changed

10 files changed

+136
-172
lines changed

arch/parisc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ config PARISC
7272
select GENERIC_SCHED_CLOCK
7373
select GENERIC_IRQ_MIGRATION if SMP
7474
select HAVE_UNSTABLE_SCHED_CLOCK if SMP
75-
select LEGACY_TIMER_TICK
75+
select GENERIC_CLOCKEVENTS
7676
select CPU_NO_EFFICIENT_FFS
7777
select THREAD_INFO_IN_TASK
7878
select NEED_DMA_MAP_STATE

arch/parisc/include/asm/mman.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,18 @@ static inline bool arch_memory_deny_write_exec_supported(void)
1111
}
1212
#define arch_memory_deny_write_exec_supported arch_memory_deny_write_exec_supported
1313

14+
static inline unsigned long arch_calc_vm_flag_bits(unsigned long flags)
15+
{
16+
/*
17+
* The stack on parisc grows upwards, so if userspace requests memory
18+
* for a stack, mark it with VM_GROWSUP so that the stack expansion in
19+
* the fault handler will work.
20+
*/
21+
if (flags & MAP_STACK)
22+
return VM_GROWSUP;
23+
24+
return 0;
25+
}
26+
#define arch_calc_vm_flag_bits(flags) arch_calc_vm_flag_bits(flags)
27+
1428
#endif /* __ASM_MMAN_H__ */

arch/parisc/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ extern unsigned int toc_handler_csum;
298298
extern void do_cpu_irq_mask(struct pt_regs *);
299299
extern irqreturn_t timer_interrupt(int, void *);
300300
extern irqreturn_t ipi_interrupt(int, void *);
301-
extern void start_cpu_itimer(void);
301+
extern void parisc_clockevent_init(void);
302302
extern void handle_interruption(int, struct pt_regs *);
303303

304304
/* called from assembly code: */

arch/parisc/kernel/entry.S

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,17 +1051,15 @@ ENTRY_CFI(intr_save) /* for os_hpmc */
10511051
STREG %r16, PT_ISR(%r29)
10521052
STREG %r17, PT_IOR(%r29)
10531053

1054-
#if 0 && defined(CONFIG_64BIT)
1055-
/* Revisit when we have 64-bit code above 4Gb */
1054+
#if defined(CONFIG_64BIT)
10561055
b,n intr_save2
10571056

10581057
skip_save_ior:
10591058
/* We have a itlb miss, and when executing code above 4 Gb on ILP64, we
10601059
* need to adjust iasq/iaoq here in the same way we adjusted isr/ior
10611060
* above.
10621061
*/
1063-
extrd,u,* %r8,PSW_W_BIT,1,%r1
1064-
cmpib,COND(=),n 1,%r1,intr_save2
1062+
bb,COND(>=),n %r8,PSW_W_BIT,intr_save2
10651063
LDREG PT_IASQ0(%r29), %r16
10661064
LDREG PT_IAOQ0(%r29), %r17
10671065
/* adjust iasq/iaoq */

arch/parisc/kernel/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ smp_cpu_init(int cpunum)
297297
enter_lazy_tlb(&init_mm, current);
298298

299299
init_IRQ(); /* make sure no IRQs are enabled or pending */
300-
start_cpu_itimer();
300+
parisc_clockevent_init();
301301
}
302302

303303

arch/parisc/kernel/syscall.S

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ linux_gateway_entry:
243243

244244
#ifdef CONFIG_64BIT
245245
ldil L%sys_call_table, %r1
246-
or,= %r2,%r2,%r2
247-
addil L%(sys_call_table64-sys_call_table), %r1
246+
or,ev %r2,%r2,%r2
247+
ldil L%sys_call_table64, %r1
248248
ldo R%sys_call_table(%r1), %r19
249-
or,= %r2,%r2,%r2
249+
or,ev %r2,%r2,%r2
250250
ldo R%sys_call_table64(%r1), %r19
251251
#else
252252
load32 sys_call_table, %r19
@@ -379,10 +379,10 @@ tracesys_next:
379379
extrd,u %r19,63,1,%r2 /* W hidden in bottom bit */
380380

381381
ldil L%sys_call_table, %r1
382-
or,= %r2,%r2,%r2
383-
addil L%(sys_call_table64-sys_call_table), %r1
382+
or,ev %r2,%r2,%r2
383+
ldil L%sys_call_table64, %r1
384384
ldo R%sys_call_table(%r1), %r19
385-
or,= %r2,%r2,%r2
385+
or,ev %r2,%r2,%r2
386386
ldo R%sys_call_table64(%r1), %r19
387387
#else
388388
load32 sys_call_table, %r19
@@ -1327,6 +1327,8 @@ ENTRY(sys_call_table)
13271327
END(sys_call_table)
13281328

13291329
#ifdef CONFIG_64BIT
1330+
#undef __SYSCALL_WITH_COMPAT
1331+
#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
13301332
.align 8
13311333
ENTRY(sys_call_table64)
13321334
#include <asm/syscall_table_64.h> /* 64-bit syscalls */

0 commit comments

Comments
 (0)