From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756703Ab0CCVmx (ORCPT ); Wed, 3 Mar 2010 16:42:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36386 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756620Ab0CCVmr (ORCPT ); Wed, 3 Mar 2010 16:42:47 -0500 From: Masami Hiramatsu Subject: [PATCH -tip] x86: Issue at least one memory barrier in stop_machine_text_poke(). To: Ingo Molnar , lkml Cc: systemtap , DLE , Masami Hiramatsu , Mathieu Desnoyers , Ingo Molnar , Jason Baron Date: Wed, 03 Mar 2010 16:48:47 -0500 Message-ID: <20100303214847.26177.98280.stgit@localhost6.localdomain6> In-Reply-To: <20100303213614.GA29880@Krystal> References: <20100303213614.GA29880@Krystal> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix stop_machine_text_poke() to issue smp_mb() before exiting waiting loop, and use cpu_relax() for waiting. Signed-off-by: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Ingo Molnar Cc: Jason Baron --- arch/x86/kernel/alternative.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 635e4f4..3a4bf35 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -597,8 +597,8 @@ static int __kprobes stop_machine_text_poke(void *data) wrote_text = 1; } else { while (!wrote_text) - smp_rmb(); - sync_core(); + cpu_relax(); + smp_mb(); /* Load wrote_text before following execution */ } flush_icache_range((unsigned long)tpp->addr, -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: mhiramat@redhat.com