Re: [PATCH 1/1] x86: fix text_poke

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mathieu Desnoyers
Date: Friday, April 25, 2008 - 4:00 pm

* Linus Torvalds (torvalds@linux-foundation.org) wrote:

This idea has been considered a few years ago at OLS in the tracing BOF
if I remember well.  The results were this : First, there is no way to
guarantee that no code path, nor any return address from any function,
interrupt, sleeping thread, will return to the "old" version of the
function. Nor is it possible to determine when a quiescent state is
reached. Therefore, we couldn't see how we can do the teardown.

The second point is dependency between execution flow and variables. If
we don't do a complete copy of the variables (which I don't see how we
can do atomically), we will have to share the variables between the old
and the new copies of the functions. However, some variables might
encode information about the execution flow of the program and depend on
the actual address at which the code is linked (function pointers for
instance). Stuff like "goto *addr" would also break.



That's actually what I do in my immediate values implementation.


Then dealing with multiple code patching infrastructures (kprobes,
alternatives, paravirt) would become hellish. If a kprobe is planted in
the original version of the function, we have to insert it in the new
version... and the teardown of the old function is still a problem.


Yep.

The discussion I refer to took place at OLS a few years ago. Other
participants might remember some other details I forgot.

Mathieu


-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.25-git1: Solid hang on HP nx6325 (64-bit), Rafael J. Wysocki, (Sat Apr 19, 6:22 am)
2.6.25-git2: BUG: unable to handle kernel paging request a ..., Rafael J. Wysocki, (Sun Apr 20, 12:04 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Sun Apr 20, 12:14 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Paul E. McKenney, (Sun Apr 20, 10:47 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 6:35 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 9:12 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 9:24 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Paul E. McKenney, (Mon Apr 21, 10:05 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 10:19 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Paul E. McKenney, (Mon Apr 21, 10:43 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 11:22 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 5:54 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 6:15 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 6:30 pm)
device_pm_add (was: Re: 2.6.25-git2: BUG: unable to handle ..., Rafael J. Wysocki, (Tue Apr 22, 1:34 pm)
Re: device_pm_add (was: Re: 2.6.25-git2: BUG: unable to ha ..., Rafael J. Wysocki, (Tue Apr 22, 1:57 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Tue Apr 22, 2:46 pm)
Re: device_pm_add (was: Re: 2.6.25-git2: BUG: unable to ha ..., Rafael J. Wysocki, (Tue Apr 22, 3:48 pm)
Re: device_pm_add (was: Re: 2.6.25-git2: BUG: unable to ha ..., Rafael J. Wysocki, (Tue Apr 22, 5:50 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Christoph Lameter, (Wed Apr 23, 12:05 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Christoph Lameter, (Wed Apr 23, 12:28 pm)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 8:03 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 8:17 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 8:19 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 8:26 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 8:27 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Fri Apr 25, 8:30 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 8:32 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 8:33 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 8:48 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 8:50 am)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 8:54 am)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 8:57 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 8:59 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 9:06 am)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 9:11 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 9:11 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 9:19 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 9:22 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 9:24 am)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 9:30 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 9:33 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 9:37 am)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 9:42 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 9:43 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 9:45 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 9:51 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 9:52 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 9:56 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 10:02 am)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 10:09 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 10:13 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 10:26 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 10:29 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 10:53 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 11:04 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 11:09 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 11:13 am)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Fri Apr 25, 11:13 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 11:19 am)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 11:37 am)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 11:47 am)
Re: [PATCH 1/1] x86: fix text_poke, Pavel Machek, (Fri Apr 25, 11:53 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 11:56 am)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 12:19 pm)
Re: [PATCH 1/1] x86: fix text_poke, Christoph Lameter, (Fri Apr 25, 12:36 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 1:04 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 1:09 pm)
Re: [PATCH 1/1] x86: fix text_poke, David Miller, (Fri Apr 25, 1:18 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 1:18 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 1:37 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 1:41 pm)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 1:51 pm)
Re: [PATCH 1/1] x86: fix text_poke, David Miller, (Fri Apr 25, 2:02 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 2:11 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 2:12 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 2:15 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 2:47 pm)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 3:04 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 3:07 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 3:30 pm)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 3:36 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 3:38 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 4:00 pm)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Fri Apr 25, 4:13 pm)
Re: [PATCH 1/1] x86: fix text_poke, Masami Hiramatsu, (Fri Apr 25, 4:34 pm)
Re: [PATCH 1/1] x86: fix text_poke, Frank Ch. Eigler, (Fri Apr 25, 7:12 pm)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Fri Apr 25, 11:21 pm)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Fri Apr 25, 11:50 pm)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Sat Apr 26, 2:59 am)
Re: [PATCH 1/1] x86: fix text_poke, Jiri Slaby, (Sat Apr 26, 4:16 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Sat Apr 26, 4:34 am)
Re: [PATCH 1/1] x86: fix text_poke, Arnaldo Carvalho de Melo, (Sat Apr 26, 4:56 am)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Sat Apr 26, 4:38 pm)
Re: [PATCH 1/1] x86: fix text_poke, Arnaldo Carvalho de Melo, (Sat Apr 26, 6:00 pm)
Re: [PATCH 1/1] x86: fix text_poke, Masami Hiramatsu, (Sun Apr 27, 5:49 pm)
[PATCH 1/1] x86: fix text_poke, Jiri Slaby, (Sun Apr 27, 5:51 pm)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Mon Apr 28, 1:21 pm)
VIRTUAL_BUG_ON(), Christoph Lameter, (Mon Apr 28, 1:24 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Mon Apr 28, 1:43 pm)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Mon Apr 28, 1:55 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Mon Apr 28, 2:01 pm)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Mon Apr 28, 2:02 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Mon Apr 28, 3:42 pm)
[RFC 1/1] mm: add virt to phys debug, Jiri Slaby, (Thu May 1, 12:22 pm)
Re: [RFC 1/1] mm: add virt to phys debug, Christoph Lameter, (Thu May 1, 1:18 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Sun May 4, 8:03 am)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Sun May 4, 9:18 am)
Re: [PATCH 1/1] x86: fix text_poke, Nick Piggin, (Sun May 4, 7:36 pm)
Re: [RFC 1/1] mm: add virt to phys debug, Jiri Slaby, (Tue May 6, 2:54 pm)
Re: [RFC 1/1] mm: add virt to phys debug, Christoph Lameter, (Wed May 7, 10:30 am)
Re: [RFC 1/1] mm: add virt to phys debug, Jiri Slaby, (Tue May 13, 7:38 am)
Re: [PATCH 1/1] x86: fix text_poke, Frank Ch. Eigler, (Thu Jun 5, 10:44 am)