lkml.org 
[lkml]   [2003]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Runtime memory barrier patching
On Tue, Apr 22, 2003 at 01:35:57AM +0200, Jamie Lokier wrote:
> Andi Kleen wrote:
> > The patching code is quite generic and could be used to patch other
> > instructions
>
> Such as removing the lock prefix when running non-SMP?

Yes, could work. But you need a new variant of alternative()
or eat worse code. The current alternative() can only handle
constant sized original instructions, which requires that you
use a constant sized constraint (e.g. (%0) ... "r" (ptr)) etc.)
"m" is unfortunately variable size.

For the special case of lock it would still work because you
only need to patch the prefix away, not replace the whole
instruction, but that requires a new macro.

Also when you do that I would start to think about discarding the
.altinstructions section after load to avoid too much kernel bloat (it
currently costs 7 byte + the length of the replacement. And lock
is quite common in the kernel these days.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:1.043 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site