RE: TCG asserts on some of translation blocks with plugin memory callback

2023-02-17 Thread Mikhail Tyutin
> I have been testing TCG plugin patch on latest Qemu build but noticed that it > fails with assert on some of the applications. > >ERROR:../accel/tcg/cpu-exec.c:983:cpu_exec_loop: >assertion failed: (cpu->plugin_mem_cbs == ((void *)0)) > It seems that the problem is around tcg_ctx->

TCG asserts on some of translation blocks with plugin memory callback

2023-02-16 Thread Mikhail Tyutin
Hello, I have been testing TCG plugin patch on latest Qemu build but noticed that it fails with assert on some of the applications. ERROR:../accel/tcg/cpu-exec.c:983:cpu_exec_loop: assertion failed: (cpu->plugin_mem_cbs == ((void *)0)) It happens when TCG plugin sets memory callb

Re: Plugin Memory Callback Debugging

2023-01-06 Thread Emilio Cota
On Fri, Jan 6, 2023, 5:31 AM Alex Bennée wrote: > Are you going to be able to post the patches soon? I'd like to get the > fixes in as early in the cycle as possible. > I intend to post this series on Sunday. Thanks, Emilio

Re: Plugin Memory Callback Debugging

2023-01-06 Thread Alex Bennée
Aaron Lindsay writes: > Emilio, > > On Dec 18 00:24, Emilio Cota wrote: >> On Tue, Nov 29, 2022 at 15:37:51 -0500, Aaron Lindsay wrote: >> (snip) >> > > Does this hint that there are cases where reset cpu->plugin_mem_cbs to >> > > NULL is >> > > getting optimized away, but not the code to set

Re: Plugin Memory Callback Debugging

2022-12-19 Thread Aaron Lindsay
Emilio, On Dec 18 00:24, Emilio Cota wrote: > On Tue, Nov 29, 2022 at 15:37:51 -0500, Aaron Lindsay wrote: > (snip) > > > Does this hint that there are cases where reset cpu->plugin_mem_cbs to > > > NULL is > > > getting optimized away, but not the code to set it in the first place? > > > > Is t

Re: Plugin Memory Callback Debugging

2022-12-17 Thread Emilio Cota
On Tue, Nov 29, 2022 at 15:37:51 -0500, Aaron Lindsay wrote: (snip) > > Does this hint that there are cases where reset cpu->plugin_mem_cbs to NULL > > is > > getting optimized away, but not the code to set it in the first place? > > Is there anyone who could help take a look at this from the cod

Re: Plugin Memory Callback Debugging

2022-12-01 Thread Alex Bennée
Aaron Lindsay writes: > On Nov 22 10:57, Aaron Lindsay wrote: >> On Nov 21 18:22, Richard Henderson wrote: >> > On 11/21/22 13:51, Alex Bennée wrote: >> > > >> > > Aaron Lindsay writes: >> > > >> > > > On Nov 15 22:36, Alex Bennée wrote: >> > > > > Aaron Lindsay writes: >> > > > > > I belie

Re: Plugin Memory Callback Debugging

2022-11-29 Thread Aaron Lindsay via
On Nov 22 10:57, Aaron Lindsay wrote: > On Nov 21 18:22, Richard Henderson wrote: > > On 11/21/22 13:51, Alex Bennée wrote: > > > > > > Aaron Lindsay writes: > > > > > > > On Nov 15 22:36, Alex Bennée wrote: > > > > > Aaron Lindsay writes: > > > > > > I believe the code *should* always reset `c

Re: Plugin Memory Callback Debugging

2022-11-22 Thread Aaron Lindsay via
On Nov 21 22:02, Alex Bennée wrote: > > Aaron Lindsay writes: > > > Sorry, left off the very end of my timeline: > > > > On Nov 18 16:58, Aaron Lindsay wrote: > >> I have, so far, discovered the following timeline: > >> 1. My plugin receives a instruction execution callback for a load > >>in

Re: Plugin Memory Callback Debugging

2022-11-22 Thread Aaron Lindsay via
On Nov 21 18:22, Richard Henderson wrote: > On 11/21/22 13:51, Alex Bennée wrote: > > > > Aaron Lindsay writes: > > > > > On Nov 15 22:36, Alex Bennée wrote: > > > > Aaron Lindsay writes: > > > > > I believe the code *should* always reset `cpu->plugin_mem_cbs` to > > > > > NULL at the > > > >

Re: Plugin Memory Callback Debugging

2022-11-21 Thread Richard Henderson
On 11/21/22 13:51, Alex Bennée wrote: Aaron Lindsay writes: On Nov 15 22:36, Alex Bennée wrote: Aaron Lindsay writes: I believe the code *should* always reset `cpu->plugin_mem_cbs` to NULL at the end of an instruction/TB's execution, so its not exactly clear to me how this is occurring. Ho

Re: Plugin Memory Callback Debugging

2022-11-21 Thread Alex Bennée
Aaron Lindsay writes: > Sorry, left off the very end of my timeline: > > On Nov 18 16:58, Aaron Lindsay wrote: >> I have, so far, discovered the following timeline: >> 1. My plugin receives a instruction execution callback for a load >>instruction. At this time, cpu->plugin_mem_cbs points t

Re: Plugin Memory Callback Debugging

2022-11-21 Thread Alex Bennée
Aaron Lindsay writes: > On Nov 15 22:36, Alex Bennée wrote: >> Aaron Lindsay writes: >> > I believe the code *should* always reset `cpu->plugin_mem_cbs` to NULL at >> > the >> > end of an instruction/TB's execution, so its not exactly clear to me how >> > this >> > is occurring. However, I s

Re: Plugin Memory Callback Debugging

2022-11-21 Thread Aaron Lindsay via
On Nov 15 22:36, Alex Bennée wrote: > Aaron Lindsay writes: > > I believe the code *should* always reset `cpu->plugin_mem_cbs` to NULL at > > the > > end of an instruction/TB's execution, so its not exactly clear to me how > > this > > is occurring. However, I suspect it may be relevant that we

Re: Plugin Memory Callback Debugging

2022-11-18 Thread Aaron Lindsay via
On Nov 15 22:36, Alex Bennée wrote: > > Aaron Lindsay writes: > > > Hello, > > > > I have been wrestling with what might be a bug in the plugin memory > > callbacks. The immediate error is that I hit the > > `g_assert_not_reached()` in the 'default:' case in > > qemu_plugin_vcpu_mem_cb, indicati

Re: Plugin Memory Callback Debugging

2022-11-18 Thread Aaron Lindsay
Sorry, left off the very end of my timeline: On Nov 18 16:58, Aaron Lindsay wrote: > I have, so far, discovered the following timeline: > 1. My plugin receives a instruction execution callback for a load >instruction. At this time, cpu->plugin_mem_cbs points to the same >memory which will

Re: Plugin Memory Callback Debugging

2022-11-15 Thread Emilio Cota
On Tue, Nov 15, 2022 at 22:36:07 +, Alex Bennée wrote: > This is exactly the sort of thing rr is great for. Can you trigger it in > that? > > https://rr-project.org/ The sanitizers should also help. For TLB flush tracing, defining DEBUG_TLB at the top of cputlb.c might be useful.

Re: Plugin Memory Callback Debugging

2022-11-15 Thread Alex Bennée
Aaron Lindsay writes: > Hello, > > I have been wrestling with what might be a bug in the plugin memory > callbacks. The immediate error is that I hit the > `g_assert_not_reached()` in the 'default:' case in > qemu_plugin_vcpu_mem_cb, indicating the callback type was invalid. When > breaking on

Plugin Memory Callback Debugging

2022-11-15 Thread Aaron Lindsay
Hello, I have been wrestling with what might be a bug in the plugin memory callbacks. The immediate error is that I hit the `g_assert_not_reached()` in the 'default:' case in qemu_plugin_vcpu_mem_cb, indicating the callback type was invalid. When breaking on this assertion in gdb, the contents of

[PULL 23/23] tests/acceptance: add a memory callback check

2021-02-18 Thread Alex Bennée
This test makes sure that the inline and callback based memory checks count the same number of accesses. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210213130325.14781-24-alex.ben...@linaro.org> diff --git a/tests/acceptance/tcg_plugins.py b/tests/acceptance/tc

Re: [PATCH v3 23/23] tests/acceptance: add a memory callback check

2021-02-13 Thread Philippe Mathieu-Daudé
On 2/13/21 2:03 PM, Alex Bennée wrote: > This test makes sure that the inline and callback based memory checks > count the same number of accesses. > > Signed-off-by: Alex Bennée > --- > tests/acceptance/tcg_plugins.py | 31 +++ > 1 file changed, 31 insertions(+) Rev

[PATCH v3 23/23] tests/acceptance: add a memory callback check

2021-02-13 Thread Alex Bennée
This test makes sure that the inline and callback based memory checks count the same number of accesses. Signed-off-by: Alex Bennée --- tests/acceptance/tcg_plugins.py | 31 +++ 1 file changed, 31 insertions(+) diff --git a/tests/acceptance/tcg_plugins.py b/tests/acc

Memory callback

2020-07-08 Thread Super Man
Sorry to bother you, I would like to ask a question.I want to use qemu to monitor the information of the target thread reading and writing memory. I see that qemu supports the tcg plugin, but I just find the following code in plugin-gen.c .Do I just need to add a record function in it? How do I rea