my local tree, to give
> time to Masami and Srikar, ok?
OK, I reviewed all the patches in this series :)
Acked-by: Masami Hiramatsu
for this series.
Thank you!
--
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for Technology Innovation
t; have already been stopped and register states have already been saved.
Ah, nice! I like this idea :)
>
> IOW, is there a reason that we can't get rid of smp_send_stop() and
> use the mechanism crash_kexec() is using to stop cpus after panic()?
own broken so let's
>> just revert the fool thing.
>
> Masami, you introduced this option. Are you fine with the revert? Is it
> really being used and tested?
Actually, it is tested but under very limited situation. I think we
need a clear acceptance criteria, IOW, we need a
; | s390: | TODO |
> | score: | TODO |
> | sh: | TODO |
>
>
--
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for Technology Innovation - Systems Engineering
Hitachi, Ltd., Research & Development
ure will not be supported by the architecture
"will not" sounds like someone's will. I guess it could be "feature is
useless/needless
on the architecture".
Thank you,
--
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for
On 2015/07/21 13:34, Ananth N Mavinakayanahalli wrote:
> On Tue, Jul 21, 2015 at 12:53:07PM +1000, Michael Ellerman wrote:
>> On Sun, 2015-07-19 at 11:21 +0900, Masami Hiramatsu wrote:
>>> On 2015/07/16 19:56, Ananth N Mavinakayanahalli wrote:
>>>> Kprobes uses a
Failed to find blacklist 0001013a3280a000
To fix this bug, this introduces function_entry() macro to
retrieve the entry address from the given function pointer,
and uses it in NOKPROBE_SYMBOL().
Signed-off-by: Masami Hiramatsu
Reported-by: Tony Luck
Cc: Tony Luck
Cc: Fenghua Yu
Cc: Benjamin
Hi Tony, Benjamin and Paul,
I've tried to fix this bug, but since I don't have either ppc64 nor ia64,
this patch is not tested on those archs. Please review and test it on
those machines.
Thank you,
(2014/05/07 20:55), Masami Hiramatsu wrote:
> On ia64 and ppc64, the function poi
(2014/05/08 13:47), Ananth N Mavinakayanahalli wrote:
> On Wed, May 07, 2014 at 08:55:51PM +0900, Masami Hiramatsu wrote:
>
> ...
>
>> +#if defined(CONFIG_PPC64) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
>> +/*
>> + * On PPC64 ABIv1 the function pointer ac
(2014/05/08 15:16), Ananth N Mavinakayanahalli wrote:
> On Thu, May 08, 2014 at 02:40:00PM +0900, Masami Hiramatsu wrote:
>> (2014/05/08 13:47), Ananth N Mavinakayanahalli wrote:
>>> On Wed, May 07, 2014 at 08:55:51PM +0900, Masami Hiramatsu wrote:
>>>
>>> ..
(2014/05/07 20:59), Masami Hiramatsu wrote:
> Hi Tony, Benjamin and Paul,
>
> I've tried to fix this bug, but since I don't have either ppc64 nor ia64,
> this patch is not tested on those archs. Please review and test it on
> those machines.
Ping?
I need your hel
(2014/05/26 20:25), Suzuki K. Poulose wrote:
> On 05/07/2014 05:25 PM, Masami Hiramatsu wrote:
>> On ia64 and ppc64, the function pointer does not point the
>> entry address of the function, but the address of function
>> discriptor (which contains the entry address and mis
symbols instead
of storing it.
- Update for the latest -next.
Signed-off-by: Masami Hiramatsu
Reported-by: Tony Luck
Cc: Suzuki K. Poulose
Cc: Tony Luck
Cc: Fenghua Yu
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Ananth N Mavinakayanahalli
Cc: Kevin Hao
Cc: linux-i...@vger.kernel.org
+2053,8 @@ static int __init
> populate_kprobe_blacklist(unsigned long *start,
> ent = kmalloc(sizeof(*ent), GFP_KERNEL);
> if (!ent)
> return -ENOMEM;
> - ent->start_addr = *iter;
> -
function entry
instead of function descriptor. (Suzuki's work, Thanks!)
Changes in V2:
- Use function_entry() macro when lookin up symbols instead
of storing it.
- Update for the latest -next.
Signed-off-by: Masami Hiramatsu
Signed-off-by: Suzuki K. Poulose
Reported-by: Tony Luc
Ping?
I guess this should go to 3.16 branch, shouldn't it?
(2014/05/30 12:18), Masami Hiramatsu wrote:
> On ia64 and ppc64, the function pointer does not point the
> entry address of the function, but the address of function
> discriptor (which contains the entry address and misc
(2014/06/18 16:56), Michael Ellerman wrote:
> On Fri, 2014-06-06 at 15:38 +0900, Masami Hiramatsu wrote:
>> Ping?
>>
>> I guess this should go to 3.16 branch, shouldn't it?
>
>>> diff --git a/arch/powerpc/include/asm/types.h
>>> b/arch/powerpc
(2014/06/19 10:30), Michael Ellerman wrote:
> On Wed, 2014-06-18 at 17:46 +0900, Masami Hiramatsu wrote:
>> (2014/06/18 16:56), Michael Ellerman wrote:
>>> On Fri, 2014-06-06 at 15:38 +0900, Masami Hiramatsu wrote:
>>>> Ping?
>>>>
>>>&g
(2014/06/19 15:40), Suzuki K. Poulose wrote:
> On 06/19/2014 10:22 AM, Masami Hiramatsu wrote:
>> (2014/06/19 10:30), Michael Ellerman wrote:
>>> On Wed, 2014-06-18 at 17:46 +0900, Masami Hiramatsu wrote:
>>>> (2014/06/18 16:56), Michael Ellerman wrote:
>>&
(2014/06/19 18:45), Suzuki K. Poulose wrote:
> On 06/19/2014 12:56 PM, Masami Hiramatsu wrote:
>> (2014/06/19 15:40), Suzuki K. Poulose wrote:
>>> On 06/19/2014 10:22 AM, Masami Hiramatsu wrote:
>>>> (2014/06/19 10:30), Michael Ellerman wrote:
>>>>&
(2014/06/19 20:01), Masami Hiramatsu wrote:
>>>>> Ah, those messages should be shown in dmesg when booting if it doesn't
>>>>> work,
>>>>> because the messages are printed by initialization process of kprobe
>>>>> blacklist.
>
(2014/06/20 9:37), Michael Ellerman wrote:
> On Thu, 2014-06-19 at 20:20 +0900, Masami Hiramatsu wrote:
>> (2014/06/19 20:01), Masami Hiramatsu wrote:
>>
>>>>>>> Ah, those messages should be shown in dmesg when booting if it doesn't
>>>>
r the latest -next.
Signed-off-by: Masami Hiramatsu
Reported-by: Tony Luck
Tested-by: Tony Luck
Cc: Michael Ellerman
Cc: Suzuki K. Poulose
Cc: Tony Luck
Cc: Fenghua Yu
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Ananth N Mavinakayanahalli
Cc: Kevin Hao
Cc: linux-i...@vger.kernel.o
Ping? :)
(2014/06/20 11:23), Masami Hiramatsu wrote:
> On ia64 and ppc64, the function pointer does not point the
> entry address of the function, but the address of function
> discriptor (which contains the entry address and misc
> data.) Since the kprobes passes the function pointer
(2014/06/30 20:36), Michael Ellerman wrote:
> On Mon, 2014-06-30 at 12:14 +0900, Masami Hiramatsu wrote:
>> Ping? :)
>
> Yeah sorry. I started looking at this and got dragged into another mess.
>
> You seem to have duplicated the functionality of arch_deref_entry_point(),
&
(2014/07/02 13:41), Michael Ellerman wrote:
> On Tue, 2014-07-01 at 11:21 +0900, Masami Hiramatsu wrote:
>> (2014/06/30 20:36), Michael Ellerman wrote:
>>> On Mon, 2014-06-30 at 12:14 +0900, Masami Hiramatsu wrote:
>>>> Ping? :)
>>>
>>> Yeah sorry
Since PowerPC64 ABIv2 doesn't have function descriptor
any more, arch_deref_entry_point(), which returns function
entry point from function descriptor, should be updated.
Signed-off-by: Masami Hiramatsu
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Anoop Thomas Mathew
Cc: Jiri Kosin
- Use function_entry() macro when lookin up symbols instead
of storing it.
- Update for the latest -next.
Signed-off-by: Masami Hiramatsu
Reported-by: Tony Luck
Tested-by: Tony Luck
Cc: Michael Ellerman
Cc: Suzuki K. Poulose
Cc: Tony Luck
Cc: Fenghua Yu
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerra
(2014/07/02 15:56), Michael Ellerman wrote:
> On Wed, 2014-07-02 at 15:39 +0900, Masami Hiramatsu wrote:
>> (2014/07/02 13:41), Michael Ellerman wrote:
>>> On Tue, 2014-07-01 at 11:21 +0900, Masami Hiramatsu wrote:
>>>> (2014/06/30 20:36), Michael Ellerman wrote:
>
(2014/07/02 16:00), Masami Hiramatsu wrote:
> Since PowerPC64 ABIv2 doesn't have function descriptor
> any more, arch_deref_entry_point(), which returns function
> entry point from function descriptor, should be updated.
Please ignore this patch, since it is already fixed by
Ping?
This patch can be applied without 1/2, and will fix ia64/ppc64 problem.
Thank you,
(2014/07/02 16:00), Masami Hiramatsu wrote:
> On ia64 and ppc64, the function pointer does not point the
> entry address of the function, but the address of function
> discriptor (which contains
(2014/07/15 11:11), Michael Ellerman wrote:
> On Mon, 2014-07-14 at 10:17 -0700, Tony Luck wrote:
>> On Tue, Jul 8, 2014 at 5:07 AM, Masami Hiramatsu
>> wrote:
>>> Ping?
>>>
>>> This patch can be applied without 1/2, and will fix ia64/ppc64 problem.
>
(2014/07/15 16:16), Benjamin Herrenschmidt wrote:
> On Tue, 2014-07-15 at 13:19 +1000, Michael Ellerman wrote:
>
>>> Signed-off-by: Masami Hiramatsu
>>> Reported-by: Tony Luck
>>> Tested-by: Tony Luck
>>> Cc: Michael Ellerman
>>
>> Test
(2014/07/16 22:28), Ingo Molnar wrote:
>
> * Masami Hiramatsu wrote:
>
>> (2014/07/15 16:16), Benjamin Herrenschmidt wrote:
>>> On Tue, 2014-07-15 at 13:19 +1000, Michael Ellerman wrote:
>>>
>>>>> Signed-off-by: Masami Hiramatsu
>>
- Use function_entry() macro when lookin up symbols instead
of storing it.
- Update for the latest -next.
Signed-off-by: Masami Hiramatsu
Signed-off-by: Suzuki K. Poulose
Reported-by: Tony Luck
Tested-by: Tony Luck
Tested-by: Michael Ellerman
Acked-by: Michael Ellerman (for powerpc)
Acked-by: Ben
(2014/07/17 18:38), Ingo Molnar wrote:
>
> * Masami Hiramatsu wrote:
>
>> Signed-off-by: Masami Hiramatsu
>> Signed-off-by: Suzuki K. Poulose
>
> Looks good, but this is not a valid SOB sequence: if Suzuki wrote the
> patch then he should be the first SOB (
(2014/07/17 20:17), Masami Hiramatsu wrote:
> (2014/07/17 18:38), Ingo Molnar wrote:
>>
>> * Masami Hiramatsu wrote:
>>
>>> Signed-off-by: Masami Hiramatsu
>>> Signed-off-by: Suzuki K. Poulose
>>
>> Looks good, but this is not a valid SOB seq
atest -next.
Signed-off-by: Masami Hiramatsu
Fixed-by: Suzuki K. Poulose
Reported-by: Tony Luck
Tested-by: Tony Luck
Tested-by: Michael Ellerman
Acked-by: Michael Ellerman (for powerpc)
Acked-by: Benjamin Herrenschmidt
Cc: Fenghua Yu
Cc: Paul Mackerras
Cc: Ananth N Mavinakayanahalli
Cc: Ke
> @@ -1009,10 +1027,9 @@ static int parse_perf_probe_point(char *arg, struct
>> perf_probe_event *pev)
>> if (tmp == NULL)
>> return -ENOMEM;
>>
>> -/* Check arg is function or file and copy it */
>> -if (strchr(tmp, '.')) /
ftrace_function() to
> identify the filter IP.
This looks good to me.
Acked-by: Masami Hiramatsu
Thank you!
>
> Signed-off-by: Naveen N. Rao
> ---
> kernel/kprobes.c | 10 +-
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/kpro
* If pre_handler returns !0, it changes regs->nip. We have to
> @@ -57,6 +82,11 @@ NOKPROBE_SYMBOL(kprobe_ftrace_handler);
>
> int arch_prepare_kprobe_ftrace(struct kprobe *p)
> {
> + if ((unsigned long)p->addr & 0x03) {
> + printk("Attempt to register kprobe at an unaligned address\n");
> + return -EILSEQ;
> + }
> +
> p->ainsn.insn = NULL;
> p->ainsn.boostable = -1;
> return 0;
> --
> 2.22.0
>
--
Masami Hiramatsu
k_ftrace_location()
>
> In addition, we update kprobe_ftrace_handler() to detect this scenarios
> and to pass the proper nip to the pre and post probe handlers.
>
> Signed-off-by: Naveen N. Rao
Looks good to me.
Reviewed-by: Masami Hiramatsu
Thank you!
> ---
> arch/po
el Ellerman
> Cc: Heiko Carstens
> Cc: Vasily Gorbik
> Cc: Christian Borntraeger
> Cc: Yoshinori Sato
> Cc: Rich Felker
> Cc: "David S. Miller"
> Cc: Thomas Gleixner
> Cc: Ingo Molnar
> Cc: Borislav Petkov
> Cc: "H. Peter Anvin"
> Cc: &
his enables stud
> >> definitions for generic kporbe_fault_handler() and kprobes_built_in() can
> >> just be dropped. Only on x86 it needs to be added back locally as it gets
> >> used in a !CONFIG_KPROBES function do_general_protection().
> >
> > If you want to remove kprobes_built_in(), you should replace it with
> > IS_ENABLED(CONFIG_KPROBES), instead of this...
>
> Apart from kprobes_built_in() the intent was to remove !CONFIG_KPROBES
> stub for kprobe_fault_handler() as well which required making generic
> kprobe_page_fault() to be empty in such case.
No, I meant that "IS_ENABLED(CONFIG_KPROBES)" is generic and is equal to
what kprobes_built_in() does.
Thank you,
--
Masami Hiramatsu
asm-generic header (Will);
> * Used APIs to access pt_regs elements (Will);
> * Fixed typos in the comments (Will).
This looks good to me.
Reviewed-by: Masami Hiramatsu
Thank you!
>
>
> Leo Yan (3):
> error-injection: Consolidate override function defi
_2(bpf_override_return, struct pt_regs *, regs, unsigned long, rc)
> {
> regs_set_return_value(regs, rc);
> - override_function_with_return(regs);
> + instruction_pointer_set(regs, (unsigned long)&just_return_func);
> return 0;
> }
>
> diff --git a/lib/error-inject.c b/lib/error-inject.c
> index c0d4600f4896..7fdc92b5babc 100644
> --- a/lib/error-inject.c
> +++ b/lib/error-inject.c
> @@ -20,6 +20,14 @@ struct ei_entry {
> void *priv;
> };
>
> +asm(
> + ".type just_return_func, @function\n"
> + ".globl just_return_func\n"
> + "just_return_func:\n"
> + ARCH_FUNC_RET "\n"
> + ".size just_return_func, .-just_return_func\n"
> +);
> +
> bool within_error_injection_list(unsigned long addr)
> {
> struct ei_entry *ent;
> --
> 2.17.0
>
--
Masami Hiramatsu
On Thu, 31 May 2018 15:39:03 +0530
"Naveen N. Rao" wrote:
> Masami Hiramatsu wrote:
> > On Tue, 29 May 2018 18:06:02 +0530
> > "Naveen N. Rao" wrote:
> >
> >> We already have an arch-independent way to set the instruction pointer
> >>
Remove arch dependent setjump/longjump functions
and unused fields in kprobe_ctlblk for jprobes
from arch/powerpc. This also reverts commits
related __is_active_jprobe() function.
Signed-off-by: Masami Hiramatsu
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: "Nav
Don't call the ->break_handler() from the arm kprobes code,
because it was only used by jprobes which got removed.
This also makes skip_singlestep() a static function since
only ftrace-kprobe.c is using this function.
Signed-off-by: Masami Hiramatsu
Cc: Benjamin Herrenschmidt
powerpc and x86, this removes all preempt_disable
from kprobe_ftrace_handler because ftrace callbacks are
called under preempt disabled.
Signed-off-by: Masami Hiramatsu
Cc: Vineet Gupta
Cc: Russell King
Cc: Catalin Marinas
Cc: Will Deacon
Cc: Tony Luck
Cc: Fenghua Yu
Cc: Ralf Baechle
Cc
On Thu, 07 Jun 2018 17:01:23 +0530
"Naveen N. Rao" wrote:
> Masami Hiramatsu wrote:
> > Remove arch dependent setjump/longjump functions
> > and unused fields in kprobe_ctlblk for jprobes
> > from arch/powerpc. This also reverts commits
> > related __is_acti
On Thu, 07 Jun 2018 17:07:00 +0530
"Naveen N. Rao" wrote:
> Masami Hiramatsu wrote:
> > Don't call the ->break_handler() from the arm kprobes code,
> ^^^ powerpc
>
> > because it was only used by jprobes whic
On Thu, 07 Jun 2018 22:07:26 +0530
"Naveen N. Rao" wrote:
> Masami Hiramatsu wrote:
> > On Thu, 07 Jun 2018 17:07:00 +0530
> > "Naveen N. Rao" wrote:
> >
> >> Masami Hiramatsu wrote:
> >> &
Remove arch dependent setjump/longjump functions
and unused fields in kprobe_ctlblk for jprobes
from arch/powerpc. This also reverts commits
related __is_active_jprobe() function.
Signed-off-by: Masami Hiramatsu
Acked-by: "Naveen N. Rao"
Cc: Benjamin Herrenschmidt
Cc: Paul Mac
Don't call the ->break_handler() from the powerpc kprobes code,
because it was only used by jprobes which got removed.
This also removes skip_singlestep() and embeds it in the
caller, kprobe_ftrace_handler(), which simplifies regs->nip
operation around there.
Signed-off-by: Masam
powerpc and x86, this removes all preempt_disable
from kprobe_ftrace_handler because ftrace callbacks are
called under preempt disabled.
Signed-off-by: Masami Hiramatsu
Acked-by: "Naveen N. Rao"
Cc: Vineet Gupta
Cc: Russell King
Cc: Catalin Marinas
Cc: Will Deacon
Cc: Tony Luck
C
t allow creating kprobes, right?
>
> That is; I don't think CAP_SYS_PERFMON should be allowed to create
> kprobes.
>
> As might be clear; I don't actually know what the user-ABI is for
> creating kprobes.
There are 2 ABIs nowadays, ftrace and ebpf. perf-probe uses ftrace interface to
define new kprobe events, and those events are treated as completely same as
tracepoint events. On the other hand, ebpf tries to define new probe event
via perf_event interface. Above one is that interface. IOW, it creates new
kprobe.
Thank you,
--
Masami Hiramatsu
On Fri, 10 Jan 2020 13:45:31 -0300
Arnaldo Carvalho de Melo wrote:
> Em Sat, Jan 11, 2020 at 12:52:13AM +0900, Masami Hiramatsu escreveu:
> > On Fri, 10 Jan 2020 15:02:34 +0100 Peter Zijlstra
> > wrote:
> > > Again, this only allows attaching to previously created kp
t"
>
> From: Arnaldo Carvalho de Melo
> Message-ID:
>
> On January 10, 2020 9:23:27 PM GMT-03:00, Song Liu
> wrote:
> >
> >
> >> On Jan 10, 2020, at 3:47 PM, Masami Hiramatsu
> >wrote:
> >>
> >> On Fri, 10 Jan 2020 13:45:31 -0
ude
>
> DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
> @@ -264,6 +265,9 @@ int kprobe_handler(struct pt_regs *regs)
> if (user_mode(regs))
> return 0;
>
> + if (!(regs->msr & MSR_IR))
> + addr = phys_to_virt(regs->nip);
> +
> /*
>* We don't want to be preempted for the entire
>* duration of kprobe processing
> --
> 2.25.0
>
--
Masami Hiramatsu
On Sat, 15 Feb 2020 11:28:49 +0100
Christophe Leroy wrote:
> Hi,
>
> Le 14/02/2020 à 14:54, Masami Hiramatsu a écrit :
> > Hi,
> >
> > On Fri, 14 Feb 2020 12:47:49 + (UTC)
> > Christophe Leroy wrote:
> >
> >> When a program check exceptio
On Mon, 17 Feb 2020 10:03:22 +0100
Christophe Leroy wrote:
>
>
> Le 16/02/2020 à 13:34, Masami Hiramatsu a écrit :
> > On Sat, 15 Feb 2020 11:28:49 +0100
> > Christophe Leroy wrote:
> >
> >> Hi,
> >>
> >> Le 14/02/2020 à 14:54, Masami Hi
On Mon, 17 Feb 2020 16:38:50 +0100
Christophe Leroy wrote:
>
>
> Le 17/02/2020 à 11:27, Masami Hiramatsu a écrit :
> > On Mon, 17 Feb 2020 10:03:22 +0100
> > Christophe Leroy wrote:
> >
> >>
> >>
> >> Le 16/02/2020 à 13:34, Masami Hirama
s it. If not, it returns
> 0 to tell "it's no me". You are also talking about incrementing the
> missed count. Who do we do that ?
I rather like your first patch. If there is a kprobes, we can not skip
the instruction, because there is an instruction which must be executed.
(or single-skipped, but I'm not sure the emulator works correctly on
real mode)
Thank you,
>
>
>
> @@ -264,6 +265,13 @@ int kprobe_handler(struct pt_regs *regs)
> if (user_mode(regs))
> return 0;
>
> +if (!(regs->msr & MSR_IR)) {
> +if (!get_kprobe(phys_to_virt(regs->nip)))
> +return 0;
> +regs->nip += 4;
> +return 1;
> +}
> +
> /*
>* We don't want to be preempted for the entire
>* duration of kprobe processing
>
>
> >
> > BTW, can the emulater handle the real mode code correctly?
>
> I don't know, how do I test that ?
>
> Christophe
--
Masami Hiramatsu
> What do you think about my latest proposal below ? If a trap is
> >> encoutered in real mode, if checks if the matching virtual address
> >> corresponds to a valid kprobe. If it is, it skips it. If not, it returns
> >> 0 to tell "it's no me". You are also talking about incrementing the
> >> missed count. Who do we do that ?
> >
> > I rather like your first patch. If there is a kprobes, we can not skip
> > the instruction, because there is an instruction which must be executed.
> > (or single-skipped, but I'm not sure the emulator works correctly on
> > real mode)
>
> Oops, yes of course.
Thank you,
--
Masami Hiramatsu
red to handle events in real mode and functions
> running in real mode should have been blacklisted, so kprobe_handler()
> can safely bail out telling 'this trap is not mine' for any trap that
> happened while in real-mode.
>
> If the trap happened with MSR_IR or MSR_D
Add kernel_trap_sp() on powerpc, based on systemtap's runtime/regs.h.
Signed-off-by: Masami Hiramatsu
---
arch/powerpc/include/asm/ptrace.h |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/include/asm/ptrace.h
b/arch/powerpc/include/asm/ptrace.h
Ananth N Mavinakayanahalli wrote:
> On Fri, Mar 20, 2009 at 04:42:40PM +1100, Benjamin Herrenschmidt wrote:
>> On Thu, 2009-03-19 at 17:10 -0400, Masami Hiramatsu wrote:
>>> Add kernel_trap_sp() on powerpc, based on systemtap's runtime/regs.h.
>>>
>>> Sign
OFFSET_NAME(trap),
>> +REG_OFFSET_NAME(dar),
>> +REG_OFFSET_NAME(dsisr),
>> +REG_OFFSET_NAME(result),
>> + REG_OFFSET_END,
>
> Do we need to add something for FP and VMX registers here?
Hmm, are FP and VMX registers actually u
https://lists.ozlabs.org/listinfo/linuxppc-dev
>>>>>
>>> Thanks for reviewing.
>>
>> We are creating a new user space API here, so I'm keen for others to take
>> a good look at the interface before we commit to something we are
Enable kprobes-based dynamic events"
>>>>>>> select TRACING
>>>>>>> default y
>>>>>>>
>>>>>>> ___
>>>>>>> Linuxppc-dev mailing lis
Drop function argument access syntax, because the function arguments
are depends on not only architecture but also compile-options and
function API. And now, we have perf-probe for finding register/memory
assigned to each argument.
Signed-off-by: Masami Hiramatsu
Cc: Ingo Molnar
Cc: Frederic
Because of dropping function argument syntax from kprobe-tracer,
we don't need this API anymore.
Signed-off-by: Masami Hiramatsu
Cc: Ingo Molnar
Cc: Frederic Weisbecker
Cc: Roland McGrath
Cc: Oleg Nesterov
Cc: Mahesh Salgaonkar
Cc: Benjamin Herrenschmidt
Cc: Michael Neuling
Cc: S
t; 2.6.33-git10(64ba99267...) was OK.
>>>
>>> This WARN_ON was introduced by commit 4610ee1d36...
>>>
>>> kprobes: Introduce generic insn_slot framework
>>
>> FWIW, same on s390...
>
> This patch should fix it:
>
str(n) get_arch_regstr(n)
If we checked above dwarf support, we don't need this odd macro.
> +
> +#endif
> diff --git a/tools/perf/arch/x86/util/dwarf-regs.c
> b/tools/perf/arch/x86/util/dwarf-regs.c
> new file mode 100644
> index 000..a794d30
> --- /dev/null
> +++ b/tools/perf
; --- /dev/null
> +++ b/tools/perf/arch/powerpc/include/arch_dwarf-regs.h
> @@ -0,0 +1,6 @@
> +#ifndef _PREF_ARCH_X86_DWARF_REGS_H
> +#define _PREF_ARCH_X86_DWARF_REGS_H
_PREF_ARCH_PPC_DWARF_REGS_H? :)
> +
> +#define get_arch_regstr(n) get_arch_regstr(n)
> +
> +#endif
Thank you,
--
Masam
ou to drop dwarf
support if dwarf-regs mapping doesn't exist.
AFAIK, at this point, only s390 users are affected. I'd like to ask
them to just port a register mapping on perf and test it too.
Thank you,
--
Masami Hiramatsu
e-mail: mhira...@redhat.com
___
Heiko Carstens wrote:
> On Wed, Apr 14, 2010 at 07:46:12AM -0700, Masami Hiramatsu wrote:
>> Ian Munsie wrote:
>>> From: Ian Munsie
>>>
>>> The perf userspace tool included some architecture specific code to map
>>> registers from the DWARF register n
a separate
> arch/x86 directory along with the infrastructure required to use it.
>
> Signed-off-by: Ian Munsie
Good work!
Acked-by: Masami Hiramatsu
Thank you very much!
> ---
> Changes since v2: From Masami Hiramatsu's feedback DWARF support is disabled
> altogether if
s on functionality in the powerpc/next tree, though it
> will compile fine without it. Specifically this patch depends on commit
> "powerpc: Add kprobe-based event tracer"
>
> Signed-off-by: Ian Munsie
Acked-by: Masami Hiramatsu
Thank you!
> ---
> tools/perf/arch/powe
Hi Ian,
Please feel free to add my ack. :)
Acked-by: Masami Hiramatsu
Ingo, I think this one is important enhancement for perf
to port it on other archs.
Thank you,
Ian Munsie wrote:
> From: Ian Munsie
>
> The perf userspace tool included some architecture specific code to map
&g
s on functionality in the powerpc/next tree, though it
> will compile fine without it. Specifically this patch depends on commit
> "powerpc: Add kprobe-based event tracer"
>
> Signed-off-by: Ian Munsie
Acked-by: Masami Hiramatsu
> ---
> Changes since v3:
> * Fi
20-5cde06e-powerpc/tmp/sysroots/powerpc
>> --disable-libunwind-exceptions --disable-libssp --disable-libgomp
>> --disable-libmudflap
>> --with-mpfr=/opt/poky/build/eldk-2011-05-20-5cde06e-powerpc/tmp/sysroots/i686-oesdk-linux-nativesdk
>> --with-mpc=/opt/poky/build/eld
ONFIG_MODULES
> /* Module notifier call back, checking event on the module */
> static int trace_kprobe_module_callback(struct notifier_block *nb,
> unsigned long val, void *data)
> @@ -704,6 +712,7 @@ static struct notifier_block trace_kprobe_module_nb = {
> .notifier_call = trace_kprobe_module_callback,
> .priority = 1 /* Invoked after kprobe module callback */
> };
> +#endif
>
> static int count_symbols(void *data, unsigned long unused)
> {
> @@ -1933,8 +1942,10 @@ static __init int init_kprobe_trace_early(void)
> if (ret)
> return ret;
>
> +#ifdef CONFIG_MODULES
> if (register_module_notifier(&trace_kprobe_module_nb))
> return -EINVAL;
> +#endif
>
> return 0;
> }
> --
> 2.43.0
>
>
--
Masami Hiramatsu
obe_ctlblk *kcb;
> + int bit;
>
> - /* Preempt is disabled by ftrace */
> + bit = ftrace_test_recursion_trylock();
> + if (bit < 0)
> + return;
> +
> + preempt_disable_notrace();
> p = get_kprobe((kprobe_opcode_t *)ip);
> if (unlikely(!p) || kprobe_disabled(p))
> - return;
> + goto out;
>
> kcb = get_kprobe_ctlblk();
> if (kprobe_running()) {
> @@ -52,6 +57,9 @@ void kprobe_ftrace_handler(unsigned long ip, unsigned long
> parent_ip,
>*/
> __this_cpu_write(current_kprobe, NULL);
> }
> +out:
> + preempt_enable_notrace();
> + ftrace_test_recursion_unlock(bit);
> }
> NOKPROBE_SYMBOL(kprobe_ftrace_handler);
>
> --
> 2.28.0
>
>
--
Masami Hiramatsu
On Thu, 29 Oct 2020 09:40:01 -0400
Steven Rostedt wrote:
> On Thu, 29 Oct 2020 16:58:03 +0900
> Masami Hiramatsu wrote:
>
> > Hi Steve,
> >
> > On Wed, 28 Oct 2020 07:52:49 -0400
> > Steven Rostedt wrote:
> >
> > > From: "Steven Rostedt
nel.org/r/20201028115613.140212...@goodmis.org
>
> Cc: Andrew Morton
> Cc: Masami Hiramatsu
> Cc: Guo Ren
> Cc: "James E.J. Bottomley"
> Cc: Helge Deller
> Cc: Michael Ellerman
> Cc: Benjamin Herrenschmidt
> Cc: Paul Mackerras
> Cc: Heiko Carstens
&
ttps://lkml.kernel.org/r/20201028115613.140212...@goodmis.org
>
Looks good to me.
Acked-by: Masami Hiramatsu
Thank you!
> Cc: Andrew Morton
> Cc: Masami Hiramatsu
> Cc: Guo Ren
> Cc: "James E.J. Bottomley"
> Cc: Helge Deller
> Cc: Michael Ellerman
> Cc: Benjami
sn_page(), that
> fall back on alloc_insn_page() and free_insn_page() when not
> overriden by the architecture.
>
Looks good to me :)
Acked-by: Masami Hiramatsu
> Suggested-by: Masami Hiramatsu
> Signed-off-by: Christophe Leroy
> ---
> kernel/kprobes.c | 14 --
&g
s, extable: Identify
> kprobes trampolines as kernel text area")
>
This looks good to me.
Acked-by: Masami Hiramatsu
> Suggested-by: Masami Hiramatsu
> Signed-off-by: Christophe Leroy
> ---
> arch/powerpc/kernel/optprobes.c | 23 +--
> 1 file c
rnel/kprobes.c:329:13: warning: no previous prototype for
> >> 'free_optinsn_page' [-Wmissing-prototypes]
> 329 | void __weak free_optinsn_page(void *page)
> | ^
Ah, we need a prototype for those in include/linux/kprobes.h
as same as alloc_insn_page() and free_insn_page().
Thank you,
--
Masami Hiramatsu
es text happens to be in arch specific code.
>
> If you want something special for ftrace, you could just add your own
> function. But for x86, a text_alloc_immediate() would work.
> (BTW, I like the function names over the enums)
kprobes will need the text_alloc_immediate() too, since it will use
the trampoline buffer where jumps to/from kernel code/modules.
Thanks,
--
Masami Hiramatsu
gt; @@ -814,7 +904,7 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned
> long old_addr,
> /*
>* Out of range jumps are called from modules.
>*/
> - if (!rec->arch.mod) {
> + if (!ftrace_mod_addr_get(rec)) {
> pr_err("No module loaded\n");
> return -EINVAL;
> }
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index f9feb197b2daaf..68f20cf34b0c47 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -1510,6 +1510,7 @@ ftrace_ops_test(struct ftrace_ops *ops, unsigned long
> ip, void *regs)
> }
>
>
> +#ifndef ftrace_cmp_recs
> static int ftrace_cmp_recs(const void *a, const void *b)
> {
> const struct dyn_ftrace *key = a;
> @@ -1521,6 +1522,7 @@ static int ftrace_cmp_recs(const void *a, const void *b)
> return 1;
> return 0;
> }
> +#endif
>
> static struct dyn_ftrace *lookup_rec(unsigned long start, unsigned long end)
> {
> --
> 2.35.1
>
--
Masami Hiramatsu
opcode_t *)ftrace_addr;
As I said, this must be
if (ftrace_addr != addr)
return -EILSEQ;
This will prevent users from being confused by the results of probing
that 'func' and 'func+4' are the same. (now only 'func' is allowed to
be probed.)
Thank you,
> +#endif
> +
> if (addr)
> return addr;
>
> --
> 2.35.1
>
--
Masami Hiramatsu
On Mon, 6 Mar 2017 23:19:09 +0530
"Naveen N. Rao" wrote:
> Masami,
> Your patch works, thanks! However, I felt we could refactor and reuse
> some of the code across kprobes.c for this purpose. Can you please see
> if the below patch is fine?
OK, looks good to me:)
Acke
On Mon, 6 Mar 2017 20:34:10 +0530
"Naveen N. Rao" wrote:
> On 2017/03/04 09:49AM, Masami Hiramatsu wrote:
> > On Thu, 2 Mar 2017 23:25:06 +0530
> > "Naveen N. Rao" wrote:
> >
> > > We indicate support for accepting sym+offset with kretprobe
gt; + free(buf);
> +
> +result:
> + if (type >= FTRACE_README_END)
> + return false;
> +
> + return ftrace_readme_table[type].avail;
> +}
> +
> +bool kretprobe_offset_is_supported(void)
> +{
> + return scan_ftrace_readme(FTRACE_README_KRETPROBE_OFFSET);
> +}
> +
> +bool probe_type_x_is_supported(void)
> +{
> + return scan_ftrace_readme(FTRACE_README_PROBE_TYPE_X);
> +}
> diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
> index 1fbc044f9eb0..ecda2d822daf 100644
> --- a/tools/perf/util/trace-event.h
> +++ b/tools/perf/util/trace-event.h
> @@ -37,6 +37,10 @@ int parse_ftrace_file(struct pevent *pevent, char *buf,
> unsigned long size);
> int parse_event_file(struct pevent *pevent,
>char *buf, unsigned long size, char *sys);
>
> +int open_trace_file(const char *trace_file, bool readwrite);
> +bool kretprobe_offset_is_supported(void);
> +bool probe_type_x_is_supported(void);
> +
> unsigned long long
> raw_field_value(struct event_format *event, const char *name, void *data);
>
> --
> 2.11.1
>
--
Masami Hiramatsu
strglobmatch(buf,
> ftrace_readme_table[i].pattern);
> + scanned = true;
> +
> + fclose(fp);
> + free(buf);
> +
> +result:
> + if (type >= FTRACE_README_END)
> + return false;
> +
> + return ftrace_readme_table[type].avail;
> +}
> +
> +bool kretprobe_offset_is_supported(void)
> +{
> + return scan_ftrace_readme(FTRACE_README_KRETPROBE_OFFSET);
> +}
> +
> +bool probe_type_x_is_supported(void)
> +{
> + return scan_ftrace_readme(FTRACE_README_PROBE_TYPE_X);
> +}
> diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
> index 1fbc044f9eb0..ecda2d822daf 100644
> --- a/tools/perf/util/trace-event.h
> +++ b/tools/perf/util/trace-event.h
> @@ -37,6 +37,10 @@ int parse_ftrace_file(struct pevent *pevent, char *buf,
> unsigned long size);
> int parse_event_file(struct pevent *pevent,
>char *buf, unsigned long size, char *sys);
>
> +int open_trace_file(const char *trace_file, bool readwrite);
> +bool kretprobe_offset_is_supported(void);
> +bool probe_type_x_is_supported(void);
> +
> unsigned long long
> raw_field_value(struct event_format *event, const char *name, void *data);
>
> --
> 2.11.1
>
--
Masami Hiramatsu
r
> forces inlining, in which case the caller needs to be added to
> NOKPROBE_SYMBOL().
Acked-by: Masami Hiramatsu
OK, this is a good starting point so far. please consider that those
functions really have to be protected by kprobes. As you can see on x86,
I allowed some functions t
it only
> if the kernel supports specifying offsets with kretprobes.
Acked-by: Masami Hiramatsu
This patch is OK. And I found that most of functions in sym-handling.c
are used only when libelf is supported. (e.g. probe-event.c itself
is not built when we have no libelf)
So, for the next clean
1 - 100 of 181 matches
Mail list logo