|
|
Log in / Subscribe / Register

Re: [PATCH] x86/asm/entry/32: Rename labels in INT 0x80 code path

From:  Ingo Molnar <mingo-AT-kernel.org>
To:  Linus Torvalds <torvalds-AT-linux-foundation.org>
Subject:  Re: [PATCH] x86/asm/entry/32: Rename labels in INT 0x80 code path
Date:  Mon, 8 Jun 2015 07:35:37 +0200
Message-ID:  <20150608053537.GA18307@gmail.com>
Cc:  Denys Vlasenko <dvlasenk-AT-redhat.com>, Frederic Weisbecker <fweisbec-AT-gmail.com>, Kees Cook <keescook-AT-chromium.org>, Borislav Petkov <bp-AT-alien8.de>, linux-kernel-AT-vger.kernel.org, Alexei Starovoitov <ast-AT-plumgrid.com>, Oleg Nesterov <oleg-AT-redhat.com>, Will Drewry <wad-AT-chromium.org>, Andy Lutomirski <luto-AT-amacapital.net>, Steven Rostedt <rostedt-AT-goodmis.org>, x86-AT-kernel.org, "H. Peter Anvin" <hpa-AT-zytor.com>
Archive‑link:  Article


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Jun 7, 2015 11:42 AM, "Denys Vlasenko" <dvlasenk@redhat.com> wrote:
> >
> > Rename it to ia32_int80_target.
> 
> Btw, could we arrive to get rid of the idiotic "ia32" naming too? It's wrong, 
> and it harkens back to the days when intel thought itanium makes sense and 
> wanted to talk about "intel architecture".

Absolutely, I've been slowly eliminating uses of it - that naming is very 
annoying.

Another thing I'm doing is to slowly remove references to 'emulation' - we don't 
emulate 32-bit in any way, we implement various 32-bit syscall ABIs (old a new) 
natively.

I'd like to remove CONFIG_IA32_EMULATION from the .config as well - it offers 
nothing real over CONFIG_COMPAT.

> The platform is called x86, not ia32. And in this particular case, u suspect the 
> important part isn't the x86 part, but the "compat" part - we damn well know 
> we're x86, the important part is that this is the 32-bit compat entry point of a 
> 64-bit kernel. No?

Totally. All strings of 'ia32' and 'IA32' will be gone in the long run except from 
Intel specific MSR names or so.

> So "ia32" is just crazy, and the architecture is not in question anyway, why not 
> name these things for the things that really matter?

Yeah. I wanted to rename all the entry points to be logical, and beyond removing 
the nonsensical 'ia32' names I also wanted to make it clear what kind of 
instruction's entry point they are.

For example whoever thought that 'ia32_cstar_target' is a proper name for the 
primary 32-bit syscall entry point needs their head examined.

My (re-)naming plan is:

	ia32_sysenter_target	-> entry_SYSENTER_32
	system_call (32)	-> entry_INT80_32
	system_call (64)	-> entry_SYSCALL_64
	ia32_cstar_target	-> entry_SYSCALL_compat
	ia32_syscall		-> entry_INT80_compat
	ia32_sysenter_target	-> entry_SYSENTER_compat

The ideas behind this naming scheme is to:

  - Make it really obvious, through a capitalized asm mnemonic, which particular 
    x86 CPU instruction a particular entry point corresponds to. People changing 
    that code should be absolutely aware of the various special properties these
    instructions have.

  - Harmonize the naming across the native 32-bit, 64-bit and compat space.

  - Unconfuse the 32-bit and 64-bit logic where the 'system_call' entry point is 
    actually for two (starkly) different instructions.

  - Remove the various ia32 prefixes that are sometimes denoting compat, sometimes
    native 32-bit.

Another possibility would be:

	ia32_sysenter_target	-> entry_32_SYSENTER
	system_call (32)	-> entry_32_INT80
	system_call (64)	-> entry_64_SYSCALL
	ia32_cstar_target	-> entry_64_SYSCALL_compat
	ia32_syscall		-> entry_64_INT80_compat
	ia32_sysenter_target	-> entry_64_SYSENTER_compat

These names are typically only used in two places, so name length is not as 
critical as for other function names.

And naming matters: a good name is both descriptive and short, as we know it from 
the excellent examples of 'Linux' and 'Git'. Oh wait ...

Thanks,

	Ingo



to post comments

Re: [PATCH] x86/asm/entry/32: Rename labels in INT 0x80 code path

Posted Jun 21, 2015 22:48 UTC (Sun) by toyotabedzrock (guest, #88005) [Link]

Just make sure you will be able to search for and find these definitions in the future.


Copyright © 2015, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds