From: Masami Hiramatsu (Google)
Add ftrace_regs definition for x86_64 in the ftrace header to
clarify what register will be accessible from ftrace_regs.
Signed-off-by: Masami Hiramatsu (Google)
---
Changes in v2:
- Newly added.
---
arch/x86/include/asm/ftrace.h |6 ++
1 file
From: Masami Hiramatsu (Google)
To clarify what will be expected on ftrace_regs, add a comment to the
architecture independent definition of the ftrace_regs.
Signed-off-by: Masami Hiramatsu (Google)
---
Changes in v2:
- newly added.
---
include/linux/ftrace.h | 25
/kernel/git/mhiramat/linux.git/log/?h=topic/fprobe-on-fgraph
Thank you,
---
Christophe JAILLET (1):
seq_buf: Export seq_buf_puts()
Masami Hiramatsu (Google) (15):
tracing: Add a comment about ftrace_regs definition
x86: tracing: Add ftrace_regs definition in the header
From: Masami Hiramatsu (Google)
Fix to check the tracepoint event is not valid with $retval.
The commit 08c9306fc2e3 ("tracing/fprobe-event: Assume fprobe is
a return event by $retval") introduced automatic return probe
conversion with $retval. But since tracepoint event does not
supp
From: Masami Hiramatsu (Google)
Update fprobe documentation for the new fprobe on function-graph
tracer. This includes some bahvior changes and pt_regs to
ftrace_regs interface change.
Signed-off-by: Masami Hiramatsu (Google)
---
Documentation/trace/fprobe.rst | 42
From: Masami Hiramatsu (Google)
Enable kprobe_multi feature if CONFIG_FPROBE is enabled. The pt_regs is
converted from ftrace_regs by ftrace_partial_regs(), thus some registers
may always returns 0. But it should be enough for function entry (access
arguments) and exit (access return value
From: Masami Hiramatsu (Google)
Allow fprobe events to be enabled with CONFIG_DYNAMIC_FTRACE_WITH_ARGS.
With this change, fprobe events mostly use ftrace_regs instead of pt_regs.
Note that if the arch doesn't enable HAVE_PT_REGS_COMPAT_FTRACE_REGS,
fprobe events will not be able to be used from
From: Masami Hiramatsu (Google)
Rewrite fprobe implementation on function-graph tracer.
Major API changes are:
- 'nr_maxactive' field is deprecated.
- This depends on CONFIG_DYNAMIC_FTRACE_WITH_ARGS or
!CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS, and
CONFIG_HAVE_FUNCTION_GRAPH_FREGS. So
From: Masami Hiramatsu (Google)
Add ftrace_fill_perf_regs() which should be compatible with the
perf_fetch_caller_regs(). In other words, the pt_regs returned from the
ftrace_fill_perf_regs() must satisfy 'user_mode(regs) == false' and can be
used for stack tracing.
Signed-off-by: Masami
From: Masami Hiramatsu (Google)
Add ftrace_partial_regs() which converts the ftrace_regs to pt_regs.
If the architecture defines its own ftrace_regs, this copies partial
registers to pt_regs and returns it. If not, ftrace_regs is the same as
pt_regs and ftrace_partial_regs() will return
From: Masami Hiramatsu (Google)
Change the fprobe exit handler to use ftrace_regs structure instead of
pt_regs. This also introduce HAVE_PT_REGS_TO_FTRACE_REGS_CAST which means
the ftrace_regs's memory layout is equal to the pt_regs so that those are
able to cast. Fprobe introduces a new
From: Masami Hiramatsu (Google)
This allows fprobes to be available with CONFIG_DYNAMIC_FTRACE_WITH_ARGS
instead of CONFIG_DYNAMIC_FTRACE_WITH_REGS, then we can enable fprobe
on arm64.
Signed-off-by: Masami Hiramatsu (Google)
Acked-by: Florent Revest
---
Changes from previous series: NOTHING
From: Masami Hiramatsu (Google)
Support HAVE_FUNCTION_GRAPH_FREGS on x86-64, which saves ftrace_regs
on the stack in ftrace_graph return trampoline so that the callbacks
can access registers via ftrace_regs APIs.
Note that this only recovers 'rax' and 'rdx' registers because other
registers
From: Masami Hiramatsu (Google)
Add a new return handler to fgraph_ops as 'retregfunc' which takes
parent_ip and ftrace_regs instead of ftrace_graph_ret. This handler
is available only if the arch support CONFIG_HAVE_FUNCTION_GRAPH_FREGS.
Note that the 'retfunc' and 'reregfunc' are mutual
From: Masami Hiramatsu (Google)
Add a new entry handler to fgraph_ops as 'entryregfunc' which takes
parent_ip and ftrace_regs. Note that the 'entryfunc' and 'entryregfunc'
are mutual exclusive. You can set only one of them.
Signed-off-by: Masami Hiramatsu (Google)
---
arch/arm64/kernel
From: Masami Hiramatsu (Google)
Expand the maximum reserved data size to 32 from 4. On 64bit system,
this will allow reserving 256 bytes on the ret_stack in maximum but
that may not happen.
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c |4 ++--
1 file changed, 2
From: Masami Hiramatsu (Google)
Make the fgraph_retrieve_data() returns the reverved data size via
size_byte parameter.
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h|2 +-
kernel/trace/fgraph.c |5 -
kernel/trace/trace_selftest.c | 10
From: Masami Hiramatsu (Google)
Fix to check the return value ('ret_stack') of ftrace_pop_return_trace()
instead of passed storage ('ret') because ret_stack becomes NULL in
error case.
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c |2 +-
1 file changed, 1 insertion
From: Masami Hiramatsu (Google)
Fix to initialize the ftrace_ops of fgraph_ops with ftrace_graph_func
instead of ftrace_stub.
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/fgraph.c b
From: Masami Hiramatsu (Google)
__ftrace_return_to_handler() missed to update the curr_ret_stack when it
gets a FGRAPH_TYPE_ARRAY. Since that type entry will follows some data
words, it must update curr_ret_stack by entry size value (__get_index(val))
instead of 1.
Signed-off-by: Masami
From: Steven Rostedt (VMware)
Add boot up selftest that passes variables from a function entry to a
function exit, and make sure that they do get passed around.
Signed-off-by: Steven Rostedt (VMware)
---
kernel/trace/trace_selftest.c | 161 +
1 file
shadow ret_stack and this then can be
retrived by fgraph_retrieve_data() called by the corresponding retfunc().
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h |3 +
kernel/trace/fgraph.c | 244
are)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/trace_recursion.h |7 ---
kernel/trace/trace.h |9 +
kernel/trace/trace_functions_graph.c | 10 ++
3 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/include/li
are)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/trace_recursion.h | 29 -
kernel/trace/trace.h| 34 --
2 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/include/linux/trace_recursion.h b/incl
are)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/trace_recursion.h |5 +
kernel/trace/trace.h | 32 +---
kernel/trace/trace_functions_graph.c |6 +++---
kernel/trace/trace_irqsoff.c |4 ++--
kernel/tr
s on a per task basis
having a way to maintain state for each task.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h |2 +
kernel/trace/fgraph.c | 73 +++-
2 files changed, 74 insert
From: Steven Rostedt (VMware)
Allow for instances to have their own ftrace_ops part of the fgraph_ops that
makes the funtion_graph tracer filter on the set_ftrace_filter file of the
instance and not the top instance.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu
to compile because dynamic
ftrace is disabled.
This change is needed to move some of the logic of what is passed to
ftrace_startup() out of the parameters of ftrace_startup().
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h | 18
-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h |1 +
kernel/trace/ftrace.c|1 +
kernel/trace/trace.h | 12 ++
kernel/trace/trace_functions.c |8
kernel/trace
to the function graph tracer.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h | 10 +++---
kernel/trace/fgraph.c| 17 ++---
kernel/trace/ftrace.c|6 --
kernel
into the
function_graph tracer.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c | 72 +++-
kernel/trace/ftrace.c |2 -
kernel/trace/ftrace_internal.h |2 -
3 files changed, 20 insertions(+), 56
are called is not completely
handled yet, but that shouldn't be too hard to manage.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c | 332 +
1 file changed, 280 insertions(+), 52 deletions
on
the shadow stack. We need to only save the index, because this will allow
the fgraph_ops to be freed before the function returns (which may happen if
the function call schedule for a long time).
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c
for the return side of the functions.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/sched.h |2 -
kernel/trace/fgraph.c | 124 -
2 files changed, 71 insertions(+), 55 deletions(-)
diff --git
dt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c |9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
index 30edeb6d4aa9..837daf929d2a 100644
--- a/kernel/trace/fgraph.c
+++ b/kernel/trac
-by: Steven Rostedt (Google)
Signed-off-by: Masami Hiramatsu (Google)
---
lib/seq_buf.c |1 +
1 file changed, 1 insertion(+)
diff --git a/lib/seq_buf.c b/lib/seq_buf.c
index 45c450f423fa..46a1b00c3815 100644
--- a/lib/seq_buf.c
+++ b/lib/seq_buf.c
@@ -189,6 +189,7 @@ int seq_buf_puts(struct
below branch.
https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/log/?h=topic/fprobe-on-fgraph
Thank you,
---
Christophe JAILLET (1):
seq_buf: Export seq_buf_puts()
Masami Hiramatsu (Google) (16):
function_graph: Fix to update curr_ret_stack with ARRAY entry size
From: Masami Hiramatsu (Google)
Fix to check the tracepoint event is not valid with $retval.
The commit 08c9306fc2e3 ("tracing/fprobe-event: Assume fprobe is
a return event by $retval") introduced automatic return probe
conversion with $retval. But since tracepoint event does not
supp
From: Masami Hiramatsu (Google)
Check the number of probe target symbols in the target module when
the module is loaded. If the probe is not on the unique name symbols
in the module, it will be rejected at that point.
Note that the symbol which has a unique name in the target module
From: Masami Hiramatsu (Google)
Use __generic_cmpxchg_local() for arch_cmpxchg_local() implementation
in SH architecture because it does not implement arch_cmpxchg_local().
Reported-by: kernel test robot
Closes:
https://lore.kernel.org/oe-kbuild-all/202310241310.ir5uukog-...@intel.com/
Signed
From: Masami Hiramatsu (Google)
Use generic_cmpxchg_local() for arch_cmpxchg_local() implementation
in SH architecture because it does not implement arch_cmpxchg_local().
Reported-by: kernel test robot
Closes:
https://lore.kernel.org/oe-kbuild-all/202310241310.ir5uukog-...@intel.com/
Signed
From: Masami Hiramatsu (Google)
The number of active retprobes can be zero but it is not acceptable,
so return EINVAL error if detected.
Reported-by: wuqiang.matt
Closes:
https://lore.kernel.org/all/20231016222103.cb9f426edc60220eabd8a...@kernel.org/
Fixes: 5b0ab78998e3 ("fprobe
From: Masami Hiramatsu (Google)
Move the BTF APIs used in tracing to the BTF library code for sharing it
with others.
Previously, to avoid complex dependency in a series I made it on the
tracing tree, but now it is a good time to move it to BPF tree because
these functions are pure BTF functions
From: Masami Hiramatsu (Google)
Since ftrace_func_t requires to pass 'struct ftrace_regs *' as the 4th
argument even if FTRACE_OPS_FL_SAVE_REGS is not set, ftrace_caller must
pass 'struct ftrace_regs *', which is a partial pt_regs, on the stack
to the ftrace_func_t functions, so
From: Masami Hiramatsu (Google)
Add a note about the argument and return value accecss will be best
effort. Depending on the type, it will be passed via stack or a
pair of the registers, but $argN and $retval only support the
single register access.
Suggested-by: Alexei Starovoitov
Signed-off
From: Masami Hiramatsu (Google)
Update fprobe document so that the entry/exit handler uses ftrace_regs
instead of pt_regs.
Signed-off-by: Masami Hiramatsu (Google)
Acked-by: Florent Revest
---
Documentation/trace/fprobe.rst | 14 ++
1 file changed, 6 insertions(+), 8 deletions
From: Masami Hiramatsu (Google)
Enable kprobe_multi feature if CONFIG_FPROBE is enabled. The pt_regs is
converted from ftrace_regs by ftrace_partial_regs(), thus some registers
may always returns 0. But it should be enough for function entry (access
arguments) and exit (access return value
From: Masami Hiramatsu (Google)
Allow fprobe events to be enabled with CONFIG_DYNAMIC_FTRACE_WITH_ARGS.
With this change, fprobe events mostly use ftrace_regs instead of pt_regs.
Note that if the arch doesn't enable HAVE_PT_REGS_COMPAT_FTRACE_REGS,
fprobe events will not be able to be used from
From: Masami Hiramatsu (Google)
Add ftrace_fill_perf_regs() which should be compatible with the
perf_fetch_caller_regs(). In other words, the pt_regs returned from the
ftrace_fill_perf_regs() must satisfy 'user_mode(regs) == false' and can be
used for stack tracing.
Signed-off-by: Masami
From: Masami Hiramatsu (Google)
Add ftrace_partial_regs() which converts the ftrace_regs to pt_regs.
If the architecture defines its own ftrace_regs, this copies partial
registers to pt_regs and returns it. If not, ftrace_regs is the same as
pt_regs and ftrace_partial_regs() will return
From: Masami Hiramatsu (Google)
Change the fprobe exit handler and rethook to use ftrace_regs structure
instead of pt_regs. This also introduce HAVE_PT_REGS_TO_FTRACE_REGS_CAST
which means the ftrace_regs's memory layout is equal to the pt_regs so
that those are able to cast. Only
From: Masami Hiramatsu (Google)
In order to be able to use ftrace_regs even from features unrelated to
function tracer (e.g. kretprobe), expose ftrace_regs structures and
APIs even if the CONFIG_FUNCTION_TRACER=n.
Signed-off-by: Masami Hiramatsu (Google)
Acked-by: Florent Revest
---
Changes
From: Masami Hiramatsu (Google)
This allows fprobes to be available with CONFIG_DYNAMIC_FTRACE_WITH_ARGS
instead of CONFIG_DYNAMIC_FTRACE_WITH_REGS, then we can enable fprobe
on arm64.
Signed-off-by: Masami Hiramatsu (Google)
Acked-by: Florent Revest
---
Changes in v3:
- Use
From: Masami Hiramatsu (Google)
Add a comment about the requirements of the ftrace_regs if it is
implemented on the arch-dependent code with
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS.
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h |8
1 file changed, 8 insertions
From: Masami Hiramatsu (Google)
Add a new ret_ip callback parameter description.
Fixes: cb16330d1274 ("fprobe: Pass return address to the handlers")
Signed-off-by: Masami Hiramatsu (Google)
Acked-by: Florent Revest
---
Changes in v4:
- Update ret_ip description (Than
From: Masami Hiramatsu (Google)
Since ftrace_func_t requires to pass 'struct ftrace_regs *' as the 4th
argument even if FTRACE_OPS_FL_SAVE_REGS is not set, ftrace_caller must
pass 'struct ftrace_regs *', which is a partial pt_regs, on the stack
to the ftrace_func_t functions, so
callbacks.
- Add notes for the $argN and $retval.
This series can be applied against the trace-v6.6-rc2 on linux-trace tree.
This series can also be found below branch.
https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/log/?h=topic/fprobe-ftrace-regs
Thank you,
---
Masami Hiramatsu
On Wed, 14 Apr 2021 21:46:47 +0800
zuoqil...@163.com wrote:
> From: zuoqilin
>
> It is not necessary to define the variable ret to receive
> the return value of the xbc_node_compose_key() method.
>
> Signed-off-by: zuoqilin
Indeed.
Acked-by: Masami Hiramatsu
Thank yo
flag by calling kprobe_save_local_irqflag(). Note,
> 'SIE' is masked in this new saved irqflag. After kprobe is
> serviced, the CPU 'sstatus' is restored with 'SIE' masked.
> This overwritten 'sstatus' cause BUG_ON() in __find_get_block.
>
> This bug is already fixed on arm64 by
S dependency" series look
> much better. The last version is v5, I'm not sure whether Jarkko will
> send new version to mainline the series.
I hope so. If module_alloc() itself is implemented on the generic text_alloc(),
I can replace the module_alloc() with text_alloc().
Thank you,
--
Masami Hiramatsu
NUMA_NO_NODE,
> + __builtin_return_address(0));
> }
>
> /* Recover page to RW mode before releasing it */
> --
> 2.31.0
>
--
Masami Hiramatsu
On Mon, 12 Apr 2021 22:11:44 +0900
Masami Hiramatsu wrote:
> Hi Jisheng,
>
> On Mon, 12 Apr 2021 17:41:01 +0800
> Jisheng Zhang wrote:
>
> > If instruction being single stepped caused a page fault, the kprobes
> > is cancelled to let the page fault handler continue
restore_previous_kprobe(kcb);
> - else
> + } else {
> + kprobes_restore_local_irqflag(kcb, regs);
> reset_current_kprobe();
> + }
>
> break;
> case KPROBE_HIT_ACTIVE:
> --
> 2.31.0
>
--
Masami Hiramatsu
on")
> Signed-off-by: Christophe JAILLET
Acked-by: Masami Hiramatsu
Thank you,
> ---
> kernel/trace/trace_dynevent.c | 6 --
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/trace_dynevent.c b/kernel/trace/trace_dynevent.c
> index dc971
er and know the content is safe.
> >
> >
> > On Thu, 1 Apr 2021, Masami Hiramatsu wrote:
> >
> > > > > > Current riscv's kprobe handlers are run with both preemption and
> > > > > > interrupt enabled, this violates kprobe requi
On Mon, 5 Apr 2021 09:56:48 -0500
"Madhavan T. Venkataraman" wrote:
>
>
> On 4/5/21 8:24 AM, Masami Hiramatsu wrote:
> > Hi Madhaven,
> >
> > On Sat, 3 Apr 2021 22:29:12 -0500
> > "Madhavan T. Venkataram
On Mon, 5 Apr 2021 12:12:08 -0500
"Madhavan T. Venkataraman" wrote:
>
>
> On 4/5/21 9:56 AM, Madhavan T. Venkataraman wrote:
> >
> >
> > On 4/5/21 8:24 AM, Masami Hiramatsu wrote:
> >> Hi Madhaven,
> >>
> >> On Sat,
til that is available, this case needs to be addressed.
Actually, I've done that on arm64 :) See below patch.
(and I also have a similar code for arm32, what I'm considering is how
to unify x86/arm/arm64 kretprobe_find_ret_addr(), since those are very
similar.)
This is applicable on my x86 series v
On Tue, 30 Mar 2021 04:57:50 -0700
zhouchuangao wrote:
> It can be optimized at compile time.
>
Anyway, this seems to make the code simpler.
Reviewed-by: Masami Hiramatsu
Thanks!
> Signed-off-by: zhouchuangao
> ---
> arch/arm64/kernel/probes/kprobes.c | 3 +--
>
On Thu, 1 Apr 2021 10:44:52 +0900
Masami Hiramatsu wrote:
> On Wed, 31 Mar 2021 10:57:36 -0500
> Josh Poimboeuf wrote:
>
> > On Wed, Mar 31, 2021 at 02:44:56PM +0900, Masami Hiramatsu wrote:
> > > +#ifdef CONFIG_UNWINDER_ORC
> > > +unsigned long recover_optpr
On Wed, 31 Mar 2021 14:44:56 +0900
Masami Hiramatsu wrote:
> +#ifdef CONFIG_UNWINDER_ORC
> +unsigned long recover_optprobe_trampoline(unsigned long addr, unsigned long
> *sp)
> +{
> + unsigned long offset, entry, probe_addr;
> + struct optimized_kprobe *op;
> +
On Wed, 31 Mar 2021 10:57:36 -0500
Josh Poimboeuf wrote:
> On Wed, Mar 31, 2021 at 02:44:56PM +0900, Masami Hiramatsu wrote:
> > +#ifdef CONFIG_UNWINDER_ORC
> > +unsigned long recover_optprobe_trampoline(unsigned long addr, unsigned
> > long *sp)
> > +{
> >
Hi,
On Wed, 31 Mar 2021 22:22:44 +0800
Jisheng Zhang wrote:
> On Tue, 30 Mar 2021 18:33:16 +0900
> Masami Hiramatsu wrote:
>
> > Hi Jisheng,
>
> Hi Masami,
>
> >
> > On Tue, 30 Mar 2021 02:16:24 +0800
> > Jisheng Zhang wrote:
> >
> &g
trampoline
address.
Signed-off-by: Masami Hiramatsu
---
arch/x86/include/asm/kprobes.h |6
arch/x86/kernel/kprobes/opt.c | 54
arch/x86/kernel/unwind_orc.c | 15 +--
3 files changed, 72 insertions(+), 3 deletions(-)
diff --git
Add find_kprobe_{insn,optinsn}_slot_entry() functions to find
corresponding entry address of the kprobe instrurction buffer
which includes given address.
Signed-off-by: Masami Hiramatsu
---
include/linux/kprobes.h |8
kernel/kprobes.c| 25 ++---
2
As same as kretprobe_trampoline, move the optprobe template
code in the text for making ORC information on that.
Signed-off-by: Masami Hiramatsu
---
arch/x86/kernel/kprobes/opt.c | 18 +-
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/kprobes
> do_syscall_64+0x33/0x40
=> entry_SYSCALL_64_after_hwframe+0x44/0xae
=> 0
=> 0
Thank you,
---
Masami Hiramatsu (3):
x86/kprobes: Add ORC information to optprobe template
kprobes: Add functions to find instruction buffer entry address
x86/kprobes,orc: Unwind optprobe
0,6 +130,8 @@ skip_context_tracking:
>*/
> andi t0, s1, SR_PIE
> beqz t0, 1f
> + li t0, EXC_BREAKPOINT
> + beq s4, t0, 1f
> #ifdef CONFIG_TRACE_IRQFLAGS
> call trace_hardirqs_on
> #endif
> --
> 2.31.0
>
>
--
Masami Hiramatsu
On Tue, 30 Mar 2021 02:04:16 +0800
Jisheng Zhang wrote:
> From: Jisheng Zhang
>
> Add riscv specific info dump in both handler_pre() and handler_post().
>
Looks good to me.
Acked-by: Masami Hiramatsu
Thanks!
> Signed-off-by: Jisheng Zhang
> ---
> samples/kprobes
On Tue, 30 Mar 2021 02:12:26 +0800
Jisheng Zhang wrote:
> From: Jisheng Zhang
>
> These two functions are used to implement the kprobes feature so they
> can't be kprobed.
>
Looks good to me.
Reviewed-by: Masami Hiramatsu
Thanks,
> Fixes: c22b0bcb1dd0 ("riscv
just making sure it is not set (or set to "auto").
Sorry, it was my mistake. this is the correct tag.
Fixes: 6256e668b7af ("x86/kprobes: Use int3 instead of debug trap for
single-step")
Thanks,
>
> --
> Cheers,
> Stephen Rothwell
--
Masami Hiramatsu
On Fri, 26 Mar 2021 21:28:26 +0900
Masami Hiramatsu wrote:
> Hello,
>
> Here is the 5th version of the series to fix the stacktrace with kretprobe
> on x86. After merging this, I'll fix other architectures.
>
> The previous version is;
>
> htt
ftrace shows "[unknown/kretprobe'd]" indicator all addresses in the
kretprobe_trampoline, but the modified address by kretprobe should
be only kretprobe_trampoline+0.
Signed-off-by: Masami Hiramatsu
Acked-by: Steven Rostedt (VMware)
---
kernel/trace/trace_output.c | 17 --
x5f/0xe0
=> do_syscall_64+0x33/0x40
=> entry_SYSCALL_64_after_hwframe+0x44/0xae
Reported-by: Daniel Xu
Signed-off-by: Masami Hiramatsu
Suggested-by: Josh Poimboeuf
---
Changes in v5:
- Fix the case of interrupt happens on kretprobe_trampoline+0.
Changes in v3:
- Split out the kret
This changes x86/kretprobe stack frame on kretprobe_trampoline
a bit, which now push the kretprobe_trampoline as a fake return
address at the bottom of the stack frame. With this fix, the ORC
unwinder will see the kretprobe_trampoline as a return address.
Signed-off-by: Masami Hiramatsu
Change kretprobe_trampoline to make a space for regs->ARM_pc so that
kretprobe_trampoline_handler can call instruction_pointer_set()
safely.
Signed-off-by: Masami Hiramatsu
---
arch/arm/probes/kprobes/core.c |2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/probes/kprobes/cor
To simplify the stacktrace with pt_regs from kretprobe handler,
set the correct return address to the instruction pointer in
the pt_regs before calling kretprobe handlers.
Suggested-by: Josh Poimboeuf
Signed-off-by: Masami Hiramatsu
---
Changes in v3:
- Cast the correct_ret_addr to unsigned
Add instruction_pointer_set() API for ia64.
Signed-off-by: Masami Hiramatsu
---
Changes in v4:
- Make the API macro for avoiding a build error.
---
arch/ia64/include/asm/ptrace.h |5 +
1 file changed, 5 insertions(+)
diff --git a/arch/ia64/include/asm/ptrace.h b/arch/ia64/include
Add instruction_pointer_set() API for arc.
Signed-off-by: Masami Hiramatsu
---
arch/arc/include/asm/ptrace.h |5 +
1 file changed, 5 insertions(+)
diff --git a/arch/arc/include/asm/ptrace.h b/arch/arc/include/asm/ptrace.h
index 4c3c9be5bd16..cca8d6583e31 100644
--- a/arch/arc/include
seems non-standard. So this marks it
is STACK_FRAME_NON_STANDARD() and undefine UNWIND_HINT_FUNC.
Anyway, with the frame pointer, FP unwinder can unwind the stack
frame correctly without that hint.
Signed-off-by: Josh Poimboeuf
Signed-off-by: Masami Hiramatsu
---
Changes in v4:
- Apply
Add kretprobe_find_ret_addr() for searching correct return address
from kretprobe instance list.
Signed-off-by: Masami Hiramatsu
---
Changes in v3:
- Remove generic stacktrace fixup. Instead, it should be solved in
each unwinder. This just provide the generic interface.
Changes in v2
Remove trampoline_address from kretprobe_trampoline_handler().
Instead of passing the address, kretprobe_trampoline_handler()
can use new kretprobe_trampoline_addr().
Signed-off-by: Masami Hiramatsu
---
Changes in v3:
- Remove wrong kretprobe_trampoline declaration from
arch/x86/include
Replace arch_deref_entry_point() with dereference_function_descriptor()
because those are doing same thing.
Signed-off-by: Masami Hiramatsu
---
arch/ia64/kernel/kprobes.c|5 -
arch/powerpc/kernel/kprobes.c | 11 ---
include/linux/kprobes.h |1 -
kernel/kprobes.c
so changes to use correct symbol dereference function to get the
function address from the kretprobe_trampoline.
Fixes: e792ff804f49 ("ia64: kprobes: Use generic kretprobe trampoline handler")
Signed-off-by: Masami Hiramatsu
---
Changes in v5:
- Fix a compile error typo.
---
arch/i
API.
You can also get this series from
git://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git
kprobes/kretprobe-stackfix-v5
Thank you,
---
Josh Poimboeuf (1):
x86/kprobes: Add UNWIND_HINT_FUNC on kretprobe_trampoline code
Masami Hiramatsu (11):
ia64: kprobes:
On Fri, 26 Mar 2021 03:05:03 +0900
Masami Hiramatsu wrote:
> On Wed, 24 Mar 2021 10:40:58 +0900
> Masami Hiramatsu wrote:
>
> > On Tue, 23 Mar 2021 23:30:07 +0100
> > Peter Zijlstra wrote:
> >
> > > On Mon, Mar 22, 2021 at 03:41:40PM +0900, Masami Hiram
On Wed, 24 Mar 2021 10:40:58 +0900
Masami Hiramatsu wrote:
> On Tue, 23 Mar 2021 23:30:07 +0100
> Peter Zijlstra wrote:
>
> > On Mon, Mar 22, 2021 at 03:41:40PM +0900, Masami Hiramatsu wrote:
> > > ".global kretprobe_trampoline\n"
> > >
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 6dd3b8c9f58816a1354be39559f630cd1bd12159
Gitweb:
https://git.kernel.org/tip/6dd3b8c9f58816a1354be39559f630cd1bd12159
Author:Masami Hiramatsu
AuthorDate:Thu, 25 Mar 2021 19:08:31 +09:00
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 2f706e0e5e263c0d204e37ea496cbb0e98aac2d2
Gitweb:
https://git.kernel.org/tip/2f706e0e5e263c0d204e37ea496cbb0e98aac2d2
Author:Masami Hiramatsu
AuthorDate:Thu, 25 Mar 2021 19:08:43 +09:00
lse.
Fix those by checking each prefix bytes with for_each_insn_prefix
loop and getting the correct attribute for each prefix byte.
Also, this removes unlikely, because this is a slow path.
Fixes: a8d11cd0714f ("kprobes/x86: Consolidate insn decoder users for copying
code")
Signed-off-b
301 - 400 of 10440 matches
Mail list logo