Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc

Pull sparc fixes from David Miller:
"I didn't want the release to go out without the statx system call
properly hooked up"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
sparc: Update syscall tables.
sparc64: Fill in rest of HAVE_REGS_AND_STACK_ACCESS_API

+49 -2
+1
arch/sparc/Kconfig
··· 82 82 select HAVE_ARCH_AUDITSYSCALL 83 83 select ARCH_SUPPORTS_ATOMIC_RMW 84 84 select HAVE_NMI 85 + select HAVE_REGS_AND_STACK_ACCESS_API 85 86 86 87 config ARCH_DEFCONFIG 87 88 string
+2 -1
arch/sparc/include/asm/ptrace.h
··· 83 83 84 84 #define MAX_REG_OFFSET (offsetof(struct pt_regs, magic)) 85 85 86 - extern int regs_query_register_offset(const char *name); 86 + int regs_query_register_offset(const char *name); 87 + unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n); 87 88 88 89 /** 89 90 * regs_get_register() - get register value from its offset
+7 -1
arch/sparc/include/uapi/asm/unistd.h
··· 425 425 #define __NR_copy_file_range 357 426 426 #define __NR_preadv2 358 427 427 #define __NR_pwritev2 359 428 + #define __NR_statx 360 428 429 429 - #define NR_syscalls 360 430 + #define NR_syscalls 361 430 431 431 432 /* Bitmask values returned from kern_features system call. */ 432 433 #define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 ··· 442 441 #define __IGNORE_setresgid 443 442 #define __IGNORE_getresgid 444 443 #endif 444 + 445 + /* Sparc doesn't have protection keys. */ 446 + #define __IGNORE_pkey_mprotect 447 + #define __IGNORE_pkey_alloc 448 + #define __IGNORE_pkey_free 445 449 446 450 #endif /* _UAPI_SPARC_UNISTD_H */
+36
arch/sparc/kernel/ptrace_64.c
··· 1162 1162 return roff->offset; 1163 1163 return -EINVAL; 1164 1164 } 1165 + 1166 + /** 1167 + * regs_within_kernel_stack() - check the address in the stack 1168 + * @regs: pt_regs which contains kernel stack pointer. 1169 + * @addr: address which is checked. 1170 + * 1171 + * regs_within_kernel_stack() checks @addr is within the kernel stack page(s). 1172 + * If @addr is within the kernel stack, it returns true. If not, returns false. 1173 + */ 1174 + static inline int regs_within_kernel_stack(struct pt_regs *regs, 1175 + unsigned long addr) 1176 + { 1177 + unsigned long ksp = kernel_stack_pointer(regs) + STACK_BIAS; 1178 + return ((addr & ~(THREAD_SIZE - 1)) == 1179 + (ksp & ~(THREAD_SIZE - 1))); 1180 + } 1181 + 1182 + /** 1183 + * regs_get_kernel_stack_nth() - get Nth entry of the stack 1184 + * @regs: pt_regs which contains kernel stack pointer. 1185 + * @n: stack entry number. 1186 + * 1187 + * regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which 1188 + * is specified by @regs. If the @n th entry is NOT in the kernel stack, 1189 + * this returns 0. 1190 + */ 1191 + unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n) 1192 + { 1193 + unsigned long ksp = kernel_stack_pointer(regs) + STACK_BIAS; 1194 + unsigned long *addr = (unsigned long *)ksp; 1195 + addr += n; 1196 + if (regs_within_kernel_stack(regs, (unsigned long)addr)) 1197 + return *addr; 1198 + else 1199 + return 0; 1200 + }
+1
arch/sparc/kernel/systbls_32.S
··· 89 89 /*345*/ .long sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf 90 90 /*350*/ .long sys_execveat, sys_membarrier, sys_userfaultfd, sys_bind, sys_listen 91 91 /*355*/ .long sys_setsockopt, sys_mlock2, sys_copy_file_range, sys_preadv2, sys_pwritev2 92 + /*360*/ .long sys_statx
+2
arch/sparc/kernel/systbls_64.S
··· 90 90 .word sys32_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf 91 91 /*350*/ .word sys32_execveat, sys_membarrier, sys_userfaultfd, sys_bind, sys_listen 92 92 .word compat_sys_setsockopt, sys_mlock2, sys_copy_file_range, compat_sys_preadv2, compat_sys_pwritev2 93 + /*360*/ .word sys_statx 93 94 94 95 #endif /* CONFIG_COMPAT */ 95 96 ··· 172 171 .word sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf 173 172 /*350*/ .word sys64_execveat, sys_membarrier, sys_userfaultfd, sys_bind, sys_listen 174 173 .word sys_setsockopt, sys_mlock2, sys_copy_file_range, sys_preadv2, sys_pwritev2 174 + /*360*/ .word sys_statx