public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] x86: Unify cosmetic kprobes{32|64}.c
Date: Mon, 17 Dec 2007 10:16:16 -0500	[thread overview]
Message-ID: <476692C0.7020802@redhat.com> (raw)
In-Reply-To: <1197674207.898.72.camel@brick>

Hi Harvey,

Harvey Harrison wrote:
> diff --git a/arch/x86/kernel/kprobes_32.c b/arch/x86/kernel/kprobes_32.c
> index f4ba584..2a8acd6 100644
> --- a/arch/x86/kernel/kprobes_32.c
> +++ b/arch/x86/kernel/kprobes_32.c
> @@ -234,7 +234,7 @@ static int __kprobes is_IF_modifier(kprobe_opcode_t opcode)
>  
>  int __kprobes arch_prepare_kprobe(struct kprobe *p)
>  {
> -	/* insn: must be on special executable page on i386. */
> +	/* insn: must be on special executable page on x86_32|64. */
>  	p->ainsn.insn = get_insn_slot();
>  	if (!p->ainsn.insn)
>  		return -ENOMEM;
> @@ -373,13 +373,21 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
>  static __always_inline void clear_btf(void)
>  {
>  	if (test_thread_flag(TIF_DEBUGCTLMSR))
> +#ifdef CONFIG_X86_32
>  		wrmsr(MSR_IA32_DEBUGCTLMSR, 0, 0);
> +#else
> +		wrmsrl(MSR_IA32_DEBUGCTLMSR, 0);
> +#endif
>  }
>  
>  static __always_inline void restore_btf(void)
>  {
>  	if (test_thread_flag(TIF_DEBUGCTLMSR))
> +#ifdef CONFIG_X86_32
>  		wrmsr(MSR_IA32_DEBUGCTLMSR, current->thread.debugctlmsr, 0);
> +#else
> +		wrmsrl(MSR_IA32_DEBUGCTLMSR, current->thread.debugctlmsr);
> +#endif
>  }

I think you can use wrmsr() on X86_64 too.
So, we can merge it to wrmsr().


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com, masami.hiramatsu.pt@hitachi.com


      reply	other threads:[~2007-12-17 15:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-14 23:16 [PATCH] x86: Unify cosmetic kprobes{32|64}.c Harvey Harrison
2007-12-17 15:16 ` Masami Hiramatsu [this message]

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=476692C0.7020802@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=harvey.harrison@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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