]> git.baikalelectronics.ru Git - kernel.git/commit
x86/asm/entry/32: Update -ENOSYS handling to match the 64-bit logic
authorDenys Vlasenko <dvlasenk@redhat.com>
Tue, 21 Apr 2015 16:03:14 +0000 (18:03 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 22 Apr 2015 06:41:44 +0000 (08:41 +0200)
commit5ff35f2da5e33ce2174ea0c2687ee561e65501ae
treebf035adb1bd34c0eb90744529e748720204b4c4f
parentb7606ce90bad0d5240643d4e72ab19bd34b22a87
x86/asm/entry/32: Update -ENOSYS handling to match the 64-bit logic

Recently Andy changed the 64-bit syscall logic so that
pt_regs->ax is initially set to -ENOSYS, and on syscall exit,
it is updated with the actual return value. This simplified
the logic there.

This patch does the same for 32-bit syscall entry points.

The check for %rax being too big is moved to be just before
the call instruction which dispatches execution through the
syscall table.

There is no way to accidentally skip this check now by jumping
to a label after it. This allows us to remove redundant checks
after ptrace et al.

If %rax is too big, we just skip over the (call, write %rax to
pt_regs->ax) instruction pair. pt_regs->ax remains set to -ENOSYS,
and it gets returned to userspace.

Similar to 64-bit code, this eliminates the "ia32_badsys" code path.

Run-tested.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Will Drewry <wad@chromium.org>
Link: http://lkml.kernel.org/r/1429632194-13445-2-git-send-email-dvlasenk@redhat.com
[ Changelog massage. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/ia32/ia32entry.S