From: Rowan Hart <rowanbhart@gmail.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel@nongnu.org, Alexandre Iooss <erdnaxe@crans.org>,
Mahmoud Mandour <ma.mandourr@gmail.com>,
Pierrick Bouvier <pierrick.bouvier@linaro.org>
Subject: Re: [PATCH] plugins: add plugin API to read guest memory
Date: Mon, 26 Aug 2024 11:54:46 -0700 [thread overview]
Message-ID: <94f0ad4a-753a-43c7-b4c0-9e1fa3c4d00d@gmail.com> (raw)
In-Reply-To: <87a5h3legw.fsf@draig.linaro.org>
Alex,
Thanks for the additional information.
>>
>> A key aspect of what you propose here, is that the memory may have
>> changed during the write time, and when you read it, while what we
>> propose guarantees to track every change correctly.
>>
>> It's not a bad thing, and both API are definitely complementary. When
>> talking to Alex, he was keen to add a global read_memory API (like you
>> propose), after we merge the first one.
>>
>> @Alex: any thought on this?
>
> I'd like to get the memory callback API merged first - mostly because
> that is the API that will absolutely reflect what was loaded or stored
> to a given memory location. For precise instrumentation that is the one
> to use.
>
> However I agree the ability to read the state of memory outside of loads
> and stores is useful especially for something like this. It's not
> unreasonable to assume the memory state of arguments going into a
> syscall isn't being messed with and it is easier to track pointers and
> strings with a more general purpose API.
>
I agree, I considered the absolute load/store question and poked around the
code a bit, but I didn't find what looked like a solid way to either:
A) Ensure that all writes are flushed before the read happens (which sounds
like a hefty performance penalty anyway) or
B) Check whether there are outstanding writes and return an error
It sounds like essentially use cases where that level of per-insn write
granularity matters should utilize your upcoming API instead of this one, and I
will add a call-out to the doc of this one to alert users of the potential pitfall.
>>> qemu_plugin_register_vcpu_syscall_cb(id, vcpu_syscall);
>>> qemu_plugin_register_vcpu_syscall_ret_cb(id, vcpu_syscall_ret);
>>> qemu_plugin_register_atexit_cb(id, plugin_exit, NULL);
>
> There was someone on IRC looking to trace system calls in system mode
> (by tracking the syscall instruction and reading the registers at the
> time). I wonder if we could make this plugin do the right thing in both
> modes?
>
Cool! I think this should be doable.
-Rowan
next prev parent reply other threads:[~2024-08-26 18:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 23:56 [PATCH] plugins: add plugin API to read guest memory Rowan Hart
2024-08-22 20:33 ` Pierrick Bouvier
2024-08-22 20:37 ` Pierrick Bouvier
2024-08-23 10:29 ` Alex Bennée
2024-08-26 18:54 ` Rowan Hart [this message]
2024-08-26 18:47 ` Rowan Hart
2024-08-26 19:11 ` Pierrick Bouvier
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=94f0ad4a-753a-43c7-b4c0-9e1fa3c4d00d@gmail.com \
--to=rowanbhart@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=erdnaxe@crans.org \
--cc=ma.mandourr@gmail.com \
--cc=pierrick.bouvier@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.