From: Oleg Nesterov <oleg@redhat.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
Will Drewry <wad@chromium.org>,
x86@kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mips@linux-mips.org, linux-arch@vger.kernel.org,
linux-security-module@vger.kernel.org,
Alexei Starovoitov <ast@plumgrid.com>,
hpa@zytor.com, Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH v4 0/5] x86: two-phase syscall tracing and seccomp fastpath
Date: Tue, 29 Jul 2014 21:20:56 +0200 [thread overview]
Message-ID: <20140729192056.GA6308@redhat.com> (raw)
In-Reply-To: <cover.1406604806.git.luto@amacapital.net>
Andy, to avoid the confusion: I am not trying to review this changes.
As you probably know my understanding of asm code in entry.S is very
limited.
Just a couple of questions to ensure I understand this correctly.
On 07/28, Andy Lutomirski wrote:
>
> This is both a cleanup and a speedup. It reduces overhead due to
> installing a trivial seccomp filter by 87%. The speedup comes from
> avoiding the full syscall tracing mechanism for filters that don't
> return SECCOMP_RET_TRACE.
And only after I look at 5/5 I _seem_ to actually understand where
this speedup comes from.
So. Currently tracesys: path always lead to "iret" after syscall, with
this change we can avoid it if phase_1() returns zero, correct?
And, this also removes the special TIF_SYSCALL_AUDIT-only case in entry.S,
cool.
I am wondering if we can do something similar with do_notify_resume() ?
Stupid question. To simplify, lets forget that syscall_trace_enter()
already returns the value. Can't we simplify the asm code if we do
not export 2 functions, but make syscall_trace_enter() return
"bool slow_path_is_needed". So that "tracesys:" could do
// pseudo code
tracesys:
SAVE_REST
FIXUP_TOP_OF_STACK
call syscall_trace_enter
if (!slow_path_is_needed) {
addq REST_SKIP, %rsp
jmp system_call_fastpath
}
...
?
Once again, I am just curious, it is not that I actually suggest to consider
this option.
Oleg.
WARNING: multiple messages have this Message-ID (diff)
From: oleg@redhat.com (Oleg Nesterov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 0/5] x86: two-phase syscall tracing and seccomp fastpath
Date: Tue, 29 Jul 2014 21:20:56 +0200 [thread overview]
Message-ID: <20140729192056.GA6308@redhat.com> (raw)
In-Reply-To: <cover.1406604806.git.luto@amacapital.net>
Andy, to avoid the confusion: I am not trying to review this changes.
As you probably know my understanding of asm code in entry.S is very
limited.
Just a couple of questions to ensure I understand this correctly.
On 07/28, Andy Lutomirski wrote:
>
> This is both a cleanup and a speedup. It reduces overhead due to
> installing a trivial seccomp filter by 87%. The speedup comes from
> avoiding the full syscall tracing mechanism for filters that don't
> return SECCOMP_RET_TRACE.
And only after I look at 5/5 I _seem_ to actually understand where
this speedup comes from.
So. Currently tracesys: path always lead to "iret" after syscall, with
this change we can avoid it if phase_1() returns zero, correct?
And, this also removes the special TIF_SYSCALL_AUDIT-only case in entry.S,
cool.
I am wondering if we can do something similar with do_notify_resume() ?
Stupid question. To simplify, lets forget that syscall_trace_enter()
already returns the value. Can't we simplify the asm code if we do
not export 2 functions, but make syscall_trace_enter() return
"bool slow_path_is_needed". So that "tracesys:" could do
// pseudo code
tracesys:
SAVE_REST
FIXUP_TOP_OF_STACK
call syscall_trace_enter
if (!slow_path_is_needed) {
addq REST_SKIP, %rsp
jmp system_call_fastpath
}
...
?
Once again, I am just curious, it is not that I actually suggest to consider
this option.
Oleg.
next prev parent reply other threads:[~2014-07-29 19:20 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-29 3:38 [PATCH v4 0/5] x86: two-phase syscall tracing and seccomp fastpath Andy Lutomirski
2014-07-29 3:38 ` Andy Lutomirski
2014-07-29 3:38 ` [PATCH v4 1/5] x86,x32,audit: Fix x32's AUDIT_ARCH wrt audit Andy Lutomirski
2014-07-29 3:38 ` Andy Lutomirski
2014-07-29 3:38 ` [PATCH v4 2/5] x86,entry: Only call user_exit if TIF_NOHZ Andy Lutomirski
2014-07-29 3:38 ` Andy Lutomirski
2014-07-29 19:32 ` Oleg Nesterov
2014-07-29 19:32 ` Oleg Nesterov
2014-07-30 16:43 ` Frederic Weisbecker
2014-07-30 16:43 ` Frederic Weisbecker
2014-07-30 17:23 ` Andy Lutomirski
2014-07-30 17:23 ` Andy Lutomirski
2014-07-31 15:16 ` Frederic Weisbecker
2014-07-31 15:16 ` Frederic Weisbecker
2014-07-31 16:42 ` Oleg Nesterov
2014-07-31 16:42 ` Oleg Nesterov
2014-07-31 16:49 ` Frederic Weisbecker
2014-07-31 16:49 ` Frederic Weisbecker
2014-07-31 16:54 ` Oleg Nesterov
2014-07-31 16:54 ` Oleg Nesterov
2014-07-31 16:58 ` Oleg Nesterov
2014-07-31 16:58 ` Oleg Nesterov
2014-07-31 17:17 ` Frederic Weisbecker
2014-07-31 17:17 ` Frederic Weisbecker
2014-07-29 3:38 ` [PATCH v4 3/5] x86: Split syscall_trace_enter into two phases Andy Lutomirski
2014-07-29 3:38 ` Andy Lutomirski
2014-07-29 19:25 ` Oleg Nesterov
2014-07-29 19:25 ` Oleg Nesterov
2014-07-29 3:38 ` [PATCH v4 4/5] x86_64,entry: Treat regs->ax the same in fastpath and slowpath syscalls Andy Lutomirski
2014-07-29 3:38 ` [PATCH v4 4/5] x86_64, entry: " Andy Lutomirski
2014-07-29 3:38 ` [PATCH v4 5/5] x86_64,entry: Use split-phase syscall_trace_enter for 64-bit syscalls Andy Lutomirski
2014-07-29 3:38 ` [PATCH v4 5/5] x86_64, entry: " Andy Lutomirski
2014-07-29 19:20 ` Oleg Nesterov [this message]
2014-07-29 19:20 ` [PATCH v4 0/5] x86: two-phase syscall tracing and seccomp fastpath Oleg Nesterov
2014-07-29 20:54 ` Andy Lutomirski
2014-07-29 20:54 ` Andy Lutomirski
2014-07-29 23:30 ` Andy Lutomirski
2014-07-29 23:30 ` Andy Lutomirski
2014-07-30 15:32 ` Oleg Nesterov
2014-07-30 15:32 ` Oleg Nesterov
2014-07-30 16:59 ` Frederic Weisbecker
2014-07-30 16:59 ` Frederic Weisbecker
2014-07-30 17:25 ` Andy Lutomirski
2014-07-30 17:25 ` Andy Lutomirski
2014-07-31 16:56 ` H. Peter Anvin
2014-07-31 16:56 ` H. Peter Anvin
2014-07-31 17:20 ` Frederic Weisbecker
2014-07-31 17:20 ` Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140729192056.GA6308@redhat.com \
--to=oleg@redhat.com \
--cc=ast@plumgrid.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-security-module@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=wad@chromium.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.