Re: [PATCH 2/2] x86/asm/entry/32: Open-code LOAD_ARGS32. No code changes.

From: Borislav Petkov
Date: Tue Jun 02 2015 - 15:27:51 EST


On Tue, Jun 02, 2015 at 09:04:02PM +0200, Denys Vlasenko wrote:
> This macro is small, has only three callsites, and one of them is
> slightly different using a conditional parameter.
>
> A few saved lines aren't worth the resulting obfuscation.
>
> Generated machine code is identical.
>
> Signed-off-by: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
> CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> CC: Steven Rostedt <rostedt@xxxxxxxxxxx>
> CC: Ingo Molnar <mingo@xxxxxxxxxx>
> CC: Borislav Petkov <bp@xxxxxxxxx>
> CC: "H. Peter Anvin" <hpa@xxxxxxxxx>
> CC: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
> CC: Oleg Nesterov <oleg@xxxxxxxxxx>
> CC: Frederic Weisbecker <fweisbec@xxxxxxxxx>
> CC: Alexei Starovoitov <ast@xxxxxxxxxxxx>
> CC: Will Drewry <wad@xxxxxxxxxxxx>
> CC: Kees Cook <keescook@xxxxxxxxxxxx>
> CC: x86@xxxxxxxxxx
> CC: linux-kernel@xxxxxxxxxxxxxxx
> ---
> arch/x86/ia32/ia32entry.S | 62 ++++++++++++++++++++++++++++-------------------
> 1 file changed, 37 insertions(+), 25 deletions(-)
>
> diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
> index 86cbfe6..0ff676a 100644
> --- a/arch/x86/ia32/ia32entry.S
> +++ b/arch/x86/ia32/ia32entry.S
> @@ -29,28 +29,6 @@
>
> .section .entry.text, "ax"
>
> - /*
> - * Reload arg registers from stack in case ptrace changed them.
> - * We don't reload %eax because syscall_trace_enter() returned
> - * the %rax value we should see. Instead, we just truncate that
> - * value to 32 bits again as we did on entry from user mode.
> - * If it's a new value set by user_regset during entry tracing,
> - * this matches the normal truncation of the user-mode value.
> - * If it's -1 to make us punt the syscall, then (u32)-1 is still
> - * an appropriately invalid value.

Can't say that I'm crazy about the replication of (a shorter version of)
that comment three times though.

The macro is in the same file so looking it up is trivial. So what's the
point?

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/