mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Denys Vlasenko <dvlasenk@redhat.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Denys Vlasenko <dvlasenk@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Oleg Nesterov <oleg@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Alexei Starovoitov <ast@plumgrid.com>,
	Will Drewry <wad@chromium.org>, Kees Cook <keescook@chromium.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] x86/asm/entry/32: Rename labels in INT 0x80 code path
Date: Sun,  7 Jun 2015 20:41:54 +0200	[thread overview]
Message-ID: <1433702514-31086-1-git-send-email-dvlasenk@redhat.com> (raw)

"ia32_syscall"  label name (entry point for INT 80) is inconsistent with
"ia32_sysenter_target" (entry point for SYSENTER insn) and
"ia32_cstar_target" (entry point for SYSCALL insn).

It is especially misleading since we do have code in this file which
handles SYSCALL insn, and it's _not this code_.

Rename it to ia32_int80_target. Rename all internal labels in ia32_int80_target
routine to int80_<foo> form, similar to the convention in SYSENTER and SYSCALL
code blocks.

Not renaming ia32_cstar_target: even though "ia32_syscall_target" would make
a bit more sense, it's less greppable: "syscall" is a very common string.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Linus Torvalds <torvalds@linux-foundation.org>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Ingo Molnar <mingo@kernel.org>
CC: Borislav Petkov <bp@alien8.de>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Andy Lutomirski <luto@amacapital.net>
CC: Oleg Nesterov <oleg@redhat.com>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Alexei Starovoitov <ast@plumgrid.com>
CC: Will Drewry <wad@chromium.org>
CC: Kees Cook <keescook@chromium.org>
CC: x86@kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/x86/entry/entry_64_compat.S | 12 ++++++------
 arch/x86/include/asm/proto.h     |  2 +-
 arch/x86/kernel/traps.c          |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index b80f8d4..744a3f7 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -443,7 +443,7 @@ ia32_ret_from_sys_call:
  * Assumes it is only called from user space and entered with interrupts off.
  */
 
-ENTRY(ia32_syscall)
+ENTRY(ia32_int80_target)
 	/*
 	 * Interrupts are off on entry.
 	 * We do not frame this tiny irq-off block with TRACE_IRQS_OFF/ON,
@@ -472,9 +472,9 @@ ENTRY(ia32_syscall)
 
 	orl	$TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp, SIZEOF_PTREGS)
 	testl	$_TIF_WORK_SYSCALL_ENTRY, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS)
-	jnz	ia32_tracesys
+	jnz	int80_tracesys
 
-ia32_do_call:
+int80_do_call:
 	/* 32-bit syscall -> 64-bit C ABI argument conversion */
 	movl	%edi, %r8d		/* arg5 */
 	movl	%ebp, %r9d		/* arg6 */
@@ -489,7 +489,7 @@ ia32_do_call:
 1:
 	jmp	int_ret_from_sys_call
 
-ia32_tracesys:
+int80_tracesys:
 	SAVE_EXTRA_REGS
 	movq	%rsp, %rdi			/* &pt_regs -> arg1 */
 	call	syscall_trace_enter
@@ -506,8 +506,8 @@ ia32_tracesys:
 	movl	RDI(%rsp), %edi
 	movl	%eax, %eax		/* zero extension */
 	RESTORE_EXTRA_REGS
-	jmp	ia32_do_call
-END(ia32_syscall)
+	jmp	int80_do_call
+END(ia32_int80_target)
 
 	.macro PTREGSCALL label, func
 	ALIGN
diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index a90f897..3c692be 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -8,7 +8,7 @@
 void system_call(void);
 void syscall_init(void);
 
-void ia32_syscall(void);
+void ia32_int80_target(void);
 void ia32_cstar_target(void);
 void ia32_sysenter_target(void);
 
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index b5e7687..b8a4204 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -894,7 +894,7 @@ void __init trap_init(void)
 		set_bit(i, used_vectors);
 
 #ifdef CONFIG_IA32_EMULATION
-	set_system_intr_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
+	set_system_intr_gate(IA32_SYSCALL_VECTOR, ia32_int80_target);
 	set_bit(IA32_SYSCALL_VECTOR, used_vectors);
 #endif
 
-- 
1.8.1.4


             reply	other threads:[~2015-06-07 18:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-07 18:41 Denys Vlasenko [this message]
     [not found] ` <CA+55aFyuRgUL4k2Q6aXiqK-nbrwT=vbX2dfu8r9Xb8D1CNKK2w@mail.gmail.com>
2015-06-08  5:35   ` Ingo Molnar
2015-06-08 14:47     ` Brian Gerst
2015-06-08 19:14       ` Ingo Molnar
2015-06-08 19:17         ` Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433702514-31086-1-git-send-email-dvlasenk@redhat.com \
    --to=dvlasenk@redhat.com \
    --cc=ast@plumgrid.com \
    --cc=bp@alien8.de \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    --cc=wad@chromium.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®