Re: [RFC/HACK] x86: Fast return to kernel

From: H. Peter Anvin
Date: Sun May 04 2014 - 19:49:17 EST


On 05/04/2014 04:46 PM, Paolo Bonzini wrote:
>
> Your suggested trick of splitting the return paths for IF=0/IF=1 can be
> also done like this:
>
> movq EFLAGS-ARGOFFSET(%rsp), %rdi
> btrq $9, %rdi # Clear IF, save old value in CF
> movq %rdi, (%rsi)
> ...
> popfq
> jnc 1f # If IF was 0, just return
> sti # Using STI gets us an interrupt shadow
> 1f:
> retq
>

That doesn't work, because CF gets restored by the popfq as well.
Unfortunately.

-hpa


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