[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Difficulties to access guest memory in TCG plugins
From: |
Kevin Mambu |
Subject: |
Re: Difficulties to access guest memory in TCG plugins |
Date: |
Fri, 25 Jun 2021 09:18:03 +0000 |
Thank you for you answer.
> Out of interest what is your use-case for this? The project has very
>
> deliberately avoided adding such an API for writing memory for plugins
>
> to avoid people attempting to bypass the GPL by doing things in plugins.
>
In the scope of my Ph. D subject, I want to model a DMA-like mechanism for
quick prototyping and evaluation, the plugin emulates an MMIO with
Control/Status Registers. I am actually able to pass parameters to the
Control/Status Registers through store instruction without any issue. Only the
data transfer between two guest memory regions fails at times.
> I'm not surprised. If you look at tlb_plugin_lookup you'll see the
>
> existing introspection code has to jump through some hoops to avoid race
>
> conditions that can cause updates to the internal TLB status. If we
>
> wanted to support reading values from memory that's probably doable -
>
> but for writing it would be hard to do in an idempotent way.
>
I understand, thank you for the clarification. As an alternative, I was
thinking about allocating memory in the plug-in for it to redirect guest memory
accesses into. This would certainly add significant overhead at execution time,
but at least race conditions would be consistently avoided. Could you, please,
tell me your opinion on the matter ?
Thank you,
Kévin Mambu
e: kevin.mambu@pm.me
m: +33 6 52 59 96 97