[Qemu-devel] Detecting a kernel stack change

2007-05-04 Thread Nuri Eady
I'd like to detect when the kernel stack changes and it seems to me that
might be possible by looking at when the tss structure is accessed and
the esp element is changed. Linux uses a command something like the
following to update the esp in the tss during a task switch...

init_tss[smp_processor_id( )].esp0 = next-thread.esp0;

Is it possible to detect when this happens in qemu? Maybe in the
protected_interrupt helper function?

Thanks,
Nuri




[Qemu-devel] Saving state on a context switch

2007-05-02 Thread eady
Can anyone think of a way to save and restore an additional cpu state 
variable during a context switch without modifying the target operating 
system? Basically I would like to add a variable to the CPUState 
structure that is saved and restored with the registers.


Any ideas?

Thanks,
Nuri




Re: [Qemu-devel] Determine simulated pc during an exception

2007-04-14 Thread eady
Thanks Paul for the reply, I don't see how this function is called 
though by the exception handler. The way I understand it is that an 
exception is raised via raise_interrupt(exception_index, 0, 0, 0); in 
helper.c which in turn calls raise_interrupt() that sends the control 
flow back to the main execution loop via a longjmp and then 
do_interrupt() is called from there.  Where am I not making the connection?


Thanks,
Nuri

Paul Brook wrote:

Can anyone point me to the place in the code where the simulated program
counter is determined after an exception?



cpu_restore_state

Paul


  






[Qemu-devel] Saving and restoring CPU state

2007-04-12 Thread eady
I'm still looking for any suggestions on how to save and restore the 
target cpu state from within a custom instruction in op.c. I basically 
want a custom instruction to save the cpu state to a data structure and 
then continue on normally, a second custom instruction would then be 
used to restore the cpu state from the saved data structure at a later 
time thereby rolling back the execution of the cpu. I've tried saving 
and restoring env-eip within my custom instructions but this has no effect.


Thanks,
Nuri
---BeginMessage---
I'm experimenting a bit with QEMU and am in need of a way to save and 
restore X86 CPU state including the pc so that the processor state can 
be rolled back to re execute from the previous point. I've found the 
functions cpu_x86_fsave and cpu_restore_state but do not understand 
them well enough to use them. Does anyone have tips on how to store the 
processor state in an auxiliary data structure and then restore it at a 
later point?


Thanks
Nuri


---End Message---


[Qemu-devel] Saving and restoring CPU state

2007-04-08 Thread eady
I'm experimenting a bit with QEMU and am in need of a way to save and 
restore X86 CPU state including the pc so that the processor state can 
be rolled back to re execute from the previous point. I've found the 
functions cpu_x86_fsave and cpu_restore_state but do not understand 
them well enough to use them. Does anyone have tips on how to store the 
processor state in an auxiliary data structure and then restore it at a 
later point?


Thanks
Nuri