qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Moniter The Ram Access On QEMU
@ 2012-03-24 10:30 stefan weids
  2012-03-29  3:28 ` 陳韋任
  0 siblings, 1 reply; 5+ messages in thread
From: stefan weids @ 2012-03-24 10:30 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

Dear All,

Now I want to moniter memory access on QEMU (guest virtual or guest
physical).
I found that QEMU will translate arm instructions into TCG instructions,
and the TCG instructions will be translated into X86 instructions.

The function "tcg_out_op"(tcg/i386/tcg_target.c) will translate the TCG
instructions into X86 instructions eventually.
Does the case statement just like "OP_32_64(ld8u)" and
"INDEX_op_qemu_ld8u".etc includes all memory access routines on X86 view.
Is it proper for me to add some codes in TCG -> X86 to moniter the ram
access on QEMU?

Any comments is appreciated.

thanks,

Best Regards,
Stefan

[-- Attachment #2: Type: text/html, Size: 712 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Moniter The Ram Access On QEMU
  2012-03-24 10:30 [Qemu-devel] Moniter The Ram Access On QEMU stefan weids
@ 2012-03-29  3:28 ` 陳韋任
  2012-03-29 10:51   ` stefan weids
  0 siblings, 1 reply; 5+ messages in thread
From: 陳韋任 @ 2012-03-29  3:28 UTC (permalink / raw)
  To: stefan weids; +Cc: qemu-devel

> Now I want to moniter memory access on QEMU (guest virtual or guest
> physical).
> I found that QEMU will translate arm instructions into TCG instructions,
> and the TCG instructions will be translated into X86 instructions.
> 
> The function "tcg_out_op"(tcg/i386/tcg_target.c) will translate the TCG
> instructions into X86 instructions eventually.
> Does the case statement just like "OP_32_64(ld8u)" and
> "INDEX_op_qemu_ld8u".etc includes all memory access routines on X86 view.
> Is it proper for me to add some codes in TCG -> X86 to moniter the ram
> access on QEMU?

  TGC ops like qemu_ld/qemu_st is for address translations (guest virtual to
host virtual) in system mode, that's all I can tell.

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Moniter The Ram Access On QEMU
  2012-03-29  3:28 ` 陳韋任
@ 2012-03-29 10:51   ` stefan weids
  2012-03-29 11:07     ` 陳韋任
  0 siblings, 1 reply; 5+ messages in thread
From: stefan weids @ 2012-03-29 10:51 UTC (permalink / raw)
  To: 陳韋任; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1799 bytes --]

Hi Chenwj,

Thanks for your kindly help. Would you mind give me more help?

Now I have some probem with the exception handle. I found the funciton
"do_interrupt" in "target-arm/helper.c" and "gen_exception" in
"target-arm/translate.c" seems to handle the exceptions. But I am comfused
with those two functions, which function will do the really work about
generating an exception. As my understanding, I think “do_interrupt” seems
to do some preparations before enter exceptions just like operate some
registers and accumulate the exception handler address. And "gen_exception"
seems to do the read job to generate a exception. But I'm not sure.

Any comments are appreciated.

Thanks.

BR,
Stefan


在 2012年3月29日 上午11:28,陳韋任 <chenwj@iis.sinica.edu.tw>写道:

> > Now I want to moniter memory access on QEMU (guest virtual or guest
> > physical).
> > I found that QEMU will translate arm instructions into TCG instructions,
> > and the TCG instructions will be translated into X86 instructions.
> >
> > The function "tcg_out_op"(tcg/i386/tcg_target.c) will translate the TCG
> > instructions into X86 instructions eventually.
> > Does the case statement just like "OP_32_64(ld8u)" and
> > "INDEX_op_qemu_ld8u".etc includes all memory access routines on X86 view.
> > Is it proper for me to add some codes in TCG -> X86 to moniter the ram
> > access on QEMU?
>
>   TGC ops like qemu_ld/qemu_st is for address translations (guest virtual
> to
> host virtual) in system mode, that's all I can tell.
>
> Regards,
> chenwj
>
> --
> Wei-Ren Chen (陳韋任)
> Computer Systems Lab, Institute of Information Science,
> Academia Sinica, Taiwan (R.O.C.)
> Tel:886-2-2788-3799 #1667
> Homepage: http://people.cs.nctu.edu.tw/~chenwj
>

[-- Attachment #2: Type: text/html, Size: 2369 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Moniter The Ram Access On QEMU
  2012-03-29 10:51   ` stefan weids
@ 2012-03-29 11:07     ` 陳韋任
  2012-03-30  7:01       ` stefan weids
  0 siblings, 1 reply; 5+ messages in thread
From: 陳韋任 @ 2012-03-29 11:07 UTC (permalink / raw)
  To: stefan weids; +Cc: qemu-devel, 陳韋任

> Now I have some probem with the exception handle. I found the funciton
> "do_interrupt" in "target-arm/helper.c" and "gen_exception" in
> "target-arm/translate.c" seems to handle the exceptions. But I am comfused
> with those two functions, which function will do the really work about
> generating an exception. As my understanding, I think “do_interrupt” seems
> to do some preparations before enter exceptions just like operate some
> registers and accumulate the exception handler address. And "gen_exception"
> seems to do the read job to generate a exception. But I'm not sure.

  Interrupt is a "external" source which breaks the current execution flow of
the CPU. For example, a device might raise an interrupt so that CPU can know the
device has completed its task. On the other hand, exception is an "internal"
source which breaks the current execution flow of the CPU. Take divide by zero
as an example, CPU will detect this error (occurred in the CPU itself). So
depends on what you mean "exception", do_interrupt or gen_exception might does
the real work.

Regards,
chenwj
  
-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Moniter The Ram Access On QEMU
  2012-03-29 11:07     ` 陳韋任
@ 2012-03-30  7:01       ` stefan weids
  0 siblings, 0 replies; 5+ messages in thread
From: stefan weids @ 2012-03-30  7:01 UTC (permalink / raw)
  To: 陳韋任; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1818 bytes --]

Hi Wei-Ren,

Thanks for your reply.

According your email, the function "do_interrupt" handle the external
interrupt just like keyboard interrupt, and the function "gen_exception"
handle the exception just like “SWI”.etc. So the function “gen_exception”
seems to be the answer.

Any comments are appreciated.

BR,
Stefan




在 2012年3月29日 下午7:07,陳韋任 <chenwj@iis.sinica.edu.tw>写道:

> > Now I have some probem with the exception handle. I found the funciton
> > "do_interrupt" in "target-arm/helper.c" and "gen_exception" in
> > "target-arm/translate.c" seems to handle the exceptions. But I am
> comfused
> > with those two functions, which function will do the really work about
> > generating an exception. As my understanding, I think “do_interrupt”
> seems
> > to do some preparations before enter exceptions just like operate some
> > registers and accumulate the exception handler address. And
> "gen_exception"
> > seems to do the read job to generate a exception. But I'm not sure.
>
>   Interrupt is a "external" source which breaks the current execution flow
> of
> the CPU. For example, a device might raise an interrupt so that CPU can
> know the
> device has completed its task. On the other hand, exception is an
> "internal"
> source which breaks the current execution flow of the CPU. Take divide by
> zero
> as an example, CPU will detect this error (occurred in the CPU itself). So
> depends on what you mean "exception", do_interrupt or gen_exception might
> does
> the real work.
>
> Regards,
> chenwj
>
> --
> Wei-Ren Chen (陳韋任)
> Computer Systems Lab, Institute of Information Science,
> Academia Sinica, Taiwan (R.O.C.)
> Tel:886-2-2788-3799 #1667
> Homepage: http://people.cs.nctu.edu.tw/~chenwj
>

[-- Attachment #2: Type: text/html, Size: 2351 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-30  7:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-24 10:30 [Qemu-devel] Moniter The Ram Access On QEMU stefan weids
2012-03-29  3:28 ` 陳韋任
2012-03-29 10:51   ` stefan weids
2012-03-29 11:07     ` 陳韋任
2012-03-30  7:01       ` stefan weids

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).