Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751324AbcCFIbd (ORCPT ); Sun, 6 Mar 2016 03:31:33 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36835 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751116AbcCFIb2 (ORCPT ); Sun, 6 Mar 2016 03:31:28 -0500 Date: Sun, 6 Mar 2016 09:31:19 +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 Subject: Re: [PATCH 00/10] x86: Various SYSENTER/SYSEXIT/#DB fixes and cleanups Message-ID: <20160306083119.GB12352@gmail.com> References: 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 Content-Length: 1935 Lines: 47 * Andy Lutomirski wrote: > hpa asked me to get rid of the ASM_CLAC at the beginning of the SYSENTER > path. Little did he know... Btw., before we further change this code, something else I think would be very useful. We have countless system call entry points on x86 CPUs, and they are now consistently named and are very easy to grep for: triton:~/tip> git grep 'ENTRY(entry_' arch/x86/entry/ arch/x86/entry/entry_32.S:ENTRY(entry_SYSENTER_32) arch/x86/entry/entry_32.S:ENTRY(entry_INT80_32) arch/x86/entry/entry_64.S:ENTRY(entry_SYSCALL_64) arch/x86/entry/entry_64_compat.S:ENTRY(entry_SYSENTER_compat) arch/x86/entry/entry_64_compat.S:ENTRY(entry_SYSCALL_compat) arch/x86/entry/entry_64_compat.S:ENTRY(entry_INT80_compat) Furthermore, each entry point has extensive comments, except one important detail: none of the comments really explains the circumstances under which the entry points are _used_ by user-space. I'd like to see something like: arch/x86/entry/entry_64.S:ENTRY(entry_SYSCALL_64) * * The 64-bit SYSCALL instruction is used by all modern 64-bit user-space * code to execute most system calls: this instruction is the fastest and * sanest implementation on modern Intel and AMD CPUs. * ... and we should add similar explanations for all of the 6 entry points, with caveats and limitations listed generously. Especially valuable would be to list eventual 'strange' usages of the various syscall instructions, used by rare packages, compatibility layers, emulators, embedded libraries, etc. (To the extent we know about them, obviously.) I.e. it would be very nice to do a full documentation of our current system call usage patterns, as utilized by user-space. Beyond the documentation value this will also help people prioritize optimizations between the various entry points - which should be optimized more, which entry point matters less, etc. Thanks, Ingo