[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201119090758.02e0bafa@gandalf.local.home>
Date: Thu, 19 Nov 2020 09:07:58 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Petr Mladek <pmladek@...e.com>
Cc: linux-kernel@...r.kernel.org,
Masami Hiramatsu <mhiramat@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Jiri Kosina <jikos@...nel.org>, Miroslav Benes <mbenes@...e.cz>
Subject: Re: [PATCH 1/3 v7] ftrace: Have the callbacks receive a struct
ftrace_regs instead of pt_regs
On Thu, 19 Nov 2020 12:05:44 +0100
Petr Mladek <pmladek@...e.com> wrote:
> > void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
> > - struct ftrace_ops *ops, struct pt_regs *regs)
> > + struct ftrace_ops *ops, struct ftrace_regs *fregs)
> > {
> > int bit;
> > bool lr_saver = false;
> > struct kprobe *p;
> > struct kprobe_ctlblk *kcb;
> > + struct pt_regs *regs;
> >
> > bit = ftrace_test_recursion_trylock(ip, parent_ip);
> > if (bit < 0)
> > return;
> >
> > + regs = ftrace_get_regs(fregs);
>
> Should we check for NULL here?
> Same in all callers?
If regs is NULL that's a major bug.
It's no different than what we have today. If you set FL_SAVE_REGS, then
the regs parameter will have regs. If you don't, it will be NULL. We don't
check regs for NULL today, so we shouldn't need to check regs for NULL with
this.
One of my bootup tests checks if this works. I work hard to make sure that
regs is set for everything that wants it, otherwise bad things happen.
In other words, the functionality in this regard hasn't changed with this
patch.
-- Steve
>
> > preempt_disable_notrace();
> > p = get_kprobe((kprobe_opcode_t *)ip);
> > if (!p) {
>
> Otherwise, the patch is pretty strightforard and looks good to me.
Powered by blists - more mailing lists