Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753920AbbFRWLY (ORCPT ); Thu, 18 Jun 2015 18:11:24 -0400 Received: from mail-ob0-f175.google.com ([209.85.214.175]:35515 "EHLO mail-ob0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752752AbbFRWLO (ORCPT ); Thu, 18 Jun 2015 18:11:14 -0400 MIME-Version: 1.0 In-Reply-To: <20150618211318.GA3934@gmail.com> References: <55808579.4050004@zytor.com> <20150618164912.GA8557@gmail.com> <20150618211318.GA3934@gmail.com> Date: Thu, 18 Jun 2015 18:11:13 -0400 Message-ID: Subject: Re: [RFC] Rename various 'IA32' uses in arch/x86/ code From: Brian Gerst To: Ingo Molnar Cc: "H. Peter Anvin" , Linux Kernel Mailing List , Peter Zijlstra , Borislav Petkov , Thomas Gleixner , Andrew Morton , Linus Torvalds , Denys Vlasenko , Andy Lutomirski , linux-tip-commits@vger.kernel.org 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: 2809 Lines: 63 On Thu, Jun 18, 2015 at 5:13 PM, Ingo Molnar wrote: > > * Brian Gerst wrote: > >> >> The original one wasn't really a misnomer, as it referred to the ia32 system >> >> calls specifically, but this works too. >> > >> > It was a misnomer, because what are the 'ia32 system calls'? We have no Intel >> > specific system calls! >> > >> > The term 'IA32' (Intel Architecture 32-bit) is a misnomer in many existing >> > arch/x86/ symbol, function and file names, and most of them should be renamed. >> > >> > Some common examples, with a suggested rename target: >> > >> > stack_frame_ia32 -> stack_frame_compat >> > IA32_RT_SIGFRAME_sigcontext -> COMPAT_RT_SIGFRAME_sigcontext >> > sigcontext_ia32 -> sigcontext_compat >> > user_i387_ia32_struct -> user_i387_compat_struct >> > TIF_IA32 -> TIF_COMPAT >> > >> > and here a few 'ia32' misnomers that should be addressed not via simple renames, >> > but via transformations to existing compat facilities: >> > >> > CONFIG_IA32_EMULATION -> partly eliminate, partly covert to CONFIG_COMPAT use >> >> I think we still want a symbol for code that is exclusive to 32-bit >> compatibility (like entry and signal code) to keep it separate from X32 which >> also wants CONFIG_COMPAT. If I get time this weekend I'll get the patchset to >> do the separation updated to the tip branch. > > Ok, so your goal is to allow the x32 ABI, but not 32-bit user-space? It just seems odd that x32 (which is really a 64-bit ABI with 32-bit pointers) depended on enabling 32-bit support. Other than both using the core compat code, they are not really related. > I suppose that makes some sense, it might be a valid 'attack surface reduction' > technique, while still allowing the x32 ABI. > > But I'm not sure we should bother and complicate things: 32-bit compat isn't going > away anytime soon, and most of CONFIG_COMPAT is needed for x32. Many of the compat syscalls are unused by x32. It only needs to handle syscalls with pointers embedded in data structures differently than native 64-bit. 64-bit integer arguments (ie., loff_t) do not need special handling, since they can be passed in a single register instead of a pair of 32-bit registers. This won't solve that particular issue yet, but it's something to be aware of for future cleanups. > So maybe we could introduce CONFIG_X86_32_ABI=y or so, which would cover just the > 32-bit entry code and the signal frame compatibility layer? Yes. -- Brian Gerst -- 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/