Re: [PATCH 7/9] x86/asm/entry/32: tidy up some instructions

From: Linus Torvalds
Date: Wed Apr 01 2015 - 11:50:11 EST


On Wed, Apr 1, 2015 at 4:10 AM, Denys Vlasenko <dvlasenk@xxxxxxxxxx> 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.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/