Re: [PATCH] Runtime memory barrier patching

From: Linus Torvalds (torvalds@transmeta.com)
Date: Mon Apr 21 2003 - 16:04:48 EST


On Mon, 21 Apr 2003, Andi Kleen wrote:
>
> Ok fixed. I used the recommendations from the Hammer optimization
> manual, will hopefully work for Intel too.

They may _work_ for intel, but quite frankly they suck for most Intel (and
probably non-intel too) CPU's. Using prefixes tends to almost always mess
up the instruction decoders on most CPU's out there.

I _think_ most Intel chips have one generic decoder (which knows about
prefixes etc), and the rest only handle simple instructions.

Intel has some preferred sequence that I'd much rather use by default,
although we can obviously use a CONFIG_xxx option to switch between these
sequences.

I forget what the intel sequence is, but I think the multi-byte opcodes
are something like "lea 0(%esi),%esi" rather than adding operand size
prefixes to the nop.

Does anybody have the preferred Intel sequence somewhere?

                        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/



This archive was generated by hypermail 2b29 : Wed Apr 23 2003 - 22:00:30 EST