From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751942AbbFBT1s (ORCPT ); Tue, 2 Jun 2015 15:27:48 -0400 Received: from mail.skyhub.de ([78.46.96.112]:46617 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750977AbbFBT1l (ORCPT ); Tue, 2 Jun 2015 15:27:41 -0400 Date: Tue, 2 Jun 2015 21:27:32 +0200 From: Borislav Petkov To: Denys Vlasenko Cc: Ingo Molnar , Linus Torvalds , Steven Rostedt , "H. Peter Anvin" , Andy Lutomirski , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] x86/asm/entry/32: Open-code LOAD_ARGS32. No code changes. Message-ID: <20150602192732.GF19887@pd.tnic> References: <1433271842-9139-1-git-send-email-dvlasenk@redhat.com> <1433271842-9139-2-git-send-email-dvlasenk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1433271842-9139-2-git-send-email-dvlasenk@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > CC: Linus Torvalds > CC: Steven Rostedt > CC: Ingo Molnar > CC: Borislav Petkov > CC: "H. Peter Anvin" > CC: Andy Lutomirski > CC: Oleg Nesterov > CC: Frederic Weisbecker > CC: Alexei Starovoitov > CC: Will Drewry > CC: Kees Cook > CC: x86@kernel.org > CC: linux-kernel@vger.kernel.org > --- > 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. --