Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753538AbcCLPpP (ORCPT ); Sat, 12 Mar 2016 10:45:15 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34856 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752694AbcCLPpH (ORCPT ); Sat, 12 Mar 2016 10:45:07 -0500 Date: Sat, 12 Mar 2016 16:45:02 +0100 From: Ingo Molnar To: Denys Vlasenko Cc: Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Frederic Weisbecker , Will Drewry , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs Message-ID: <20160312154502.GD17873@gmail.com> References: <1457715214-7432-1-git-send-email-dvlasenk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457715214-7432-1-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 Content-Length: 892 Lines: 27 * Denys Vlasenko wrote: > Use of a temporary R8 register here seems to be unnecessary. > > "push %r8" is a two-byte insn (it needs REX prefix to specify R8), > "push $0" is two-byte too. It seems just using the latter would be > no worse. > > Thus, code had an unnecessary "xorq %r8,%r8" insn. > It probably costs nothing in execution time here since we are probably > limited by store bandwidth at this point, but still. Note that the 3 fewer instruction in the image also shrink the code by 16 bytes: arch/x86/entry/entry_64_compat.o: text data bss dec hex filename 380 0 0 380 17c entry_64_compat.o.before 364 0 0 364 16c entry_64_compat.o.after because (at least in this defconfig build) one of these functions shrunk below a 16-byte boundary. So cache footprint got denser. Thanks, Ingo