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

2015-04-01 Thread Brian Gerst
On Wed, Apr 1, 2015 at 6:14 PM, Linus Torvalds wrote: > On Wed, Apr 1, 2015 at 1:52 PM, Denys Vlasenko wrote: >> >> BTW, AMD64 docs do explicitly say that MOVs from segment registers >> to gpregs are zero-extending. > > Yeah, I think anything even *remotely* recent enough to do 64-bit does > zero

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

2015-04-01 Thread Linus Torvalds
On Wed, Apr 1, 2015 at 1:52 PM, Denys Vlasenko wrote: > > BTW, AMD64 docs do explicitly say that MOVs from segment registers > to gpregs are zero-extending. Yeah, I think anything even *remotely* recent enough to do 64-bit does zero-extending. Even on the 32-bit side, anything that does register

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

2015-04-01 Thread H. Peter Anvin
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 >> (pos

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

2015-04-01 Thread Denys Vlasenko
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 instruc

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

2015-04-01 Thread Linus Torvalds
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

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

2015-04-01 Thread Denys Vlasenko
On 04/01/2015 12:21 AM, Brian Gerst wrote: > On Tue, Mar 31, 2015 at 1:00 PM, Denys Vlasenko wrote: >> After TESTs, use logically correct JZ mnemonic instead of JE >> (this doesn't change code). >> >> Tidy up CMPW insns: >> >> Modern CPUs are not good with 16-bit operations. >> The instructions wi

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

2015-04-01 Thread Ingo Molnar
* Denys Vlasenko wrote: > After TESTs, use logically correct JZ mnemonic instead of JE > (this doesn't change code). > > Tidy up CMPW insns: > > Modern CPUs are not good with 16-bit operations. > The instructions with 16-bit immediates are especially bad, > on many CPUs they cause length chang

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

2015-03-31 Thread Linus Torvalds
On Tue, Mar 31, 2015 at 3:21 PM, Brian Gerst wrote: >> >> @@ -708,7 +708,7 @@ END(sysenter_badsys) >> #ifdef CONFIG_X86_ESPFIX32 >> movl %ss, %eax >> /* see if on espfix stack */ >> - cmpw $__ESPFIX_SS, %ax >> + cmpl $__ESPFIX_SS, %eax >> jne 27f >> mov

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

2015-03-31 Thread Brian Gerst
On Tue, Mar 31, 2015 at 1:00 PM, Denys Vlasenko wrote: > After TESTs, use logically correct JZ mnemonic instead of JE > (this doesn't change code). > > Tidy up CMPW insns: > > Modern CPUs are not good with 16-bit operations. > The instructions with 16-bit immediates are especially bad, > on many C

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

2015-03-31 Thread Denys Vlasenko
After TESTs, use logically correct JZ mnemonic instead of JE (this doesn't change code). Tidy up CMPW insns: Modern CPUs are not good with 16-bit operations. The instructions with 16-bit immediates are especially bad, on many CPUs they cause length changing prefix stall in the decoders, costing ~