lkml.org 
[lkml]   [2010]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/3] jump label: add enabled/disabled state to jump label key entries
From
Date
On Thu, 2010-11-25 at 13:39 +1100, Michael Ellerman wrote:
> > > arch/powerpc/lib/code-patching.c:
> > >
> > > void patch_instruction(unsigned int *addr, unsigned int instr)
> > > {
> > > *addr = instr;
> > > asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r"
> > > (addr));
> > > }
> >
> > Is this ever called outside of boot up? After SMP is enabled? (besides
> > for creating trampolines, before they are used).
>
> It is now :)
>
> AFAIK it works fine, the icbi invalidates across all processors. The
> only issue is that it's not precise, ie. another CPU might not see the
> update immediately, but as soon as it takes an interrupt or something it
> will.

Ooh, nice, so the CPUs won't get all confused because you change code
from under their ifetch cache?

How expensive is this icbi ins?

> What would suit us would be to have an arch callback that is called
> after all the transforms for a particular jump label key have been made.
> That way we could optimise the individual patches, and do a sync step at
> the end, ie. when we want the effect of the patching to be globally
> visible.

I think such a sync-barrier is desired (possibly only on the enable
path) so we can actually say the tracepoints are on.

Which would mean sending IPIs to all CPUs and waiting for them to
acknowledge them. Which, while not quite as expensive as stop_machine,
its not really cheap either.




\
 
 \ /
  Last update: 2010-11-25 07:55    [W:0.092 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site