lkml.org 
[lkml]   [2013]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] [PATCH 1/2 v2] x86: introduce int3-based instruction patching
On Thu, 11 Jul 2013, Steven Rostedt wrote:

[ .. snip .. ]
> > + smp_wmb();
> > +
> > + text_poke(addr, &int3, sizeof(int3));
> > +
> > + if (len - sizeof(int3) > 0) {
>
> I believe we need a sync here. Otherwise, if the instruction crosses
> cache lines, the original first byte could have been pulled in, and then
> after the text_poke() below, it gets the updated version, causing a
> crash on that CPU.
>
> on_each_cpu(do_sync_core, NULL, 1);

Right you are.

OTOH we apparently don't need the one after the text_poke() below, as
syncing the cores just after patching the first byte afterwards provides
safe enough guard (at least according to hpa's words back in 2010 :) ).

Will change it for next respin of the patchset, thanks for review.

--
Jiri Kosina
SUSE Labs


\
 
 \ /
  Last update: 2013-07-11 22:21    [W:0.159 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site