mirror of
https://github.com/torvalds/linux
synced 2024-10-07 03:42:55 +00:00
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
This commit is contained in:
commit
5ee863bec7
|
@ -45,15 +45,12 @@
|
||||||
#define STACK_TOP TASK_SIZE
|
#define STACK_TOP TASK_SIZE
|
||||||
#define STACK_TOP_MAX DEFAULT_TASK_SIZE
|
#define STACK_TOP_MAX DEFAULT_TASK_SIZE
|
||||||
|
|
||||||
/* Allow bigger stacks for 64-bit processes */
|
|
||||||
#define STACK_SIZE_MAX (USER_WIDE_MODE \
|
|
||||||
? (1 << 30) /* 1 GB */ \
|
|
||||||
: (CONFIG_MAX_STACK_SIZE_MB*1024*1024))
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
|
unsigned long calc_max_stack_size(unsigned long stack_max);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Data detected about CPUs at boot time which is the same for all CPU's.
|
* Data detected about CPUs at boot time which is the same for all CPU's.
|
||||||
* HP boxes are SMP - ie identical processors.
|
* HP boxes are SMP - ie identical processors.
|
||||||
|
@ -97,7 +94,6 @@ struct cpuinfo_parisc {
|
||||||
unsigned long cpu_loc; /* CPU location from PAT firmware */
|
unsigned long cpu_loc; /* CPU location from PAT firmware */
|
||||||
unsigned int state;
|
unsigned int state;
|
||||||
struct parisc_device *dev;
|
struct parisc_device *dev;
|
||||||
unsigned long loops_per_jiffy;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct system_cpuinfo_parisc boot_cpu_data;
|
extern struct system_cpuinfo_parisc boot_cpu_data;
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
|
||||||
#ifndef _PARISC_TYPES_H
|
|
||||||
#define _PARISC_TYPES_H
|
|
||||||
|
|
||||||
#include <asm-generic/int-ll64.h>
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -887,7 +887,7 @@ intr_check_sig:
|
||||||
/* As above */
|
/* As above */
|
||||||
mfctl %cr30,%r1
|
mfctl %cr30,%r1
|
||||||
LDREG TI_FLAGS(%r1),%r19
|
LDREG TI_FLAGS(%r1),%r19
|
||||||
ldi (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME), %r20
|
ldi (_TIF_USER_WORK_MASK & ~_TIF_NEED_RESCHED), %r20
|
||||||
and,COND(<>) %r19, %r20, %r0
|
and,COND(<>) %r19, %r20, %r0
|
||||||
b,n intr_restore /* skip past if we've nothing to do */
|
b,n intr_restore /* skip past if we've nothing to do */
|
||||||
|
|
||||||
|
@ -1810,7 +1810,7 @@ syscall_check_resched:
|
||||||
.import do_signal,code
|
.import do_signal,code
|
||||||
syscall_check_sig:
|
syscall_check_sig:
|
||||||
LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19
|
LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19
|
||||||
ldi (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME), %r26
|
ldi (_TIF_USER_WORK_MASK & ~_TIF_NEED_RESCHED), %r26
|
||||||
and,COND(<>) %r19, %r26, %r0
|
and,COND(<>) %r19, %r26, %r0
|
||||||
b,n syscall_restore /* skip past if we've nothing to do */
|
b,n syscall_restore /* skip past if we've nothing to do */
|
||||||
|
|
||||||
|
|
|
@ -335,7 +335,7 @@ pcxl_free_range(unsigned long vaddr, size_t size)
|
||||||
dump_resmap();
|
dump_resmap();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int proc_pcxl_dma_show(struct seq_file *m, void *v)
|
static int __maybe_unused proc_pcxl_dma_show(struct seq_file *m, void *v)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
u_long i = 0;
|
u_long i = 0;
|
||||||
|
|
|
@ -163,7 +163,6 @@ static int __init processor_probe(struct parisc_device *dev)
|
||||||
if (cpuid)
|
if (cpuid)
|
||||||
memset(p, 0, sizeof(struct cpuinfo_parisc));
|
memset(p, 0, sizeof(struct cpuinfo_parisc));
|
||||||
|
|
||||||
p->loops_per_jiffy = loops_per_jiffy;
|
|
||||||
p->dev = dev; /* Save IODC data in case we need it */
|
p->dev = dev; /* Save IODC data in case we need it */
|
||||||
p->hpa = dev->hpa.start; /* save CPU hpa */
|
p->hpa = dev->hpa.start; /* save CPU hpa */
|
||||||
p->cpuid = cpuid; /* save CPU id */
|
p->cpuid = cpuid; /* save CPU id */
|
||||||
|
@ -434,8 +433,8 @@ show_cpuinfo (struct seq_file *m, void *v)
|
||||||
show_cache_info(m);
|
show_cache_info(m);
|
||||||
|
|
||||||
seq_printf(m, "bogomips\t: %lu.%02lu\n",
|
seq_printf(m, "bogomips\t: %lu.%02lu\n",
|
||||||
cpuinfo->loops_per_jiffy / (500000 / HZ),
|
loops_per_jiffy / (500000 / HZ),
|
||||||
(cpuinfo->loops_per_jiffy / (5000 / HZ)) % 100);
|
loops_per_jiffy / (5000 / HZ) % 100);
|
||||||
|
|
||||||
seq_printf(m, "software id\t: %ld\n\n",
|
seq_printf(m, "software id\t: %ld\n\n",
|
||||||
boot_cpu_data.pdc.model.sw_id);
|
boot_cpu_data.pdc.model.sw_id);
|
||||||
|
|
|
@ -53,6 +53,25 @@ static inline unsigned long COLOR_ALIGN(unsigned long addr,
|
||||||
return base + off;
|
return base + off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define STACK_SIZE_DEFAULT (USER_WIDE_MODE \
|
||||||
|
? (1 << 30) /* 1 GB */ \
|
||||||
|
: (CONFIG_STACK_MAX_DEFAULT_SIZE_MB*1024*1024))
|
||||||
|
|
||||||
|
unsigned long calc_max_stack_size(unsigned long stack_max)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_COMPAT
|
||||||
|
if (!USER_WIDE_MODE && (stack_max == COMPAT_RLIM_INFINITY))
|
||||||
|
stack_max = STACK_SIZE_DEFAULT;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
if (stack_max == RLIM_INFINITY)
|
||||||
|
stack_max = STACK_SIZE_DEFAULT;
|
||||||
|
|
||||||
|
return stack_max;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Top of mmap area (just below the process stack).
|
* Top of mmap area (just below the process stack).
|
||||||
*/
|
*/
|
||||||
|
@ -69,8 +88,8 @@ static unsigned long mmap_upper_limit(struct rlimit *rlim_stack)
|
||||||
/* Limit stack size - see setup_arg_pages() in fs/exec.c */
|
/* Limit stack size - see setup_arg_pages() in fs/exec.c */
|
||||||
stack_base = rlim_stack ? rlim_stack->rlim_max
|
stack_base = rlim_stack ? rlim_stack->rlim_max
|
||||||
: rlimit_max(RLIMIT_STACK);
|
: rlimit_max(RLIMIT_STACK);
|
||||||
if (stack_base > STACK_SIZE_MAX)
|
|
||||||
stack_base = STACK_SIZE_MAX;
|
stack_base = calc_max_stack_size(stack_base);
|
||||||
|
|
||||||
/* Add space for stack randomization. */
|
/* Add space for stack randomization. */
|
||||||
if (current->flags & PF_RANDOMIZE)
|
if (current->flags & PF_RANDOMIZE)
|
||||||
|
|
|
@ -757,8 +757,8 @@ int setup_arg_pages(struct linux_binprm *bprm,
|
||||||
#ifdef CONFIG_STACK_GROWSUP
|
#ifdef CONFIG_STACK_GROWSUP
|
||||||
/* Limit stack size */
|
/* Limit stack size */
|
||||||
stack_base = bprm->rlim_stack.rlim_max;
|
stack_base = bprm->rlim_stack.rlim_max;
|
||||||
if (stack_base > STACK_SIZE_MAX)
|
|
||||||
stack_base = STACK_SIZE_MAX;
|
stack_base = calc_max_stack_size(stack_base);
|
||||||
|
|
||||||
/* Add space for stack randomization. */
|
/* Add space for stack randomization. */
|
||||||
stack_base += (STACK_RND_MASK << PAGE_SHIFT);
|
stack_base += (STACK_RND_MASK << PAGE_SHIFT);
|
||||||
|
|
12
mm/Kconfig
12
mm/Kconfig
|
@ -720,19 +720,17 @@ config ZSMALLOC_STAT
|
||||||
config GENERIC_EARLY_IOREMAP
|
config GENERIC_EARLY_IOREMAP
|
||||||
bool
|
bool
|
||||||
|
|
||||||
config MAX_STACK_SIZE_MB
|
config STACK_MAX_DEFAULT_SIZE_MB
|
||||||
int "Maximum user stack size for 32-bit processes (MB)"
|
int "Default maximum user stack size for 32-bit processes (MB)"
|
||||||
default 80
|
default 100
|
||||||
range 8 2048
|
range 8 2048
|
||||||
depends on STACK_GROWSUP && (!64BIT || COMPAT)
|
depends on STACK_GROWSUP && (!64BIT || COMPAT)
|
||||||
help
|
help
|
||||||
This is the maximum stack size in Megabytes in the VM layout of 32-bit
|
This is the maximum stack size in Megabytes in the VM layout of 32-bit
|
||||||
user processes when the stack grows upwards (currently only on parisc
|
user processes when the stack grows upwards (currently only on parisc
|
||||||
arch). The stack will be located at the highest memory address minus
|
arch) when the RLIMIT_STACK hard limit is unlimited.
|
||||||
the given value, unless the RLIMIT_STACK hard limit is changed to a
|
|
||||||
smaller value in which case that is used.
|
|
||||||
|
|
||||||
A sane initial value is 80 MB.
|
A sane initial value is 100 MB.
|
||||||
|
|
||||||
config DEFERRED_STRUCT_PAGE_INIT
|
config DEFERRED_STRUCT_PAGE_INIT
|
||||||
bool "Defer initialisation of struct pages to kthreads"
|
bool "Defer initialisation of struct pages to kthreads"
|
||||||
|
|
Loading…
Reference in a new issue