From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752527AbbCZJbA (ORCPT ); Thu, 26 Mar 2015 05:31:00 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:32861 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752013AbbCZJa6 (ORCPT ); Thu, 26 Mar 2015 05:30:58 -0400 Date: Thu, 26 Mar 2015 10:30:53 +0100 From: Ingo Molnar To: Linus Torvalds Cc: Denys Vlasenko , Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: [PATCH 3/4] x86/asm/entry/64: use smaller insns Message-ID: <20150326093053.GB14706@gmail.com> References: <1427303896-24023-1-git-send-email-dvlasenk@redhat.com> <1427303896-24023-3-git-send-email-dvlasenk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 * Linus Torvalds wrote: > On Wed, Mar 25, 2015 at 10:18 AM, Denys Vlasenko wrote: > > The $AUDIT_ARCH_X86_64 parameter to syscall_trace_enter_phase1/2 > > is a 32-bit constant, loading it with 32-bit MOV produces 5-byte insn > > instead of 10-byte one. > > Side note: has anybody talked to the assembler people? This would > seem to be very much something that the assembler could have noticed > and done on its own. [...] Maybe GCC already picks a 32-bit opcode in these small-constant cases, so there was little incentive to optimize on the GAS side, other than making it correct. > [...] It's a bit sad that we need to overspecify these things.. Yeah, that's sad. Yesterday when I have read Denys's patch I double checked that there's no other similar (easily identifiable ...) movq opcode left in the 64-bit entry code, so we seem to have squashed most of them. Thanks, Ingo