Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss
From: Ingo Molnar
Date: Wed Mar 25 2015 - 05:28:57 EST
* Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote:
> Now we can do a fun hack on top. On Intel, we have
> sysenter/sysexitl and, on AMD, we have syscall/sysretl. But, if I
> read the docs right, Intel has sysretl, too. So we can ditch
> sysexit entirely, since this mechanism no longer has any need to
> keep the entry and exit conventions matching.
So this only affects 32-bit vdsos, because on 64-bit both Intel and
AMD have and use SYSCALL/SYSRET.
So my question would be: what's the performance difference between
INT80 and sysenter entries on 32-bit, on modern CPUs?
If it's not too horrible (say below 100 cycles) then we could say that
we start out the simplification and robustification by switching Intel
over to INT80 + SYSRET on 32-bit, and once we know the 32-bit SYSRET
and all the other simplifications work fine we implement the
SYSENTER-hack on top of that?
Is there any user-space code that relies on being able to execute an
open coded SYSENTER, or are we shielded via the vDSO?
Doing it this way would make it a lot more practical to pull off, as
the incentive to implement the SYSENTER hack on Intel CPUs will be
significant: dozens of cycles on 32-bit. Also, I have no problem with
putting some pressure on Intel developers, for the absolutely
indefensible horror interface that SYSENTER turned out to be! ;-)
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/