Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752454AbcCGIWl (ORCPT ); Mon, 7 Mar 2016 03:22:41 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35780 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412AbcCGIWd (ORCPT ); Mon, 7 Mar 2016 03:22:33 -0500 Date: Mon, 7 Mar 2016 09:22:28 +0100 From: Ingo Molnar To: Andy Lutomirski Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Oleg Nesterov , Andrew Cooper , Brian Gerst , Linus Torvalds , Andrew Morton , Peter Zijlstra , Thomas Gleixner , "H. Peter Anvin" Subject: Re: [PATCH] x86/entry: Improve system call entry comments Message-ID: <20160307082228.GA11026@gmail.com> References: <3cc149b4ce9a108a092d816c5158808c62c557f0.1457285880.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3cc149b4ce9a108a092d816c5158808c62c557f0.1457285880.git.luto@kernel.org> 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 Content-Length: 1811 Lines: 55 * Andy Lutomirski wrote: > Ingo suggested that the comments should explain when the various > entries are used. This adds these explanations and improves other > parts of the comments. Thanks for doing this, this is really useful! One very small detail I noticed: > +/* > + * 32-bit legacy system call entry. > + * > + * 32-bit x86 Linux system calls traditionally used the INT $0x80 > + * instruction. INT $0x80 lands here. > + * > + * This entry point can be used by 32-bit and 64-bit programs to perform > + * 32-bit system calls. Instances of INT $0x80 can be found inline in > + * various programs and libraries. It is also used by the vDSO's > + * __kernel_vsyscall fallback for hardware that doesn't support a faster > + * entry method. Restarted 32-bit system calls also fall back to INT > + * $0x80 regardless of what instruction was originally used to do the > + * system call. > + * > + * This is considered a slow path. It is not used by modern libc > + * implementations on modern hardware except during process startup. > + * > + * Arguments: > + * eax system call number > + * ebx arg1 > + * ecx arg2 > + * edx arg3 > + * esi arg4 > + * edi arg5 > + * ebp arg6 > + */ > ENTRY(entry_INT80_32) entry_INT80_32() is only used on pure 32-bit kernels, 64-bit kernels use entry_INT80_compat(). So the above text should not talk about 64-bit programs, as they can never trigger this specific entry point, right? So I'd change the explanation to something like: > + * This entry point is active on 32-bit kernels and can thus be used by 32-bit > + * programs to perform 32-bit system calls. (Programs running on 64-bit > + * kernels executing INT $0x80 will land on another entry point: > + * entry_INT80_compat. The ABI is identical.) Agreed? Thanks, Ingo