From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753095Ab1HVOlF (ORCPT ); Mon, 22 Aug 2011 10:41:05 -0400 Received: from s15228384.onlinehome-server.info ([87.106.30.177]:56514 "EHLO mail.x86-64.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426Ab1HVOlD (ORCPT ); Mon, 22 Aug 2011 10:41:03 -0400 Date: Mon, 22 Aug 2011 16:40:51 +0200 From: Borislav Petkov To: Andrew Lutomirski Cc: Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , "user-mode-linux-devel@lists.sourceforge.net" , Richard Weinberger , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , Al Viro , Linus Torvalds Subject: Re: [uml-devel] SYSCALL, ptrace and syscall restart breakages (Re: [RFC] weird crap with vdso on uml/i386) Message-ID: <20110822144051.GD2946@aftab> References: <20110822011645.GM2203@ZenIV.linux.org.uk> <4E51B56F.3080301@zytor.com> <20110822020737.GP2203@ZenIV.linux.org.uk> <4E51D597.3060800@zytor.com> <20110822095336.GB25949@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 22, 2011 at 09:34:27AM -0400, Andrew Lutomirski wrote: > On Mon, Aug 22, 2011 at 5:53 AM, Ingo Molnar wrote: > > > > * H. Peter Anvin wrote: > > > >> Borislav, > >> > >> We're tracking down an issue with the way system call arguments are > >> handled on 32 bits.  We have a solution for SYSENTER but not > >> SYSCALL; fixing SYSCALL "properly" appears to be very difficult at > >> best. > >> > >> So the question is: how much overhead would it be to simply fall > >> back to int $0x80 or some other legacy-style domain crossing > >> instruction for 32-bit system calls on AMD64 processors?  We don't > >> ever use SYSCALL in legacy mode, so native i386 kernels are > >> unaffected. > > > > Last i measured INT80 and SYSCALL costs they were pretty close to > > each other on AMD CPUs - closer than on Intel. > > From memory, SYSCALL in 64-bit mode on Sandy Bridge is much faster > than int 0xcc, which is presumably about the same speed as int 0x80. > That's because SYSCALL is blazingly fast (<30 ns for a whole system > call) and int is slower. Just to make sure I'm grokking this correctly - we want to use int $0x80 only for the SYSCALL variant in __kernel_vsyscall, right? Not for all 32-bit syscalls on a 64-bit kernel. Thanks. -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 22 Aug 2011 16:40:51 +0200 From: Borislav Petkov Message-ID: <20110822144051.GD2946@aftab> References: <20110822011645.GM2203@ZenIV.linux.org.uk> <4E51B56F.3080301@zytor.com> <20110822020737.GP2203@ZenIV.linux.org.uk> <4E51D597.3060800@zytor.com> <20110822095336.GB25949@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: QUOTED-PRINTABLE In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Subject: Re: [uml-devel] SYSCALL, ptrace and syscall restart breakages (Re: [RFC] weird crap with vdso on uml/i386) To: Andrew Lutomirski Cc: Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , "user-mode-linux-devel@lists.sourceforge.net" , Richard Weinberger , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , Al Viro , Linus Torvalds List-ID: On Mon, Aug 22, 2011 at 09:34:27AM -0400, Andrew Lutomirski wrote: > On Mon, Aug 22, 2011 at 5:53 AM, Ingo Molnar wrote= : > > > > * H. Peter Anvin wrote: > > > >> Borislav, > >> > >> We're tracking down an issue with the way system call arguments ar= e > >> handled on 32 bits. =A0We have a solution for SYSENTER but not > >> SYSCALL; fixing SYSCALL "properly" appears to be very difficult at > >> best. > >> > >> So the question is: how much overhead would it be to simply fall > >> back to int $0x80 or some other legacy-style domain crossing > >> instruction for 32-bit system calls on AMD64 processors? =A0We don= 't > >> ever use SYSCALL in legacy mode, so native i386 kernels are > >> unaffected. > > > > Last i measured INT80 and SYSCALL costs they were pretty close to > > each other on AMD CPUs - closer than on Intel. >=20 > From memory, SYSCALL in 64-bit mode on Sandy Bridge is much faster > than int 0xcc, which is presumably about the same speed as int 0x80. > That's because SYSCALL is blazingly fast (<30 ns for a whole system > call) and int is slower. Just to make sure I'm grokking this correctly - we want to use int $0x8= 0 only for the SYSCALL variant in __kernel_vsyscall, right? Not for all 32-bit syscalls on a 64-bit kernel. Thanks. --=20 Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel"= in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/