Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753968AbcDVIgu (ORCPT ); Fri, 22 Apr 2016 04:36:50 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33979 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbcDVIgr (ORCPT ); Fri, 22 Apr 2016 04:36:47 -0400 Date: Fri, 22 Apr 2016 10:36:41 +0200 From: Ingo Molnar To: Andy Lutomirski Cc: Peter Zijlstra , Dmitry Safonov , Andrew Lutomirski , "H. Peter Anvin" , Denys Vlasenko , Linus Torvalds , Borislav Petkov , Brian Gerst , "linux-kernel@vger.kernel.org" , Thomas Gleixner , "linux-tip-commits@vger.kernel.org" Subject: Re: [tip:x86/asm] x86/entry: Rename is_{ia32,x32}_task() to in_{ia32,x32}_syscall() Message-ID: <20160422083641.GA17242@gmail.com> References: <1460987025-30360-1-git-send-email-dsafonov@virtuozzo.com> <20160419111530.GA1619@gmail.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 Content-Length: 2836 Lines: 76 * Andy Lutomirski wrote: > On Tue, Apr 19, 2016 at 4:15 AM, Ingo Molnar wrote: > > > > * tip-bot for Dmitry Safonov wrote: > > > >> Commit-ID: abfb9498ee1327f534df92a7ecaea81a85913bae > >> Gitweb: http://git.kernel.org/tip/abfb9498ee1327f534df92a7ecaea81a85913bae > >> Author: Dmitry Safonov > >> AuthorDate: Mon, 18 Apr 2016 16:43:43 +0300 > >> Committer: Ingo Molnar > >> CommitDate: Tue, 19 Apr 2016 10:44:52 +0200 > >> > >> x86/entry: Rename is_{ia32,x32}_task() to in_{ia32,x32}_syscall() > > > > Btw., I'm not _entirely_ happy about the 'IA32' name, but went with this name for > > lack of a better alternative. > > > > So we have 4 system call modes: > > > > - 64-bit native > > - 32-bit addresses with 64-bit arguments (x32) > > - 32-bit compat syscall (x86-32 compatibility on x86-64) > > - 32-bit native > > > > and we have 2 bits of data that are per system call properties: > > > > - TS_COMPAT in thread_info->status is set/cleared dynamically by the compat > > syscall entry code > > > > - a high bit in pt_regs->orig_ax tells us whether it's an x32 system call. > > > > So I'd suggest the following renames to harmonize these concepts: > > > > - CONFIG_IA32_EMULATION => CONFIG_X86_32_ABI > > this lines up nicely with: CONFIG_X86_X32_ABI > > I think I'd prefer a different interpretation: CONFIG_X86_32_ABI is > set if CONFIG_IA32_EMULATION is set *or* CONFIG_X86_32 is set. There > is a lot of code that manually looks for that, because what it > actually cares about is "do we support 32-bit syscalls". Also, with > the syscall cleanups I've been doing, a lot of the code is shared > between native 32-bit and 32-on-64 compat, so the distinction between > those two modes is slowly shrinking. > > in_ia32_syscall() is consistent with that idea: it returns true on > native 32-bit kernels. Ok, so how about: - rename CONFIG_IA32_EMULATION => CONFIG_X86_32_COMPAT - introduce CONFIG_X86_32_ABI to separate the 'convenience' functionality of CONFIG_IA32_EMULATION from the ABI meaning. - rename is_ia32_syscall() -> is_x86_32_syscall() - rename is_x32_syscall() -> is_x86_x32_syscall() - is_compat_syscall() remains as-is. ? In the long run I'd like to get rid of two naming variants: - Fix all names that use 'IA32' that refer to 32-bit compat functionality, and only name the things 'IA32' that are truly Intel specific. - Fix all names that use 'emulation' when they really refer to 32-bit compat. We don't actually emulate anything, we are just calling convention compatible with very little overhead. The CPU is a fully 32-bit/64-bit dual mode hardware, there's nothing that is emulated. Calling it IA32_EMULATION was a misnomer. Thanks, Ingo