Hi Eduardo,

Is it possible to identify context switches inside QEMU. In order to support
transactional memory in QEMU, we have added

target_ulong tm_abort_eip;
int inTransaction;

to CPUX86State structure.

tm_abort_eip is the EIP to jump to when a transaction fails i.e. start of
the Transactional Block while inTransaction tells us whether a transaction
has started so that we can log the memory references. As far as I
understand, env variable will be modified at a context switch. At a context
switch, we need to update tm_abort_eip as well as inTransaction based on the
status of the new thread being loaded. We can store these two variables
inside DisasContext which I believe is unique for each translated block. But
when and where should we modify the env variable so that for each thread it
contains the correct values for tm_abort_eip and inTransaction.

I will appreciate your help.

Thanks,
Atif

On 4/27/07, Eduardo Felipe <[EMAIL PROTECTED]> wrote:


> I think I could not explain my question regarding "addl %ebx, (%eax)".
> What I wanted to ask was that this instruction also accesses the memory and
> I also need to intercept it within a transaction. Incase of "addl %ebx,
> (%eax)", Are the functions under "/* CPU memory access without any memory or
> io remapping */" called in case of this instruction.


Yes. Just look how the instruction is translated into opcodes and you'll
see how it works. You can use the -d switch for this.

Secondly, there is a function in "exec.c" called "cpu_physical_memory_rw".
> Is it easier to hack into this fuction to intercept the memory references.


That function is used by emulated hardware devices to interact with memory
( e.g. DMA to write and read memory chunks). Translated guest code does
not use it.

Regards,
Eduardo


Reply via email to