Skip to content

Commit f646429

Browse files
committed
Merge tag 'parisc-for-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc updates from Helge Deller: "The gettimeofday() and clock_gettime() syscalls are now available as vDSO functions, and Dave added a patch which allows to use NVMe cards in the PCI slots as fast and easy alternative to SCSI discs. Summary: - add gettimeofday() and clock_gettime() vDSO functions - enable PCI_MSI_ARCH_FALLBACKS to allow PCI to PCIe bridge adaptor with PCIe NVME card to function in parisc machines - allow users to reduce kernel unaligned runtime warnings - minor code cleanups" * tag 'parisc-for-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Add support for CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN parisc: Use max() to calculate parisc_tlb_flush_threshold parisc: Fix warning at drivers/pci/msi/msi.h:121 parisc: Add 64-bit gettimeofday() and clock_gettime() vDSO functions parisc: Add 32-bit gettimeofday() and clock_gettime() vDSO functions parisc: Clean up unistd.h file
2 parents f9bcc61 + cbade82 commit f646429

File tree

12 files changed

+125
-53
lines changed

12 files changed

+125
-53
lines changed

Documentation/admin-guide/sysctl/kernel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ ignore-unaligned-usertrap
454454

455455
On architectures where unaligned accesses cause traps, and where this
456456
feature is supported (``CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN``;
457-
currently, ``arc`` and ``loongarch``), controls whether all
457+
currently, ``arc``, ``parisc`` and ``loongarch``), controls whether all
458458
unaligned traps are logged.
459459

460460
= =============================================================

arch/parisc/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ config PARISC
4646
select GENERIC_CPU_DEVICES if !SMP
4747
select GENERIC_LIB_DEVMEM_IS_ALLOWED
4848
select SYSCTL_ARCH_UNALIGN_ALLOW
49+
select SYSCTL_ARCH_UNALIGN_NO_WARN
4950
select SYSCTL_EXCEPTION_TRACE
5051
select HAVE_MOD_ARCH_SPECIFIC
5152
select MODULES_USE_ELF_RELA
@@ -86,6 +87,7 @@ config PARISC
8687
select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS
8788
select TRACE_IRQFLAGS_SUPPORT
8889
select HAVE_FUNCTION_DESCRIPTORS if 64BIT
90+
select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
8991

9092
help
9193
The PA-RISC microprocessor is designed by Hewlett-Packard and used

arch/parisc/include/asm/unistd.h

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* sysdeps/unix/sysv/linux/hppa/sysdep.h
2121
*/
2222

23-
#ifdef PIC
23+
#ifndef DONT_USE_PIC
2424
/* WARNING: CANNOT BE USED IN A NOP! */
2525
# define K_STW_ASM_PIC " copy %%r19, %%r4\n"
2626
# define K_LDW_ASM_PIC " copy %%r4, %%r19\n"
@@ -43,7 +43,7 @@
4343
across the syscall. */
4444

4545
#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
46-
"%r20", "%r29", "%r31"
46+
"%r20", "%r29", "%r31"
4747

4848
#undef K_INLINE_SYSCALL
4949
#define K_INLINE_SYSCALL(name, nr, args...) ({ \
@@ -58,7 +58,7 @@
5858
" ldi %1, %%r20\n" \
5959
K_LDW_ASM_PIC \
6060
: "=r" (__res) \
61-
: "i" (SYS_ify(name)) K_ASM_ARGS_##nr \
61+
: "i" (name) K_ASM_ARGS_##nr \
6262
: "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr \
6363
); \
6464
__sys_res = (long)__res; \
@@ -104,42 +104,18 @@
104104
#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
105105
#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
106106

107-
#define _syscall0(type,name) \
108-
type name(void) \
109-
{ \
110-
return K_INLINE_SYSCALL(name, 0); \
111-
}
112-
113-
#define _syscall1(type,name,type1,arg1) \
114-
type name(type1 arg1) \
115-
{ \
116-
return K_INLINE_SYSCALL(name, 1, arg1); \
117-
}
118-
119-
#define _syscall2(type,name,type1,arg1,type2,arg2) \
120-
type name(type1 arg1, type2 arg2) \
121-
{ \
122-
return K_INLINE_SYSCALL(name, 2, arg1, arg2); \
123-
}
124-
125-
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
126-
type name(type1 arg1, type2 arg2, type3 arg3) \
127-
{ \
128-
return K_INLINE_SYSCALL(name, 3, arg1, arg2, arg3); \
129-
}
130-
131-
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
132-
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
133-
{ \
134-
return K_INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4); \
135-
}
136-
137-
/* select takes 5 arguments */
138-
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
139-
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
140-
{ \
141-
return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \
142-
}
107+
#define syscall0(name) \
108+
K_INLINE_SYSCALL(name, 0)
109+
#define syscall1(name, arg1) \
110+
K_INLINE_SYSCALL(name, 1, arg1)
111+
#define syscall2(name, arg1, arg2) \
112+
K_INLINE_SYSCALL(name, 2, arg1, arg2)
113+
#define syscall3(name, arg1, arg2, arg3) \
114+
K_INLINE_SYSCALL(name, 3, arg1, arg2, arg3)
115+
#define syscall4(name, arg1, arg2, arg3, arg4) \
116+
K_INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4)
117+
#define syscall5(name, arg1, arg2, arg3, arg4, arg5) \
118+
K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5)
143119

144120
#define __ARCH_WANT_NEW_STAT
145121
#define __ARCH_WANT_STAT64

arch/parisc/include/asm/vdso.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ extern struct vdso_data *vdso_data;
1919
/* Default link addresses for the vDSOs */
2020
#define VDSO_LBASE 0
2121

22-
#define VDSO_VERSION_STRING LINUX_5.18
22+
#define VDSO_VERSION_STRING LINUX_6.11
2323

2424
#endif /* __PARISC_VDSO_H__ */

arch/parisc/kernel/cache.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -611,11 +611,7 @@ void __init parisc_setup_cache_timing(void)
611611
threshold/1024);
612612

613613
set_tlb_threshold:
614-
if (threshold > FLUSH_TLB_THRESHOLD)
615-
parisc_tlb_flush_threshold = threshold;
616-
else
617-
parisc_tlb_flush_threshold = FLUSH_TLB_THRESHOLD;
618-
614+
parisc_tlb_flush_threshold = max(threshold, FLUSH_TLB_THRESHOLD);
619615
printk(KERN_INFO "TLB flush threshold set to %lu KiB\n",
620616
parisc_tlb_flush_threshold/1024);
621617
}

arch/parisc/kernel/unaligned.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
#define ERR_NOTHANDLED -1
105105

106106
int unaligned_enabled __read_mostly = 1;
107+
int no_unaligned_warning __read_mostly;
107108

108109
static int emulate_ldh(struct pt_regs *regs, int toreg)
109110
{
@@ -399,6 +400,7 @@ void handle_unaligned(struct pt_regs *regs)
399400
} else {
400401
static DEFINE_RATELIMIT_STATE(kernel_ratelimit, 5 * HZ, 5);
401402
if (!(current->thread.flags & PARISC_UAC_NOPRINT) &&
403+
!no_unaligned_warning &&
402404
__ratelimit(&kernel_ratelimit))
403405
pr_warn("Kernel: unaligned access to " RFMT " in %pS "
404406
"(iir " RFMT ")\n",

arch/parisc/kernel/vdso32/Makefile

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
# List of files in the vdso, has to be asm only for now
1+
# Include the generic Makefile to check the built vdso.
2+
include $(srctree)/lib/vdso/Makefile
3+
4+
KCOV_INSTRUMENT := n
5+
6+
# Disable gcov profiling, ubsan and kasan for VDSO code
7+
GCOV_PROFILE := n
8+
UBSAN_SANITIZE := n
9+
KASAN_SANITIZE := n
10+
KCSAN_SANITIZE := n
211

312
obj-vdso32 = note.o sigtramp.o restart_syscall.o
13+
obj-cvdso32 = vdso32_generic.o
414

515
# Build rules
616

7-
targets := $(obj-vdso32) vdso32.so
17+
targets := $(obj-vdso32) $(obj-cvdso32) vdso32.so
818
obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
19+
obj-cvdso32 := $(addprefix $(obj)/, $(obj-cvdso32))
20+
21+
VDSO_CFLAGS_REMOVE := -pg $(CC_FLAGS_FTRACE)
22+
CFLAGS_REMOVE_vdso32_generic.o = $(VDSO_CFLAGS_REMOVE)
923

1024
ccflags-y := -shared -fno-common -fbuiltin -mno-fast-indirect-calls -O2 -mno-long-calls
1125
# -march=1.1 -mschedule=7100LC
@@ -26,18 +40,22 @@ $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so FORCE
2640

2741
# Force dependency (incbin is bad)
2842
# link rule for the .so file, .lds has to be first
29-
$(obj)/vdso32.so: $(obj)/vdso32.lds $(obj-vdso32) $(VDSO_LIBGCC) FORCE
43+
$(obj)/vdso32.so: $(obj)/vdso32.lds $(obj-vdso32) $(obj-cvdso32) $(VDSO_LIBGCC) FORCE
3044
$(call if_changed,vdso32ld)
3145

3246
# assembly rules for the .S files
3347
$(obj-vdso32): %.o: %.S FORCE
3448
$(call if_changed_dep,vdso32as)
49+
$(obj-cvdso32): %.o: %.c FORCE
50+
$(call if_changed_dep,vdso32cc)
3551

3652
# actual build commands
3753
quiet_cmd_vdso32ld = VDSO32L $@
3854
cmd_vdso32ld = $(CROSS32CC) $(c_flags) -Wl,-T $(filter-out FORCE, $^) -o $@
3955
quiet_cmd_vdso32as = VDSO32A $@
4056
cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
57+
quiet_cmd_vdso32cc = VDSO32C $@
58+
cmd_vdso32cc = $(CROSS32CC) $(c_flags) -c -o $@ $<
4159

4260
# Generate VDSO offsets using helper script
4361
gen-vdsosym := $(src)/gen_vdso_offsets.sh

arch/parisc/kernel/vdso32/vdso32.lds.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ VERSION
106106
global:
107107
__kernel_sigtramp_rt32;
108108
__kernel_restart_syscall32;
109+
__vdso_gettimeofday;
110+
__vdso_clock_gettime;
111+
__vdso_clock_gettime64;
109112
local: *;
110113
};
111114
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
#include "asm/unistd.h"
4+
#include <linux/types.h>
5+
#include <uapi/asm/unistd_32.h>
6+
7+
struct timezone;
8+
struct old_timespec32;
9+
struct __kernel_timespec;
10+
struct __kernel_old_timeval;
11+
12+
/* forward declarations */
13+
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
14+
int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts);
15+
int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts);
16+
17+
18+
int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
19+
struct timezone *tz)
20+
{
21+
return syscall2(__NR_gettimeofday, (long)tv, (long)tz);
22+
}
23+
24+
int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts)
25+
{
26+
return syscall2(__NR_clock_gettime, (long)clock, (long)ts);
27+
}
28+
29+
int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts)
30+
{
31+
return syscall2(__NR_clock_gettime64, (long)clock, (long)ts);
32+
}

arch/parisc/kernel/vdso64/Makefile

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1-
# List of files in the vdso, has to be asm only for now
1+
# Include the generic Makefile to check the built vdso.
2+
include $(srctree)/lib/vdso/Makefile
3+
4+
KCOV_INSTRUMENT := n
5+
6+
# Disable gcov profiling, ubsan and kasan for VDSO code
7+
GCOV_PROFILE := n
8+
UBSAN_SANITIZE := n
9+
KASAN_SANITIZE := n
10+
KCSAN_SANITIZE := n
211

312
obj-vdso64 = note.o sigtramp.o restart_syscall.o
13+
obj-cvdso64 = vdso64_generic.o
414

515
# Build rules
616

7-
targets := $(obj-vdso64) vdso64.so
8-
obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
17+
targets := $(obj-vdso64) $(obj-cvdso64) vdso64.so
18+
obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
19+
obj-cvdso64 := $(addprefix $(obj)/, $(obj-cvdso64))
920

21+
VDSO_CFLAGS_REMOVE := -pg $(CC_FLAGS_FTRACE)
22+
CFLAGS_REMOVE_vdso64_generic.o = $(VDSO_CFLAGS_REMOVE)
1023

1124
ccflags-y := -shared -fno-common -fno-builtin
1225
ccflags-y += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
@@ -26,18 +39,22 @@ $(obj)/vdso64_wrapper.o : $(obj)/vdso64.so FORCE
2639

2740
# Force dependency (incbin is bad)
2841
# link rule for the .so file, .lds has to be first
29-
$(obj)/vdso64.so: $(obj)/vdso64.lds $(obj-vdso64) $(VDSO_LIBGCC) FORCE
42+
$(obj)/vdso64.so: $(obj)/vdso64.lds $(obj-vdso64) $(obj-cvdso64) $(VDSO_LIBGCC) FORCE
3043
$(call if_changed,vdso64ld)
3144

3245
# assembly rules for the .S files
3346
$(obj-vdso64): %.o: %.S FORCE
3447
$(call if_changed_dep,vdso64as)
48+
$(obj-cvdso64): %.o: %.c FORCE
49+
$(call if_changed_dep,vdso64cc)
3550

3651
# actual build commands
3752
quiet_cmd_vdso64ld = VDSO64L $@
3853
cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $(filter-out FORCE, $^) -o $@
3954
quiet_cmd_vdso64as = VDSO64A $@
4055
cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
56+
quiet_cmd_vdso64cc = VDSO64C $@
57+
cmd_vdso64cc = $(CC) $(c_flags) -c -o $@ $<
4158

4259
# Generate VDSO offsets using helper script
4360
gen-vdsosym := $(src)/gen_vdso_offsets.sh

0 commit comments

Comments
 (0)