From: "Alex Bennée" <alex.bennee@linaro.org>
To: Robert Henry <robhenry@microsoft.com>
Cc: qemu-devel@nongnu.org
Subject: Re: qemu plugin exposure of register addresses
Date: Fri, 03 Apr 2020 20:07:14 +0100 [thread overview]
Message-ID: <87369ke6cd.fsf@linaro.org> (raw)
In-Reply-To: <BL0PR2101MB1026B7A4C994BE826CF95DFFD6C60@BL0PR2101MB1026.namprd21.prod.outlook.com>
Robert Henry <robhenry@microsoft.com> writes:
> There is now a qemu plugin interface function
> qemu_plugin_register_vcpu_mem_cb which registers a plugin-side
> callback. This callback is later invoked at the start of each emulated
> instruction, and it receives information about memory addresses and
> read/write indicators.
>
> I'm wondering how hard it is to add a similar callback to expose
> register addresses and read/write indicators. For example, executing
> `add r3, r1, $1` would generate two callbacks, one {write r3} and the
> other {read r1}. I'd like this for all kinds of registers such as simd
> regs, and, gulp, flags registers.
The problem with tracking registers directly from the plugin is the
internal variability of how QEMU does things. The core TCG isn't really
aware of registers as such and the individual translators can take all
sorts of approaches to loading and storing the results. Then you have
the issue of helper functions which TCG is only vaguely aware of if it
needs to save "globals" or not.
> With this information ISA simulators could examine the data flow graph
> and register dependencies.
The plugin itself can still do this by disassembling the instruction at
translation time and decoding which registers are going to be accessed.
It can pass this data to the callback via userdata mechanism.
> I'm not asking for register contents; we don't get memory contents
> either!
There is no conceptual problem with adding access to register contents
even if it's only read-only. The main issue is coming up with a clean
API for it.
See thread @
Subject: Re: Qemu TCG Plugins - how to access guest registers?
In-reply-to: <20200329111311.272958fe@luklap>
Date: Mon, 30 Mar 2020 16:15:47 +0100
Message-ID: <878sjhho0s.fsf@linaro.org>
> I gather there is some concern about exposing too much functionality
> to the plugin API, as a plugin might then be used to subvert some
> aspects of the GPL. I don't understand the details of this concern,
> nor know where the "line in the sand" is.
We need to better document this - but basically we don't want 3rd
parties implementing what would be core functionality (e.g. device
models) but using plugins as some sort of end run around the GPL. While
I would love there to be more analysis plugins contributed upstream it's
less of a concern.
>
> Robert Henry
--
Alex Bennée
prev parent reply other threads:[~2020-04-03 19:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-02 16:52 qemu plugin exposure of register addresses Robert Henry
2020-04-03 19:07 ` Alex Bennée [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=87369ke6cd.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=robhenry@microsoft.com \
/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 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).