[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <174496050221.31282.986459648353750898.tip-bot2@tip-bot2>
Date: Fri, 18 Apr 2025 07:15:02 -0000
From: "tip-bot2 for Jiri Olsa" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Oleg Nesterov <oleg@...hat.com>, Andrii Nakryiko <andrii@...nel.org>,
Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Alan Maguire <alan.maguire@...cle.com>, Hao Luo <haoluo@...gle.com>,
John Fastabend <john.fastabend@...il.com>,
Masami Hiramatsu <mhiramat@...nel.org>, Song Liu <songliubraving@...com>,
Steven Rostedt <rostedt@...dmis.org>, Yonghong Song <yhs@...com>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: perf/core] uprobes/x86: Add support to emulate NOP instructions
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 610f6e14c29dc7f9637e8d9481e9f241f355e2e4
Gitweb: https://git.kernel.org/tip/610f6e14c29dc7f9637e8d9481e9f241f355e2e4
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Mon, 14 Apr 2025 10:36:46 +02:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Fri, 18 Apr 2025 09:03:05 +02:00
uprobes/x86: Add support to emulate NOP instructions
Add support to emulate all NOP instructions as the original uprobe
instruction.
This change speeds up uprobe on top of all NOP instructions and is a
preparation for usdt probe optimization, that will be done on top of
NOP5 instructions.
With this change the usdt probe on top of NOP5s won't take the performance
hit compared to usdt probe on top of standard NOP instructions.
Suggested-by: Oleg Nesterov <oleg@...hat.com>
Suggested-by: Andrii Nakryiko <andrii@...nel.org>
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Reviewed-by: Oleg Nesterov <oleg@...hat.com>
Acked-by: Andrii Nakryiko <andrii@...nel.org>
Cc: Alan Maguire <alan.maguire@...cle.com>
Cc: Hao Luo <haoluo@...gle.com>
Cc: John Fastabend <john.fastabend@...il.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Song Liu <songliubraving@...com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Yonghong Song <yhs@...com>
Link: https://lore.kernel.org/r/20250414083647.1234007-1-jolsa@kernel.org
---
arch/x86/kernel/uprobes.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index 9194695..6d38383 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -840,6 +840,11 @@ static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)
insn_byte_t p;
int i;
+ /* x86_nops[insn->length]; same as jmp with .offs = 0 */
+ if (insn->length <= ASM_NOP_MAX &&
+ !memcmp(insn->kaddr, x86_nops[insn->length], insn->length))
+ goto setup;
+
switch (opc1) {
case 0xeb: /* jmp 8 */
case 0xe9: /* jmp 32 */
Powered by blists - more mailing lists