Commit c7ea591c authored by Al Viro's avatar Al Viro Committed by Richard Weinberger

um: increase stack growth cushion in pagefault

analog of [PATCH] i386: let usermode execute the "enter" instruction from
circa 2006.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 3579a389
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
# include "processor_64.h" # include "processor_64.h"
#endif #endif
#define ARCH_IS_STACKGROW(address) \
(address + 65536 + 32 * sizeof(unsigned long) >= UPT_SP(&current->thread.regs.regs))
#include <asm/processor-generic.h> #include <asm/processor-generic.h>
#endif #endif
...@@ -63,9 +63,6 @@ static inline void rep_nop(void) ...@@ -63,9 +63,6 @@ static inline void rep_nop(void)
#define current_text_addr() \ #define current_text_addr() \
({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; }) ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })
#define ARCH_IS_STACKGROW(address) \
(address + 32 >= UPT_SP(&current->thread.regs.regs))
#define KSTK_EIP(tsk) KSTK_REG(tsk, EIP) #define KSTK_EIP(tsk) KSTK_REG(tsk, EIP)
#define KSTK_ESP(tsk) KSTK_REG(tsk, UESP) #define KSTK_ESP(tsk) KSTK_REG(tsk, UESP)
#define KSTK_EBP(tsk) KSTK_REG(tsk, EBP) #define KSTK_EBP(tsk) KSTK_REG(tsk, EBP)
......
...@@ -42,9 +42,6 @@ static inline void arch_copy_thread(struct arch_thread *from, ...@@ -42,9 +42,6 @@ static inline void arch_copy_thread(struct arch_thread *from,
#define current_text_addr() \ #define current_text_addr() \
({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
#define ARCH_IS_STACKGROW(address) \
(address + 128 >= UPT_SP(&current->thread.regs.regs))
#define KSTK_EIP(tsk) KSTK_REG(tsk, RIP) #define KSTK_EIP(tsk) KSTK_REG(tsk, RIP)
#define KSTK_ESP(tsk) KSTK_REG(tsk, RSP) #define KSTK_ESP(tsk) KSTK_REG(tsk, RSP)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment