All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Ormaetxea Xabier <xormaetxea@ikerlan.es>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Code source modifying
Date: Mon, 10 Jul 2017 11:54:21 +0100	[thread overview]
Message-ID: <CAFEAcA9bt_wwd4LzCppcqeUJs229cOM4G+mnTBkfw05zBN31CQ@mail.gmail.com> (raw)
In-Reply-To: <B1DA44315104F94D9F3F23C74275EA9D729B61@Ikerlan-12.ikerlan.es>

On 10 July 2017 at 11:16, Ormaetxea Xabier <xormaetxea@ikerlan.es> wrote:
> Ah sorry, I thought that replying to your message it was somehow
> redirected to the mailing list. So, every-time I respond, I have
> to do it to qemu-devel@nongnu.org? Or a CC it's enough? Sorry for
> my ignorance...

Yes, you just have to send mail to: or cc: the qemu-devel
address.

> Anyway, do you imagine how can I make this "virtual world"-"real world"
> connection? I mean, is there an easy way of connecting an execution
> from the standalone with the source code?

Two things:

(1) you should try to make your interface with the emulator
map more closely to what existing examples do. "Write to
a virtual address in RAM that is monitored" is really weird and
will be a pain to implement.

What makes more sense depends a bit on whether you're using
qemu-system-* (a full-system emulator of cpu and devices) or
qemu-* (which just emulate a single Linux process by intercepting
system calls). For full-system, you can for instance provide
a device model that sits at a known physical address. Or you
can use the kind of interface that OSes might use to talk to
firmware (like an SMC instruction on ARM -- our PSCI
implementation works this way).

For linux-user the simplest thing is obviously just to
implement a syscall (or to use the existing timer ones!)

(2) you don't want to do this by "check something every
time round an execution loop" because this will make the
performance very bad. What you need to do is arrange that
when the guest does some action (write to physical address,
make SMC call, make system call) you get control and can
implement your behaviour there. (This is another reason
why write-to-virtual-address is a suboptimal choice: it's
harder to get control for that.)

thanks
-- PMM

  reply	other threads:[~2017-07-10 10:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10  9:14 [Qemu-devel] Code source modifying Ormaetxea Xabier
2017-07-10  9:26 ` Peter Maydell
     [not found]   ` <B1DA44315104F94D9F3F23C74275EA9D729B4B@Ikerlan-12.ikerlan.es>
     [not found]     ` <CAFEAcA_CF7KVq2MAhR3twsXfio3RNFRJ-SiK2pO7g1ZEzGvpGg@mail.gmail.com>
2017-07-10 10:16       ` Ormaetxea Xabier
2017-07-10 10:54         ` Peter Maydell [this message]
2017-07-11  7:07   ` Ormaetxea Xabier

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=CAFEAcA9bt_wwd4LzCppcqeUJs229cOM4G+mnTBkfw05zBN31CQ@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=xormaetxea@ikerlan.es \
    /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.