Re: [PATCH] x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue

Linus Torvalds
2015-04-27T15:06:19Z

On Mon, Apr 27, 2015 at 7:57 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> ..end result is just six bytes. That way you can use alternative to
> replace it with one single noop on AMD.

Actually, it looks like we have no good 6-byte no-ops on AMD. So you'd
get two three-byte ones. Oh well. It's still better than five nops
that can't even be decoded all at once.

That said, our NOP tables look to be old for AMD. Looking at the AMD
optimization guide (family 16h), it says to use

66 0F 1F 44 00 00

which seems to be the same as Intel (it's "nopw 0x0(%rax,%rax,1)").

So maybe our AMD nop tables should be updated?

Linus