diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-11-09 18:16:48 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-11-09 18:16:48 +0300 |
commit | 88f93de1de0c4633332631eb148bc36e8e8eb28f (patch) | |
tree | 2d31bc12c83f810dafc4e1e1c0b3eb0a24b47722 /arch/x86/include/asm/compat.h | |
parent | 29701d69b98d0a132abd63fe2e51125f478fbc53 (diff) | |
parent | c8d5ed67936fddbe2ae845fc80397718006322d7 (diff) | |
download | linux-88f93de1de0c4633332631eb148bc36e8e8eb28f.tar.xz |
Merge branch 'x86/entry' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into tif-task_work.arch
* 'x86/entry' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86: Wire up TIF_NOTIFY_SIGNAL
x86: Reclaim TIF_IA32 and TIF_X32
x86/mm: Convert mmu context ia32_compat into a proper flags field
x86/elf: Use e_machine to check for x32/ia32 in setup_additional_pages()
elf: Expose ELF header on arch_setup_additional_pages()
x86/elf: Use e_machine to select start_thread for x32
elf: Expose ELF header in compat_start_thread()
x86/elf: Use e_machine to choose DLINFO in compat
x86/oprofile: Avoid TIF_IA32 when checking 64bit mode
x86/compat: Simplify compat syscall userspace allocation
perf/x86: Avoid TIF_IA32 when checking 64bit mode
Diffstat (limited to 'arch/x86/include/asm/compat.h')
-rw-r--r-- | arch/x86/include/asm/compat.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h index 0e327a01f50f..f145e3326c6d 100644 --- a/arch/x86/include/asm/compat.h +++ b/arch/x86/include/asm/compat.h @@ -177,14 +177,13 @@ typedef struct user_regs_struct compat_elf_gregset_t; static inline void __user *arch_compat_alloc_user_space(long len) { - compat_uptr_t sp; - - if (test_thread_flag(TIF_IA32)) { - sp = task_pt_regs(current)->sp; - } else { - /* -128 for the x32 ABI redzone */ - sp = task_pt_regs(current)->sp - 128; - } + compat_uptr_t sp = task_pt_regs(current)->sp; + + /* + * -128 for the x32 ABI redzone. For IA32, it is not strictly + * necessary, but not harmful. + */ + sp -= 128; return (void __user *)round_down(sp - len, 16); } |