Hitachi djprobe mechanism

Mathieu Desnoyers compudj@krystal.dyndns.org
Sun Jul 31 23:11:00 GMT 2005


* Andi Kleen (ak@suse.de) wrote:
> 
> One way would be to just search the task list for any tasks blocked with an IP
> inside the patched region. If yes rewait for another quiescent period.
> 
> 

If you stop other cpus'scheduler when you do that, then it's ok.

I just though about an interesting way to implement the IPI, which would work
very well (and safely) for any case where the instruction to overwrite is >= 5
bytes. The idea :

- Send IPI to each other cpu
  IP args : * address we plan to write to
            * the new instruction we plan to write
  (The IPI handler could then make an infinite loop, reading the address,
  waiting for it to contain the new instruction.)
- As we are sure that no other CPU is executing this code, we just have to write
  it in memory.

It doesn't work for smaller instructions (problem if the code jump in an invalid
instruction, if interrupt returns there or if preemption returns there). Searching
the list of tasks for an IP at this position would correct the preemption problem,
but not jmp to nor interruption.


Mathieu


OpenPGP public key:              http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68 



More information about the Systemtap mailing list