All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Covington <cov@codeaurora.org>
To: Jun Koi <junkoi2004@gmail.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] Monitoring write to memory
Date: Thu, 09 Jul 2015 12:14:02 -0400	[thread overview]
Message-ID: <559E9DCA.1070303@codeaurora.org> (raw)
In-Reply-To: <CA+g7VZ0jjF-iXXh+5E-a64joVttMQ4gMdsjGg5Xi55Tn4oDs7A@mail.gmail.com>

On 07/01/2015 08:23 AM, Jun Koi wrote:
> Hello,
> 
> I am trying to monitor all the memory writing events inside Qemu by
> instrumenting tcg_gen_qemu_st8, tcg_gen_qemu_st16, tcg_gen_qemu_st32,
> tcg_gen_qemu_st64, as followings:
> 
> 
> // in tcg-op.h
> 
> void helper_checkmem(int64_t data, int64_t address);  // this is declared
> elsewhere
> 
> static inline void tcg_gen_qemu_st8(struct uc_struct *uc, TCGv arg, TCGv addr,
> int mem_index)
> {
> #if TARGET_LONG_BITS == 32
>     TCGArg args[2] = { GET_TCGV_I32(arg), GET_TCGV_I32(addr) };
> #else
>     TCGArg args[2] = { GET_TCGV_I64(arg), GET_TCGV_I64(addr) };
> #endif
>     tcg_gen_callN(&tcg_ctx, helper_checkmem, dh_retvar_void, 2, args);
>     tcg_gen_qemu_st_tl(uc, arg, addr, mem_index, MO_UB);
> }
> 
> 
> However, when I compile, helper_checkmem() is never called at runtime when
> memory is accessed.
> What is wrong with my code?

What guest code are you running? Does it have a strb instruction? If you're
able to code a simple bare metal test case you should be able to debug qemu
with gdb to see what code paths are taken and why the ones you anticipated aren't.

Chris

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

      reply	other threads:[~2015-07-09 16:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01 12:23 [Qemu-devel] Monitoring write to memory Jun Koi
2015-07-09 16:14 ` Christopher Covington [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=559E9DCA.1070303@codeaurora.org \
    --to=cov@codeaurora.org \
    --cc=junkoi2004@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.