public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	rostedt@goodmis.org, fweisbec@gmail.com, rusty@rustcorp.com.au,
	ananth@in.ibm.com, anil.s.keshavamurthy@intel.com,
	jbaron@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org,
	"yrl.pp-manager.tt@hitachi.com" <yrl.pp-manager.tt@hitachi.com>
Subject: Re: [PATCH 3/5] kprobes: constify check_kprobe_address_safe and friends
Date: Thu, 24 Jan 2013 23:09:10 -0500	[thread overview]
Message-ID: <51020566.6040408@oracle.com> (raw)
In-Reply-To: <50FD2B30.20100@hitachi.com>

Hello Masami,

Thank you for your review!

My comments are below.

On 01/21/2013 06:49 AM, Masami Hiramatsu wrote:
> (2013/01/10 8:09), Sasha Levin wrote:
>> @@ -278,7 +278,7 @@ static int __kprobes can_optimize(unsigned long paddr)
>>  }
>>  
>>  /* Check optimized_kprobe can actually be optimized. */
>> -int __kprobes arch_check_optimized_kprobe(struct optimized_kprobe *op)
>> +int __kprobes arch_check_optimized_kprobe(const struct optimized_kprobe *op)
>>  {
>>  	int i;
>>  	struct kprobe *p;
> 
> This can be change optimized_kprobe inside, e.g. change flags.
> IMHO, I don't like to change this interface.

[snip]

>> -static __kprobes int check_kprobe_address_safe(struct kprobe *p,
>> +static __kprobes int check_kprobe_address_safe(const struct kprobe *p,
>>  					       struct module **probed_mod)
>>  {
>>  	int ret = 0;
>>
> 
> No, p is NOT constant in this function. This changes p->flags.
> 
> ---
> #ifdef KPROBES_CAN_USE_FTRACE
>                 /* Given address is not on the instruction boundary */
>                 if ((unsigned long)p->addr != ftrace_addr)
>                         return -EILSEQ;
>                 p->flags |= KPROBE_FLAG_FTRACE;
> #else   /* !KPROBES_CAN_USE_FTRACE */

As to arch_check_optimized_kprobe() and check_kprobe_address_safe(), this
is simply way too confusing. It doesn't make sense that a function named
check_[...]() would modify any of it's parameters.

For example, that entire block within KPROBES_CAN_USE_FTRACE should be split
out and go into update_kprobe_for_ftrace() or something similar.

If that makes sense, I can send a patch to split out all the parts that
modify anything in those two functions out of them.


Thanks,
Sasha

  reply	other threads:[~2013-01-25  4:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09 23:09 [PATCH 1/5] module: constify within_module_* Sasha Levin
2013-01-09 23:09 ` [PATCH 2/5] jump label: constify lookup functions Sasha Levin
2013-01-15 20:46   ` Sasha Levin
2013-01-15 23:19     ` Steven Rostedt
2013-01-18 21:25   ` Steven Rostedt
2013-01-21  6:51     ` Rusty Russell
2013-01-25  4:15     ` Sasha Levin
2013-01-25 10:16       ` Borislav Petkov
2013-01-25 13:03         ` Steven Rostedt
2013-01-18 21:25   ` Steven Rostedt
2013-01-09 23:09 ` [PATCH 3/5] kprobes: constify check_kprobe_address_safe and friends Sasha Levin
2013-01-21 11:49   ` Masami Hiramatsu
2013-01-25  4:09     ` Sasha Levin [this message]
2013-01-29 11:45       ` Masami Hiramatsu
2013-01-09 23:09 ` [PATCH 4/5] alternatives: constify alternatives_text_reserved Sasha Levin
2013-01-21 11:38   ` Masami Hiramatsu
2013-01-09 23:09 ` [PATCH 5/5] ftrace: constify ftrace_text_reserved Sasha Levin
2013-01-10  9:02 ` [PATCH 1/5] module: constify within_module_* Rusty Russell

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=51020566.6040408@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yrl.pp-manager.tt@hitachi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox