Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+125 -53
+1 -1
Documentation/admin-guide/sysctl/kernel.rst
··· 454 454 455 455 On architectures where unaligned accesses cause traps, and where this 456 456 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 458 458 unaligned traps are logged. 459 459 460 460 = =============================================================
+2
arch/parisc/Kconfig
··· 46 46 select GENERIC_CPU_DEVICES if !SMP 47 47 select GENERIC_LIB_DEVMEM_IS_ALLOWED 48 48 select SYSCTL_ARCH_UNALIGN_ALLOW 49 + select SYSCTL_ARCH_UNALIGN_NO_WARN 49 50 select SYSCTL_EXCEPTION_TRACE 50 51 select HAVE_MOD_ARCH_SPECIFIC 51 52 select MODULES_USE_ELF_RELA ··· 87 86 select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS 88 87 select TRACE_IRQFLAGS_SUPPORT 89 88 select HAVE_FUNCTION_DESCRIPTORS if 64BIT 89 + select PCI_MSI_ARCH_FALLBACKS if PCI_MSI 90 90 91 91 help 92 92 The PA-RISC microprocessor is designed by Hewlett-Packard and used
+15 -39
arch/parisc/include/asm/unistd.h
··· 20 20 * sysdeps/unix/sysv/linux/hppa/sysdep.h 21 21 */ 22 22 23 - #ifdef PIC 23 + #ifndef DONT_USE_PIC 24 24 /* WARNING: CANNOT BE USED IN A NOP! */ 25 25 # define K_STW_ASM_PIC " copy %%r19, %%r4\n" 26 26 # define K_LDW_ASM_PIC " copy %%r4, %%r19\n" ··· 43 43 across the syscall. */ 44 44 45 45 #define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \ 46 - "%r20", "%r29", "%r31" 46 + "%r20", "%r29", "%r31" 47 47 48 48 #undef K_INLINE_SYSCALL 49 49 #define K_INLINE_SYSCALL(name, nr, args...) ({ \ ··· 58 58 " ldi %1, %%r20\n" \ 59 59 K_LDW_ASM_PIC \ 60 60 : "=r" (__res) \ 61 - : "i" (SYS_ify(name)) K_ASM_ARGS_##nr \ 61 + : "i" (name) K_ASM_ARGS_##nr \ 62 62 : "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr \ 63 63 ); \ 64 64 __sys_res = (long)__res; \ ··· 104 104 #define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25" 105 105 #define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26" 106 106 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) 143 119 144 120 #define __ARCH_WANT_NEW_STAT 145 121 #define __ARCH_WANT_STAT64
+1 -1
arch/parisc/include/asm/vdso.h
··· 19 19 /* Default link addresses for the vDSOs */ 20 20 #define VDSO_LBASE 0 21 21 22 - #define VDSO_VERSION_STRING LINUX_5.18 22 + #define VDSO_VERSION_STRING LINUX_6.11 23 23 24 24 #endif /* __PARISC_VDSO_H__ */
+1 -5
arch/parisc/kernel/cache.c
··· 611 611 threshold/1024); 612 612 613 613 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); 619 615 printk(KERN_INFO "TLB flush threshold set to %lu KiB\n", 620 616 parisc_tlb_flush_threshold/1024); 621 617 }
+2
arch/parisc/kernel/unaligned.c
··· 104 104 #define ERR_NOTHANDLED -1 105 105 106 106 int unaligned_enabled __read_mostly = 1; 107 + int no_unaligned_warning __read_mostly; 107 108 108 109 static int emulate_ldh(struct pt_regs *regs, int toreg) 109 110 { ··· 400 399 } else { 401 400 static DEFINE_RATELIMIT_STATE(kernel_ratelimit, 5 * HZ, 5); 402 401 if (!(current->thread.flags & PARISC_UAC_NOPRINT) && 402 + !no_unaligned_warning && 403 403 __ratelimit(&kernel_ratelimit)) 404 404 pr_warn("Kernel: unaligned access to " RFMT " in %pS " 405 405 "(iir " RFMT ")\n",
+21 -3
arch/parisc/kernel/vdso32/Makefile
··· 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 2 11 3 12 obj-vdso32 = note.o sigtramp.o restart_syscall.o 13 + obj-cvdso32 = vdso32_generic.o 4 14 5 15 # Build rules 6 16 7 - targets := $(obj-vdso32) vdso32.so 17 + targets := $(obj-vdso32) $(obj-cvdso32) vdso32.so 8 18 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) 9 23 10 24 ccflags-y := -shared -fno-common -fbuiltin -mno-fast-indirect-calls -O2 -mno-long-calls 11 25 # -march=1.1 -mschedule=7100LC ··· 40 26 41 27 # Force dependency (incbin is bad) 42 28 # link rule for the .so file, .lds has to be first 43 - $(obj)/vdso32.so: $(obj)/vdso32.lds $(obj-vdso32) $(VDSO_LIBGCC) FORCE 29 + $(obj)/vdso32.so: $(obj)/vdso32.lds $(obj-vdso32) $(obj-cvdso32) $(VDSO_LIBGCC) FORCE 44 30 $(call if_changed,vdso32ld) 45 31 46 32 # assembly rules for the .S files 47 33 $(obj-vdso32): %.o: %.S FORCE 48 34 $(call if_changed_dep,vdso32as) 35 + $(obj-cvdso32): %.o: %.c FORCE 36 + $(call if_changed_dep,vdso32cc) 49 37 50 38 # actual build commands 51 39 quiet_cmd_vdso32ld = VDSO32L $@ 52 40 cmd_vdso32ld = $(CROSS32CC) $(c_flags) -Wl,-T $(filter-out FORCE, $^) -o $@ 53 41 quiet_cmd_vdso32as = VDSO32A $@ 54 42 cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $< 43 + quiet_cmd_vdso32cc = VDSO32C $@ 44 + cmd_vdso32cc = $(CROSS32CC) $(c_flags) -c -o $@ $< 55 45 56 46 # Generate VDSO offsets using helper script 57 47 gen-vdsosym := $(src)/gen_vdso_offsets.sh
+3
arch/parisc/kernel/vdso32/vdso32.lds.S
··· 106 106 global: 107 107 __kernel_sigtramp_rt32; 108 108 __kernel_restart_syscall32; 109 + __vdso_gettimeofday; 110 + __vdso_clock_gettime; 111 + __vdso_clock_gettime64; 109 112 local: *; 110 113 }; 111 114 }
+32
arch/parisc/kernel/vdso32/vdso32_generic.c
··· 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 + }
+21 -4
arch/parisc/kernel/vdso64/Makefile
··· 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 2 11 3 12 obj-vdso64 = note.o sigtramp.o restart_syscall.o 13 + obj-cvdso64 = vdso64_generic.o 4 14 5 15 # Build rules 6 16 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)) 9 20 21 + VDSO_CFLAGS_REMOVE := -pg $(CC_FLAGS_FTRACE) 22 + CFLAGS_REMOVE_vdso64_generic.o = $(VDSO_CFLAGS_REMOVE) 10 23 11 24 ccflags-y := -shared -fno-common -fno-builtin 12 25 ccflags-y += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ ··· 39 26 40 27 # Force dependency (incbin is bad) 41 28 # link rule for the .so file, .lds has to be first 42 - $(obj)/vdso64.so: $(obj)/vdso64.lds $(obj-vdso64) $(VDSO_LIBGCC) FORCE 29 + $(obj)/vdso64.so: $(obj)/vdso64.lds $(obj-vdso64) $(obj-cvdso64) $(VDSO_LIBGCC) FORCE 43 30 $(call if_changed,vdso64ld) 44 31 45 32 # assembly rules for the .S files 46 33 $(obj-vdso64): %.o: %.S FORCE 47 34 $(call if_changed_dep,vdso64as) 35 + $(obj-cvdso64): %.o: %.c FORCE 36 + $(call if_changed_dep,vdso64cc) 48 37 49 38 # actual build commands 50 39 quiet_cmd_vdso64ld = VDSO64L $@ 51 40 cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $(filter-out FORCE, $^) -o $@ 52 41 quiet_cmd_vdso64as = VDSO64A $@ 53 42 cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $< 43 + quiet_cmd_vdso64cc = VDSO64C $@ 44 + cmd_vdso64cc = $(CC) $(c_flags) -c -o $@ $< 54 45 55 46 # Generate VDSO offsets using helper script 56 47 gen-vdsosym := $(src)/gen_vdso_offsets.sh
+2
arch/parisc/kernel/vdso64/vdso64.lds.S
··· 104 104 global: 105 105 __kernel_sigtramp_rt64; 106 106 __kernel_restart_syscall64; 107 + __vdso_gettimeofday; 108 + __vdso_clock_gettime; 107 109 local: *; 108 110 }; 109 111 }
+24
arch/parisc/kernel/vdso64/vdso64_generic.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + #include "asm/unistd.h" 4 + #include <linux/types.h> 5 + 6 + struct timezone; 7 + struct __kernel_timespec; 8 + struct __kernel_old_timeval; 9 + 10 + /* forward declarations */ 11 + int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz); 12 + int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts); 13 + 14 + 15 + int __vdso_gettimeofday(struct __kernel_old_timeval *tv, 16 + struct timezone *tz) 17 + { 18 + return syscall2(__NR_gettimeofday, (long)tv, (long)tz); 19 + } 20 + 21 + int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts) 22 + { 23 + return syscall2(__NR_clock_gettime, (long)clock, (long)ts); 24 + }