Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752507AbbDAU5u (ORCPT ); Wed, 1 Apr 2015 16:57:50 -0400 Received: from terminus.zytor.com ([198.137.202.10]:52023 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751566AbbDAU5t (ORCPT ); Wed, 1 Apr 2015 16:57:49 -0400 Message-ID: <551C5BA5.9010407@zytor.com> Date: Wed, 01 Apr 2015 13:57:09 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Denys Vlasenko , Linus Torvalds CC: Brian Gerst , 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 Subject: Re: [PATCH 7/9] x86/asm/entry/32: tidy up some instructions References: <1427821211-25099-1-git-send-email-dvlasenk@redhat.com> <1427821211-25099-7-git-send-email-dvlasenk@redhat.com> <551BD241.4060207@redhat.com> <551C5A73.3050109@redhat.com> In-Reply-To: <551C5A73.3050109@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1332 Lines: 33 On 04/01/2015 01:52 PM, Denys Vlasenko wrote: > On 04/01/2015 05:50 PM, Linus Torvalds wrote: >> On Wed, Apr 1, 2015 at 4:10 AM, Denys Vlasenko wrote: >>> >>> I did not know that. I was sure they are always zero extended. >> >> On all half-way modern cpu's they are. But on some older cpu's >> (possibly just the original 386) the segment move instructions >> basically are always 16-bit, and the operand size is ignored (so the >> 32-bit version is just smaller and faster to decode, because it >> doesn't have a 16-bit operand size prefix) >> >> Iirc, the same is true for the values pushed to memory on exceptions, >> so the 'cs/ss' values on the exception stack may not be reliable in >> the upper 16 bits. >> >> I don't remember if the same might be true of "pushl %Sseg". The intel >> architecture manual says segment registers are zero-extended on push. > > BTW, AMD64 docs do explicitly say that MOVs from segment registers > to gpregs are zero-extending. > For Intel processors it is true for Pentium Pro and later processors, as far as I know. -hpa -- 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/