All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Min-Yih Hsu <minyihh@uci.edu>
Cc: Aaron Lindsay <aaron@os.amperecomputing.com>, qemu-devel@nongnu.org
Subject: Re: [RFC] tcg plugin: Additional plugin interface
Date: Fri, 23 Apr 2021 16:44:49 +0100	[thread overview]
Message-ID: <87a6pp6lit.fsf@linaro.org> (raw)
In-Reply-To: <CAJyG1bOR659y=6oP5-XFyVv-xLq-C-m4cdsdRP2D+ZVQqyJnqg@mail.gmail.com>


Min-Yih Hsu <minyihh@uci.edu> writes:

> Hi Alex and QEMU developers,
>
> Recently I was working with the TCG plugin. I found that `qemu_plugin_cb_flags` seems to reserve the functionality to
> read / write CPU register state, I'm wondering if you can share some
> roadmap or thoughts on this feature?

I think reading the CPU register state is certainly on the roadmap,
writing registers presents a more philosophical question of if it opens
the way to people attempting a GPL bypass via plugins. However reading
registers would certainly be a worthwhile addition to the API.

> Personally I see reading the CPU register state as (kind of) low-hanging fruit. The most straightforward way to implement
> it will be adding another function that can be called by insn_exec callbacks to read (v)CPU register values. What do you
> think about this?

It depends on your definition of low hanging fruit ;-)

Yes the implementation would be a simple helper which could be called
from a callback - I don't think we need to limit it to just insn_exec. I
think the challenge is proving a non-ugly API that works cleanly across
all the architectures. I'm not keen on exposing arbitrary gdb register
IDs to the plugins.

There has been some discussion previously on the list which is probably
worth reviewing:

  Date: Mon, 7 Dec 2020 16:03:24 -0500
  From: Aaron Lindsay <aaron@os.amperecomputing.com>
  Subject: Plugin Register Accesses
  Message-ID: <X86YnHhHMpQBr2/G@strawberry.localdomain>

But in short I think we need a new subsystem in QEMU where frontends can
register registers (sic) and then provide a common API for various
users. This common subsystem would then be the source of data for:

  - plugins
  - gdbstub
  - monitor (info registers)
  - -d LOG_CPU logging

If you are interested in tackling such a project I'm certainly happy to
provide pointers and review.

>
> Thank you
> -Min


-- 
Alex Bennée


  reply	other threads:[~2021-04-23 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 17:46 [RFC] tcg plugin: Additional plugin interface Min-Yih Hsu
2021-04-23 15:44 ` Alex Bennée [this message]
2021-04-26 16:27   ` Min-Yih Hsu
2021-04-26 17:42     ` Alex Bennée
2021-04-28 13:41       ` Aaron Lindsay

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=87a6pp6lit.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=aaron@os.amperecomputing.com \
    --cc=minyihh@uci.edu \
    --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.