All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Jason Baron <jbaron@akamai.com>,
	"H. Peter Anvin" <hpa@linux.intel.com>,
	Borislav Petkov <bp@alien8.de>, Joe Perches <joe@perches.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2 v3] x86: make jump_label use int3-based patching
Date: Thu, 11 Jul 2013 22:12:05 -0400	[thread overview]
Message-ID: <1373595125.17876.78.camel@gandalf.local.home> (raw)
In-Reply-To: <alpine.LNX.2.00.1307112225060.29788@pobox.suse.cz>

On Thu, 2013-07-11 at 22:26 +0200, Jiri Kosina wrote:
> Make jump labels use text_poke_bp() for text patching instead of 
> text_poke_smp(), avoiding the need for stop_machine().
> 
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
> ---
> Changes:
> 
> - unchanged since v1, patch 1/2 is the one being updated
> 
>  arch/x86/kernel/jump_label.c |   16 ++++++++++++++--
>  1 files changed, 14 insertions(+), 2 deletions(-)
> 

Reviewed-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

> diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c
> index 2889b3d..460f5d9 100644
> --- a/arch/x86/kernel/jump_label.c
> +++ b/arch/x86/kernel/jump_label.c
> @@ -37,7 +37,19 @@ static void __jump_label_transform(struct jump_entry *entry,
>  	} else
>  		memcpy(&code, ideal_nops[NOP_ATOMIC5], JUMP_LABEL_NOP_SIZE);
>  
> -	(*poker)((void *)entry->code, &code, JUMP_LABEL_NOP_SIZE);
> +	/*
> +	 * Make text_poke_bp() a default fallback poker.
> +	 *
> +	 * At the time the change is being done, just ignore whether we
> +	 * are doing nop -> jump or jump -> nop transition, and assume
> +	 * always nop being the 'currently valid' instruction
> +	 *
> +	 */
> +	if (poker)
> +		(*poker)((void *)entry->code, &code, JUMP_LABEL_NOP_SIZE);
> +	else
> +		text_poke_bp((void *)entry->code, &code, JUMP_LABEL_NOP_SIZE,
> +			     (void *)entry->code + JUMP_LABEL_NOP_SIZE);
>  }
>  
>  void arch_jump_label_transform(struct jump_entry *entry,
> @@ -45,7 +57,7 @@ void arch_jump_label_transform(struct jump_entry *entry,
>  {
>  	get_online_cpus();
>  	mutex_lock(&text_mutex);
> -	__jump_label_transform(entry, type, text_poke_smp);
> +	__jump_label_transform(entry, type, NULL);
>  	mutex_unlock(&text_mutex);
>  	put_online_cpus();
>  }



  reply	other threads:[~2013-07-12  2:12 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 20:25 [RFC] [PATCH 0/2] x86: make jump labels use int3-based breakpoint instead of stop_machine() Jiri Kosina
2013-07-10 20:25 ` [RFC] [PATCH 1/2] x86: introduce int3-based instruction patching Jiri Kosina
2013-07-10 21:31   ` [RFC] [PATCH 1/2 v2] " Jiri Kosina
2013-07-10 21:36     ` H. Peter Anvin
2013-07-10 21:48       ` Borislav Petkov
2013-07-10 21:56         ` H. Peter Anvin
2013-07-10 22:14           ` Borislav Petkov
2013-07-10 22:39       ` Jiri Kosina
2013-07-11  3:29       ` Masami Hiramatsu
2013-07-11 10:09       ` Jiri Kosina
2013-07-11 10:54         ` Jiri Kosina
2013-07-11 16:31         ` H. Peter Anvin
2013-07-11 16:46           ` Steven Rostedt
2013-07-11 19:21             ` Jiri Kosina
2013-07-12  1:00             ` Masami Hiramatsu
2013-07-11 14:35       ` Steven Rostedt
2013-07-11 14:47         ` Jason Baron
2013-07-10 21:46     ` Joe Perches
2013-07-11 10:23     ` Masami Hiramatsu
2013-07-11 10:51       ` Jiri Kosina
2013-07-12  0:50         ` Masami Hiramatsu
2013-07-11 16:10       ` H. Peter Anvin
2013-07-11 19:29         ` Jiri Kosina
2013-07-11 20:49           ` H. Peter Anvin
2013-07-11 20:51           ` H. Peter Anvin
2013-07-11 15:57     ` Steven Rostedt
2013-07-11 19:43       ` Jiri Kosina
2013-07-11 19:52         ` Steven Rostedt
2013-07-10 20:25 ` [RFC] [PATCH 2/2] x86: make jump_label use int3-based patching Jiri Kosina
2013-07-10 22:26 ` [RFC] [PATCH 0/2] x86: make jump labels use int3-based breakpoint instead of stop_machine() Jason Baron
2013-07-11  0:04   ` Jiri Kosina
2013-07-11 16:42     ` Steven Rostedt
2013-07-11 19:23       ` Jiri Kosina
2013-07-11 19:54         ` Steven Rostedt
2013-07-11  2:21 ` Masami Hiramatsu
2013-07-11 20:26 ` [PATCH 2/2 v3] x86: make jump_label use int3-based patching Jiri Kosina
2013-07-12  2:12   ` Steven Rostedt [this message]
2013-07-12  5:44   ` Masami Hiramatsu
2013-07-11 20:26 ` [PATCH 1/2 v3] x86: introduce int3-based instruction patching Jiri Kosina
2013-07-11 20:53   ` H. Peter Anvin
2013-07-11 21:04     ` Borislav Petkov
2013-07-11 21:36       ` H. Peter Anvin
2013-07-12  7:57         ` Borislav Petkov
2013-07-17  3:59           ` H. Peter Anvin
2013-07-11 22:31     ` Jiri Kosina
2013-07-12  2:09       ` Steven Rostedt
2013-07-11 23:01   ` Joe Perches
2013-07-12  2:07   ` Steven Rostedt
2013-07-12  2:40   ` Masami Hiramatsu
2013-07-12  9:21 ` [PATCH 1/2 v4] " Jiri Kosina
2013-07-17  1:18   ` [tip:x86/jumplabel] x86: Introduce int3 (breakpoint) -based " tip-bot for Jiri Kosina
2013-07-12  9:22 ` [PATCH 2/2 v4] x86: make jump_label use int3-based patching Jiri Kosina
2013-07-17  1:18   ` [tip:x86/jumplabel] x86: Make " tip-bot for Jiri Kosina

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=1373595125.17876.78.camel@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bp@alien8.de \
    --cc=hpa@linux.intel.com \
    --cc=jbaron@akamai.com \
    --cc=jkosina@suse.cz \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.