qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Translated Basic Block Instrumentation


From: Jiaqing Du
Subject: [Qemu-devel] Translated Basic Block Instrumentation
Date: Wed, 7 Oct 2009 15:21:09 +0200

Hi list,

I'm working on the instrumentation of each (translated) basic block. The host arch is x86_64. At the beginning of each translated basic block, I added some instructions to do some accounting. Then under some conditions I need to raise an NMI inside a translated basic block. The following is (part of ) what I added to tcg_gen_code_common().

    /* movq EXCP02_NMI,%rdi */
    tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_RDI, EXCP02_NMI);

    /* callq helper_raise_interrupt(EXCP02_NMI) */
    tcg_out8(s, 0xe8);
    tcg_out32(s, (tcg_target_long)raise_exception - (tcg_target_long)s->code_ptr - 4);


It seems that this NMI is not handled properly in cpu_exec(). I also tried cpu_interrupt(), this also did not work. What I want to do is to raise an NMI inside a translated basic block, any suggestions?


Thanks,
Jiaqing

reply via email to

[Prev in Thread] Current Thread [Next in Thread]