Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161082AbbENRFQ (ORCPT ); Thu, 14 May 2015 13:05:16 -0400 Received: from mail-ig0-f174.google.com ([209.85.213.174]:36996 "EHLO mail-ig0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932698AbbENRFL (ORCPT ); Thu, 14 May 2015 13:05:11 -0400 MIME-Version: 1.0 In-Reply-To: <1431622519-19718-1-git-send-email-dvlasenk@redhat.com> References: <1431622519-19718-1-git-send-email-dvlasenk@redhat.com> Date: Thu, 14 May 2015 10:05:11 -0700 X-Google-Sender-Auth: VE7NkR6KjTmTF8AD6JGLYOjIvBg Message-ID: Subject: Re: [PATCH] x86/asm/entry/64: Use shorter MOVs from segmers registers From: Linus Torvalds To: Denys Vlasenko Cc: Ingo Molnar , 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 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 896 Lines: 19 On Thu, May 14, 2015 at 9:55 AM, Denys Vlasenko wrote: > "movw %ds,%cx" insn needs a 0x66 prefix, while "movw %ds,%ecx" does not. > The difference is that it overwrite entire %ecx, not only its low half, > but subsequent code doesn't depend on the value of top half of %ecx, > we can safely use the shorter insn. I don't object to the patch, but did we actually confirm that it always overwrites all of %ecx? The segment move instructions are schizofrenic when it comes to sizes, and sometimes write just 16 bits even when the instruction size is 32. Was that just for push and/or move-to-memory? Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/