Re: [PATCH 15/16] x86: entry.S: simplify optimistic SYSRET

From: Ingo Molnar
Date: Wed Mar 04 2015 - 16:41:05 EST



* Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote:

> From: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
>
> Avoid redundant load of %r11 (it is already loaded a few instructions before).

Note, this comment is incorrect:

> Do not needlessly increment %rsp - we are going to return to
> userspace via SYSRET, this insn doesn't use stack for return.

The reason we don't need to increment %rsp because in the very next
instruction we are restoring it, and then do we execute a SYSRET:

So instead of:

add $0x80, %rsp
mov 0x18(%rsp), %rsp

we can do a simplified:

mov 0x98(%rsp), %rsp

to get the same result.

(I've clarified the changelog with this when applying the patch.)

Thanks,

Ingo
--
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/