From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752153AbbCYJ2y (ORCPT ); Wed, 25 Mar 2015 05:28:54 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:35922 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbbCYJ2u (ORCPT ); Wed, 25 Mar 2015 05:28:50 -0400 Date: Wed, 25 Mar 2015 10:28:45 +0100 From: Ingo Molnar To: Andy Lutomirski Cc: Denys Vlasenko , Brian Gerst , Denys Vlasenko , Linus Torvalds , Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , X86 ML , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss Message-ID: <20150325092845.GA1809@gmail.com> References: <1427129240-15543-1-git-send-email-dvlasenk@redhat.com> <20150324063430.GB26302@gmail.com> <55116FC1.1020400@redhat.com> <5511C641.7000700@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski 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