From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752187AbbCYX5M (ORCPT ); Wed, 25 Mar 2015 19:57:12 -0400 Received: from terminus.zytor.com ([198.137.202.10]:45703 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbbCYX5K (ORCPT ); Wed, 25 Mar 2015 19:57:10 -0400 User-Agent: K-9 Mail for Android In-Reply-To: References: <1427303896-24023-1-git-send-email-dvlasenk@redhat.com> <1427303896-24023-3-git-send-email-dvlasenk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH 3/4] x86/asm/entry/64: use smaller insns From: "H. Peter Anvin" Date: Wed, 25 Mar 2015 16:56:00 -0700 To: Linus Torvalds , Denys Vlasenko CC: Ingo Molnar , Steven Rostedt , Borislav Petkov , Andy Lutomirski , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , the arch/x86 maintainers , Linux Kernel Mailing List Message-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No, movabs is yet another instruction (with a 64-bit absolute address.) But movq can mean 10 or 7 bytes... On March 25, 2015 4:51:50 PM PDT, 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. It's a bit sad that we need to overspecify these >things.. > >If it had actually been a 64-bit constant, the assembler would have >ended up silently using a different instruction encoding *anyway* >("movabs"), so it's not like the "movq" in any way specifies one >particular instruction representation, and the assembler already picks >different instruction versions for different constant values. Why not >this one? > > Linus -- Sent from my mobile phone. Please pardon brevity and lack of formatting.