All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86-64: cleanup some assembly entry points
@ 2011-11-29 11:24 Jan Beulich
  2011-11-29 20:59 ` Andi Kleen
  2011-12-05 18:02 ` [tip:x86/asm] x86-64: Cleanup " tip-bot for Jan Beulich
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2011-11-29 11:24 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: linux-kernel

system_call_after_swapgs doesn't really benefit from forcing alignment
from it - quite the opposite, native code needlessly so far got a big
NOP instruction inserted in front of it. Xen being the only user of
the separate entry point can well live with the branch going to three
bytes into a cache line.

The compatibility mode ptregs entry points for one can make use of the
GLOBAL() macro, and should be suitably aligned. Their shared
continuation point (ia32_ptregs_common) otoh doesn't need to be global
at all, but should continue to be properly aligned.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

---
 arch/x86/ia32/ia32entry.S  |    7 ++++---
 arch/x86/kernel/entry_64.S |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

--- 3.2-rc3/arch/x86/ia32/ia32entry.S
+++ 3.2-rc3-x86_64-entry-cleanup/arch/x86/ia32/ia32entry.S
@@ -459,8 +459,8 @@ quiet_ni_syscall:
 	CFI_ENDPROC
 	
 	.macro PTREGSCALL label, func, arg
-	.globl \label
-\label:
+	ALIGN
+GLOBAL(\label)
 	leaq \func(%rip),%rax
 	leaq -ARGOFFSET+8(%rsp),\arg	/* 8 for return address */
 	jmp  ia32_ptregs_common	
@@ -477,7 +477,8 @@ quiet_ni_syscall:
 	PTREGSCALL stub32_vfork, sys_vfork, %rdi
 	PTREGSCALL stub32_iopl, sys_iopl, %rsi
 
-ENTRY(ia32_ptregs_common)
+	ALIGN
+ia32_ptregs_common:
 	popq %r11
 	CFI_ENDPROC
 	CFI_STARTPROC32	simple
--- 3.2-rc3/arch/x86/kernel/entry_64.S
+++ 3.2-rc3-x86_64-entry-cleanup/arch/x86/kernel/entry_64.S
@@ -465,7 +465,7 @@ ENTRY(system_call)
 	 * after the swapgs, so that it can do the swapgs
 	 * for the guest and jump here on syscall.
 	 */
-ENTRY(system_call_after_swapgs)
+GLOBAL(system_call_after_swapgs)
 
 	movq	%rsp,PER_CPU_VAR(old_rsp)
 	movq	PER_CPU_VAR(kernel_stack),%rsp




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86-64: cleanup some assembly entry points
  2011-11-29 11:24 [PATCH] x86-64: cleanup some assembly entry points Jan Beulich
@ 2011-11-29 20:59 ` Andi Kleen
  2011-12-05 18:02 ` [tip:x86/asm] x86-64: Cleanup " tip-bot for Jan Beulich
  1 sibling, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2011-11-29 20:59 UTC (permalink / raw)
  To: Jan Beulich; +Cc: mingo, tglx, hpa, linux-kernel

"Jan Beulich" <JBeulich@suse.com> writes:

> The compatibility mode ptregs entry points for one can make use of the
> GLOBAL() macro, and should be suitably aligned. Their shared
> continuation point (ia32_ptregs_common) otoh doesn't need to be global
> at all, but should continue to be properly aligned.

FWIW I reviewed all the patches and they look good to me
(except for the tricky THREAD_INFO patch, sorry)

Reviewed-by: Andi Kleen <ak@linux.intel.com>

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/asm] x86-64: Cleanup some assembly entry points
  2011-11-29 11:24 [PATCH] x86-64: cleanup some assembly entry points Jan Beulich
  2011-11-29 20:59 ` Andi Kleen
@ 2011-12-05 18:02 ` tip-bot for Jan Beulich
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Jan Beulich @ 2011-12-05 18:02 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, jbeulich, JBeulich, ak, tglx, mingo

Commit-ID:  f6b2bc847641ea38e2655c8424fef5d2d19f35f9
Gitweb:     http://git.kernel.org/tip/f6b2bc847641ea38e2655c8424fef5d2d19f35f9
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Tue, 29 Nov 2011 11:24:10 +0000
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 5 Dec 2011 17:24:43 +0100

x86-64: Cleanup some assembly entry points

system_call_after_swapgs doesn't really benefit from forcing
alignment from it - quite the opposite, native code needlessly
so far got a big NOP instruction inserted in front of it. Xen
being the only user of the separate entry point can well live
with the branch going to three bytes into a cache line.

The compatibility mode ptregs entry points for one can make use
of the GLOBAL() macro, and should be suitably aligned. Their
shared continuation point (ia32_ptregs_common) otoh doesn't need
to be global at all, but should continue to be properly aligned.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/4ED4CEEA020000780006407D@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/ia32/ia32entry.S  |    7 ++++---
 arch/x86/kernel/entry_64.S |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 0d5c279..3e27456 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -453,8 +453,8 @@ quiet_ni_syscall:
 	CFI_ENDPROC
 	
 	.macro PTREGSCALL label, func, arg
-	.globl \label
-\label:
+	ALIGN
+GLOBAL(\label)
 	leaq \func(%rip),%rax
 	leaq -ARGOFFSET+8(%rsp),\arg	/* 8 for return address */
 	jmp  ia32_ptregs_common	
@@ -471,7 +471,8 @@ quiet_ni_syscall:
 	PTREGSCALL stub32_vfork, sys_vfork, %rdi
 	PTREGSCALL stub32_iopl, sys_iopl, %rsi
 
-ENTRY(ia32_ptregs_common)
+	ALIGN
+ia32_ptregs_common:
 	popq %r11
 	CFI_ENDPROC
 	CFI_STARTPROC32	simple
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 75f72a5..cfad7fc 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -465,7 +465,7 @@ ENTRY(system_call)
 	 * after the swapgs, so that it can do the swapgs
 	 * for the guest and jump here on syscall.
 	 */
-ENTRY(system_call_after_swapgs)
+GLOBAL(system_call_after_swapgs)
 
 	movq	%rsp,PER_CPU_VAR(old_rsp)
 	movq	PER_CPU_VAR(kernel_stack),%rsp

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-05 18:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-29 11:24 [PATCH] x86-64: cleanup some assembly entry points Jan Beulich
2011-11-29 20:59 ` Andi Kleen
2011-12-05 18:02 ` [tip:x86/asm] x86-64: Cleanup " tip-bot for Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.