All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>,
	Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Anton Blanchard <anton@samba.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v4 4/7] powerpc/64s: Move system_call() symbol to just after setting MSR_EE
Date: Thu, 29 Jun 2017 16:11:07 +0530	[thread overview]
Message-ID: <1082922913c4f3eb1927bed9ed8eaf23318408c5.1498732172.git.naveen.n.rao@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1498732172.git.naveen.n.rao@linux.vnet.ibm.com>
In-Reply-To: <cover.1498732172.git.naveen.n.rao@linux.vnet.ibm.com>

It is common to get a PMU interrupt right after the mtmsr instruction that
enables interrupts. Due to this, the stack trace profile gets needlessly split
across system_call_common() and system_call().

Previously, system_call() symbol was at the current place to hide a few
earlier symbols which have since been made private or removed entirely.

So, let's move system_call() slightly higher up, right after the mtmsr
instruction that enables interrupts. Convert existing references to
system_call to a local syscall symbol.

Suggested-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/entry_64.S | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index ef8e6615b8ba..c39436706555 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -142,6 +142,7 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
 	mtmsrd	r11,1
 #endif /* CONFIG_PPC_BOOK3E */
 
+system_call:			/* label this so stack traces look sane */
 	/* We do need to set SOFTE in the stack frame or the return
 	 * from interrupt will be painful
 	 */
@@ -155,7 +156,7 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
 	cmpldi	0,r0,NR_syscalls
 	bge-	.Lsyscall_enosys
 
-system_call:			/* label this so stack traces look sane */
+.Lsyscall:
 /*
  * Need to vector to 32 Bit or default sys_call_table here,
  * based on caller's run-mode / personality.
@@ -309,13 +310,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
 	ld	r7,GPR7(r1)
 	ld	r8,GPR8(r1)
 
-	/* Repopulate r9 and r10 for the system_call path */
+	/* Repopulate r9 and r10 for the syscall path */
 	addi	r9,r1,STACK_FRAME_OVERHEAD
 	CURRENT_THREAD_INFO(r10, r1)
 	ld	r10,TI_FLAGS(r10)
 
 	cmpldi	r0,NR_syscalls
-	blt+	system_call
+	blt+	.Lsyscall
 
 	/* Return code is already in r3 thanks to do_syscall_trace_enter() */
 	b	.Lsyscall_exit
-- 
2.13.1

  parent reply	other threads:[~2017-06-29 10:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 10:41 [PATCH v4 0/7] powerpc: build out kprobes blacklist -- series 3 Naveen N. Rao
2017-06-29 10:41 ` [PATCH v4 1/7] powerpc64/elfv1: Only dereference function descriptor for non-text symbols Naveen N. Rao
2017-06-29 10:49   ` Nicholas Piggin
2017-06-29 11:48     ` Naveen N. Rao
2017-06-29 10:41 ` [PATCH v4 2/7] powerpc/64s: Convert .L__replay_interrupt_return to a local label Naveen N. Rao
2017-06-29 10:41 ` [PATCH v4 3/7] powerpc/64s: Blacklist system_call() and system_call_common() from kprobes Naveen N. Rao
2017-06-29 10:41 ` Naveen N. Rao [this message]
2017-06-29 11:44   ` [PATCH v4 4/7] powerpc/64s: Move system_call() symbol to just after setting MSR_EE Nicholas Piggin
2017-06-29 10:41 ` [PATCH v4 5/7] powerpc/64s: Un-blacklist system_call() from kprobes Naveen N. Rao
2017-06-29 10:55   ` Nicholas Piggin
2017-06-29 11:51     ` Naveen N. Rao
2017-06-29 10:41 ` [PATCH v4 6/7] powerpc/64s: Blacklist functions invoked on a trap Naveen N. Rao
2017-06-29 10:41 ` [PATCH v4 7/7] powerpc/64s: Blacklist rtas entry/exit from kprobes Naveen N. Rao
2017-06-29 11:01   ` Nicholas Piggin
2017-06-29 11:54     ` Naveen N. Rao
2017-06-29 12:13       ` Nicholas Piggin
2017-06-29 16:51         ` Naveen N. Rao

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=1082922913c4f3eb1927bed9ed8eaf23318408c5.1498732172.git.naveen.n.rao@linux.vnet.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=anton@samba.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mhiramat@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    /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 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.