qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EXTERNAL] QEMU plugin system


From: Alex Bennée
Subject: Re: [EXTERNAL] QEMU plugin system
Date: Fri, 31 Jul 2020 15:47:47 +0100
User-agent: mu4e 1.5.5; emacs 28.0.50

Robert Henry <robhenry@microsoft.com> writes:

> Our approach to this problem was to make the plugin sensitive to the 
> execution of well-chosen instructions to turn on/turn off the actions of the 
> plugin. The plugin will still be called (don't unregister it) but should 
> return immediately if the on/off state is off.  This will still slow the 
> emulation down.
>
> My guest ISA is arm64.  For that ISA, we made these choices; perhaps 
> something else is better:
>   asm("hint 0b0010001");  // arm64 PSB Profile Sync Buffer (turn on)
>   asm("hint 0b0010010");  // arm64 TSB Trace Sync Buffer (turn off)
>
> Put these instructions in a library and arrange to have your
> application call the library functions as appropriate for the
> application's programming language.

Yeah this is the mechanism I was about to suggest. If you can guarantee
your library function is called before any of the code you want to
instrument then this can be used as a "trigger". 

> ________________________________
> From: Qemu-discuss <qemu-discuss-bounces+robhenry=microsoft.com@nongnu.org> 
> on behalf of Kamil Garifullin <kgariful@gmail.com>
> Sent: Wednesday, July 29, 2020 1:35 AM
> To: qemu-discuss@nongnu.org <qemu-discuss@nongnu.org>
> Subject: [EXTERNAL] QEMU plugin system
>
> Hi,
>
> I'm trying to create a plugin which will track an activity during a 
> particular period of time.
>
> Can I somehow send a signal from the guest to the instrumentation plugin?
>
> For example, I want to boot linux, do some preparations, then start a 
> targeted application and start my tracking. It can be both: do not inject 
> instrumentation until special indication or just a special plugin event to 
> set up some flags.
>
> My thoughts were to have an event which will indicate that pmon was touched. 
> It allows you to do all the preparations in the guest machine, then dump 
> pmons as an indicator to start tracking and then run the target application.


-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]