Re: [PATCH] x86/asm/entry/64: better check for canonical address
From: Ingo Molnar
Date: Tue Mar 31 2015 - 12:43:47 EST
* Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx> wrote:
> > I guess they could optimize it by adding a single "I am a modern
> > OS executing regular userspace" flag to the descriptor [or
> > expressing the same as a separate instruction], to avoid all that
> > legacy crap that won't trigger on like 99.999999% of systems ...
>
> Yes, that would be a useful addition. Interrupt servicing on x86
> takes a non-negligible hit because of IRET slowness.
But ... to react to your other patch: detecting the common easy case
and doing a POPF+RET ourselves ought to be pretty good as well?
But only if ptregs->rip != the magic RET itself, to avoid recursion.
Even with all those extra checks it should still be much faster.
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/