Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbcCFQQv (ORCPT ); Sun, 6 Mar 2016 11:16:51 -0500 Received: from mail-ob0-f178.google.com ([209.85.214.178]:36346 "EHLO mail-ob0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbcCFQQl (ORCPT ); Sun, 6 Mar 2016 11:16:41 -0500 MIME-Version: 1.0 In-Reply-To: <20160306083119.GB12352@gmail.com> References: <20160306083119.GB12352@gmail.com> From: Andy Lutomirski Date: Sun, 6 Mar 2016 08:16:21 -0800 Message-ID: Subject: Re: [PATCH 00/10] x86: Various SYSENTER/SYSEXIT/#DB fixes and cleanups To: Ingo Molnar Cc: Andrew Cooper , Oleg Nesterov , Borislav Petkov , Brian Gerst , "linux-kernel@vger.kernel.org" , X86 ML , Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1801 Lines: 44 On Mar 6, 2016 12:31 AM, "Ingo Molnar" wrote: > > > * 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'll send a follow-up patch. --Andy