Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41abc902 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull Metag architecture and related fixes from James Hogan:
 "Mostly fixes for metag and parisc relating to upgrowing stacks.

   - Fix missing compiler barriers in metag memory barriers.
   - Fix BUG_ON on metag when RLIMIT_STACK hard limit is increased
     beyond safe value.
   - Make maximum stack size configurable.  This reduces the default
     user stack size back to 80MB (especially on parisc after their
     removal of _STK_LIM_MAX override).  This only affects metag and
     parisc.
   - Remove metag _STK_LIM_MAX override to match other arches and follow
     parisc, now that it is safe to do so (due to the BUG_ON fix
     mentioned above).
   - Finally now that both metag and parisc _STK_LIM_MAX overrides have
     been removed, it makes sense to remove _STK_LIM_MAX altogether"

* tag 'metag-for-v3.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag:
  asm-generic: remove _STK_LIM_MAX
  metag: Remove _STK_LIM_MAX override
  parisc,metag: Do not hardcode maximum userspace stack size
  metag: Reduce maximum stack size to 256MB
  metag: fix memory barriers
parents a7b08063 ffe6902b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ static inline void wr_fence(void)
	volatile int *flushptr = (volatile int *) LINSYSEVENT_WR_FENCE;
	barrier();
	*flushptr = 0;
	barrier();
}

#else /* CONFIG_METAG_META21 */
@@ -35,6 +36,7 @@ static inline void wr_fence(void)
	*flushptr = 0;
	*flushptr = 0;
	*flushptr = 0;
	barrier();
}

#endif /* !CONFIG_METAG_META21 */
@@ -68,6 +70,7 @@ static inline void fence(void)
	volatile int *flushptr = (volatile int *) LINSYSEVENT_WR_ATOMIC_UNLOCK;
	barrier();
	*flushptr = 0;
	barrier();
}
#define smp_mb()        fence()
#define smp_rmb()       fence()
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
/* Add an extra page of padding at the top of the stack for the guard page. */
#define STACK_TOP	(TASK_SIZE - PAGE_SIZE)
#define STACK_TOP_MAX	STACK_TOP
/* Maximum virtual space for stack */
#define STACK_SIZE_MAX	(CONFIG_MAX_STACK_SIZE_MB*1024*1024)

/* This decides where the kernel will search for a free chunk of vm
 * space during mmap's.
+1 −1
Original line number Diff line number Diff line
@@ -4,11 +4,11 @@ include include/uapi/asm-generic/Kbuild.asm
header-y += byteorder.h
header-y += ech.h
header-y += ptrace.h
header-y += resource.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += swab.h
header-y += unistd.h

generic-y += mman.h
generic-y += resource.h
generic-y += setup.h
+0 −7
Original line number Diff line number Diff line
#ifndef _UAPI_METAG_RESOURCE_H
#define _UAPI_METAG_RESOURCE_H

#define _STK_LIM_MAX    (1 << 28)
#include <asm-generic/resource.h>

#endif /* _UAPI_METAG_RESOURCE_H */
+5 −0
Original line number Diff line number Diff line
@@ -55,6 +55,11 @@
#define STACK_TOP	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

#ifndef __ASSEMBLY__
Loading