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

Merge branch 'parisc-5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc updates from Helge Deller:
"A change to increase the default maximum stack size on parisc to 100MB
and the ability to further increase the stack hard limit size at
runtime with ulimit for newly started processes.

The other patches fix compile warnings, utilize the Kbuild logic and
cleanups the parisc arch code"

* 'parisc-5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc: pci-dma: fix warning unused-function
parisc/uapi: Use Kbuild logic to provide <asm/types.h>
parisc: Make user stack size configurable
parisc: Use _TIF_USER_WORK_MASK in entry.S
parisc: Drop loops_per_jiffy from per_cpu struct

+35 -30
+2 -6
arch/parisc/include/asm/processor.h
··· 45 45 #define STACK_TOP TASK_SIZE 46 46 #define STACK_TOP_MAX DEFAULT_TASK_SIZE 47 47 48 - /* Allow bigger stacks for 64-bit processes */ 49 - #define STACK_SIZE_MAX (USER_WIDE_MODE \ 50 - ? (1 << 30) /* 1 GB */ \ 51 - : (CONFIG_MAX_STACK_SIZE_MB*1024*1024)) 52 - 53 48 #endif 54 49 55 50 #ifndef __ASSEMBLY__ 51 + 52 + unsigned long calc_max_stack_size(unsigned long stack_max); 56 53 57 54 /* 58 55 * Data detected about CPUs at boot time which is the same for all CPU's. ··· 94 97 unsigned long cpu_loc; /* CPU location from PAT firmware */ 95 98 unsigned int state; 96 99 struct parisc_device *dev; 97 - unsigned long loops_per_jiffy; 98 100 }; 99 101 100 102 extern struct system_cpuinfo_parisc boot_cpu_data;
-7
arch/parisc/include/uapi/asm/types.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _PARISC_TYPES_H 3 - #define _PARISC_TYPES_H 4 - 5 - #include <asm-generic/int-ll64.h> 6 - 7 - #endif
+2 -2
arch/parisc/kernel/entry.S
··· 887 887 /* As above */ 888 888 mfctl %cr30,%r1 889 889 LDREG TI_FLAGS(%r1),%r19 890 - ldi (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME), %r20 890 + ldi (_TIF_USER_WORK_MASK & ~_TIF_NEED_RESCHED), %r20 891 891 and,COND(<>) %r19, %r20, %r0 892 892 b,n intr_restore /* skip past if we've nothing to do */ 893 893 ··· 1810 1810 .import do_signal,code 1811 1811 syscall_check_sig: 1812 1812 LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19 1813 - ldi (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME), %r26 1813 + ldi (_TIF_USER_WORK_MASK & ~_TIF_NEED_RESCHED), %r26 1814 1814 and,COND(<>) %r19, %r26, %r0 1815 1815 b,n syscall_restore /* skip past if we've nothing to do */ 1816 1816
+1 -1
arch/parisc/kernel/pci-dma.c
··· 335 335 dump_resmap(); 336 336 } 337 337 338 - static int proc_pcxl_dma_show(struct seq_file *m, void *v) 338 + static int __maybe_unused proc_pcxl_dma_show(struct seq_file *m, void *v) 339 339 { 340 340 #if 0 341 341 u_long i = 0;
+2 -3
arch/parisc/kernel/processor.c
··· 163 163 if (cpuid) 164 164 memset(p, 0, sizeof(struct cpuinfo_parisc)); 165 165 166 - p->loops_per_jiffy = loops_per_jiffy; 167 166 p->dev = dev; /* Save IODC data in case we need it */ 168 167 p->hpa = dev->hpa.start; /* save CPU hpa */ 169 168 p->cpuid = cpuid; /* save CPU id */ ··· 433 434 show_cache_info(m); 434 435 435 436 seq_printf(m, "bogomips\t: %lu.%02lu\n", 436 - cpuinfo->loops_per_jiffy / (500000 / HZ), 437 - (cpuinfo->loops_per_jiffy / (5000 / HZ)) % 100); 437 + loops_per_jiffy / (500000 / HZ), 438 + loops_per_jiffy / (5000 / HZ) % 100); 438 439 439 440 seq_printf(m, "software id\t: %ld\n\n", 440 441 boot_cpu_data.pdc.model.sw_id);
+21 -2
arch/parisc/kernel/sys_parisc.c
··· 53 53 return base + off; 54 54 } 55 55 56 + 57 + #define STACK_SIZE_DEFAULT (USER_WIDE_MODE \ 58 + ? (1 << 30) /* 1 GB */ \ 59 + : (CONFIG_STACK_MAX_DEFAULT_SIZE_MB*1024*1024)) 60 + 61 + unsigned long calc_max_stack_size(unsigned long stack_max) 62 + { 63 + #ifdef CONFIG_COMPAT 64 + if (!USER_WIDE_MODE && (stack_max == COMPAT_RLIM_INFINITY)) 65 + stack_max = STACK_SIZE_DEFAULT; 66 + else 67 + #endif 68 + if (stack_max == RLIM_INFINITY) 69 + stack_max = STACK_SIZE_DEFAULT; 70 + 71 + return stack_max; 72 + } 73 + 74 + 56 75 /* 57 76 * Top of mmap area (just below the process stack). 58 77 */ ··· 88 69 /* Limit stack size - see setup_arg_pages() in fs/exec.c */ 89 70 stack_base = rlim_stack ? rlim_stack->rlim_max 90 71 : rlimit_max(RLIMIT_STACK); 91 - if (stack_base > STACK_SIZE_MAX) 92 - stack_base = STACK_SIZE_MAX; 72 + 73 + stack_base = calc_max_stack_size(stack_base); 93 74 94 75 /* Add space for stack randomization. */ 95 76 if (current->flags & PF_RANDOMIZE)
+2 -2
fs/exec.c
··· 757 757 #ifdef CONFIG_STACK_GROWSUP 758 758 /* Limit stack size */ 759 759 stack_base = bprm->rlim_stack.rlim_max; 760 - if (stack_base > STACK_SIZE_MAX) 761 - stack_base = STACK_SIZE_MAX; 760 + 761 + stack_base = calc_max_stack_size(stack_base); 762 762 763 763 /* Add space for stack randomization. */ 764 764 stack_base += (STACK_RND_MASK << PAGE_SHIFT);
+5 -7
mm/Kconfig
··· 720 720 config GENERIC_EARLY_IOREMAP 721 721 bool 722 722 723 - config MAX_STACK_SIZE_MB 724 - int "Maximum user stack size for 32-bit processes (MB)" 725 - default 80 723 + config STACK_MAX_DEFAULT_SIZE_MB 724 + int "Default maximum user stack size for 32-bit processes (MB)" 725 + default 100 726 726 range 8 2048 727 727 depends on STACK_GROWSUP && (!64BIT || COMPAT) 728 728 help 729 729 This is the maximum stack size in Megabytes in the VM layout of 32-bit 730 730 user processes when the stack grows upwards (currently only on parisc 731 - arch). The stack will be located at the highest memory address minus 732 - the given value, unless the RLIMIT_STACK hard limit is changed to a 733 - smaller value in which case that is used. 731 + arch) when the RLIMIT_STACK hard limit is unlimited. 734 732 735 - A sane initial value is 80 MB. 733 + A sane initial value is 100 MB. 736 734 737 735 config DEFERRED_STRUCT_PAGE_INIT 738 736 bool "Defer initialisation of struct pages to kthreads"