From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvWSE-000309-RV for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:21:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvWS9-0002xL-9R for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:21:17 -0400 Received: from [199.232.76.173] (port=40284 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvWS8-0002x2-Qe for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:21:12 -0400 Received: from mail-bw0-f211.google.com ([209.85.218.211]:48344) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvWS8-0002zK-CL for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:21:12 -0400 Received: by bwz7 with SMTP id 7so272573bwz.34 for ; Wed, 07 Oct 2009 06:21:09 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 7 Oct 2009 15:21:09 +0200 Message-ID: <6d8082040910070621gc3a6be6h6128b232938ed54d@mail.gmail.com> From: Jiaqing Du Content-Type: multipart/alternative; boundary=001636498f4b58390e04755838c8 Subject: [Qemu-devel] Translated Basic Block Instrumentation List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --001636498f4b58390e04755838c8 Content-Type: text/plain; charset=ISO-8859-1 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 --001636498f4b58390e04755838c8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 so= me conditions I need to raise an NMI inside a translated basic block. The f= ollowing is (part of ) what I added to tcg_gen_code_common().

=A0=A0=A0 /* movq EXCP02_NMI,%rdi */
=A0=A0=A0 tcg_out_movi(s, TCG_T= YPE_I64, TCG_REG_RDI, EXCP02_NMI);

=A0=A0=A0 /* callq helper_raise_i= nterrupt(EXCP02_NMI) */
=A0=A0=A0 tcg_out8(s, 0xe8);
=A0=A0=A0 tcg_ou= t32(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 als= o tried cpu_interrupt(), this also did not work. What I want to do is to ra= ise an NMI inside a translated basic block, any suggestions?


Thanks,
Jiaqing
--001636498f4b58390e04755838c8--