Am 21.08.21 um 15:18 schrieb Peter Maydell:
> On Sat, 21 Aug 2021 at 10:48, Florian Hauschild
> <florian.hausch...@fs.ei.tum.de> wrote:
>>
>> This extension covers functions:
>> * to read and write guest memory
>> * to read and write guest registers
>> * to flush tb cache
>> * to control single stepping of qemu from plugin
>>
>> These changes allow the user to
>> * collect more information about the behaviour of the system
>> * change the guest state with a plugin during execution
>> * control cache of tcg
>> * allow for precise instrumentation in execution flow
>
>> +
>> +static int plugin_read_register(CPUState *cpu, GByteArray *buf, int reg)
>> +{
>> + CPUClass *cc = CPU_GET_CLASS(cpu);
>> + if (reg < cc->gdb_num_core_regs) {
>> + return cc->gdb_read_register(cpu, buf, reg);
>> + }
>> + return 0;
>> +}
>
> At the point where these functions execute is the emulation
> definitely stopped (ie no register values currently held
> live in TCG locals) ?
>
> -- PMM
>
I am not sure, if it is definitely stopped.
I call them during tb_exec_cb and insn_exec_cb.
I have used the extension on ARM and RISC-V single cpu guests and the
data collected is the one i would expect during normal execution on real
hardware. How this would behave on a multi cpu/core system i have not
tested yet.
Currently i am looking into this and as soon as i have found an answer i
will write back again.
Regards
Florian