This is the mail archive of the systemtap@sources.redhat.com mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Hitachi djprobe mechanism


* 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 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]