[RFC PATCH 0/1] QEMU TCG plugin interface extensions

Florian Hauschild posted 1 patch 4 years, 5 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210821094527.491232-1-florian.hauschild@fs.ei.tum.de
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, Mahmoud Mandour <ma.mandourr@gmail.com>, Alexandre Iooss <erdnaxe@crans.org>
include/qemu/qemu-plugin.h   |  35 ++++++++++++
plugins/meson.build          |   1 +
plugins/readwriteextension.c | 106 +++++++++++++++++++++++++++++++++++
3 files changed, 142 insertions(+)
create mode 100644 plugins/readwriteextension.c
[RFC PATCH 0/1] QEMU TCG plugin interface extensions
Posted by Florian Hauschild 4 years, 5 months ago
Hi all,

I extended the plugin interface with additional functionalities.
I wrote the extensions for fault injection/exploration reasearch using
QEMU. The additional functionalities for a plugin are:
  * Read and write guest memory
  * Read and write guest registers
  * Allow plugin to force QEMU into single step mode
  * Flush TB cache from plugin

Currently the changes are stored inside its own c file.
Should it be moved into one of the other plugin files?
Should a new config option be added to only enable the additional
extensions if set?

Best regards,
Florian


Florian Hauschild (1):
  QEMU plugin interface extension

 include/qemu/qemu-plugin.h   |  35 ++++++++++++
 plugins/meson.build          |   1 +
 plugins/readwriteextension.c | 106 +++++++++++++++++++++++++++++++++++
 3 files changed, 142 insertions(+)
 create mode 100644 plugins/readwriteextension.c

-- 
2.25.1


Re: [RFC PATCH 0/1] QEMU TCG plugin interface extensions
Posted by Alexandre IOOSS 4 years, 5 months ago
On 8/21/21 11:45 AM, Florian Hauschild wrote:
> Hi all,
> 
> I extended the plugin interface with additional functionalities.
> I wrote the extensions for fault injection/exploration reasearch using
> QEMU. The additional functionalities for a plugin are:
>    * Read and write guest memory
>    * Read and write guest registers
>    * Allow plugin to force QEMU into single step mode
>    * Flush TB cache from plugin

If something is added to read a register from a plugin, then execlog 
plugin could print the operands value of each instruction. This would 
definitely be helpful for side-channel analysis: the Hamming weight (sum 
of bits) of the last operand roughly models the power consumption 
side-channel leakage.

If I recall correctly, there are some concerns about allowing to access 
registers inside plugins. Past threads about reading/writing registers:
https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg08741.html
https://lists.gnu.org/archive/html/qemu-devel/2021-04/msg04588.html

Thanks,
-- Alexandre