Re: [PATCH v9 3/9] plugins: Add enforcement of QEMU_PLUGIN_CB flags in register R/W callbacks

2025-06-09 Thread Julian Ganz
Hi Rowan, > This patch adds functionality to enforce the requested QEMU_PLUGIN_CB_ > flags level passed when registering a callback function using the > plugins API. Each time a callback is about to be invoked, a thread-local > variable will be updated with the level that callback requested. Then,

Re: [PATCH v5 15/25] target/ppc: call plugin trap callbacks

2025-05-26 Thread Julian Ganz
Hi Richard, sorry for the late reply to this mail in particular. I needed my memory to be refreshed. On 5/19/25 16:19, Julian Ganz wrote: > > @@ -758,6 +787,7 @@ static void powerpc_excp_7xx(PowerPCCPU *cpu, int excp) > > if (lev == 1 && cpu->vhyp) { > >

Re: [PATCH v5 05/25] target/alpha: call plugin trap callbacks

2025-05-26 Thread Julian Ganz
Hi Richard, May 26, 2025 at 11:01 AM, Richard Henderson wrote: > On 5/25/25 21:16, Julian Ganz wrote: > > Also, some targets such as tricore only have a dummy/stub do_interrupt > > and handle exceptions differently inside non-returning functions. For > > those, we would ca

Re: [PATCH v5 03/25] plugins: add hooks for new discontinuity related callbacks

2025-05-26 Thread Julian Ganz
May 25, 2025 at 10:56 PM, "Julian Ganz" wrote: > Richard Henderson wrote: > > On 5/19/25 16:19, Julian Ganz wrote: > > +QEMU_DISABLE_CFI > > +static void plugin_vcpu_cb__discon(CPUState *cpu, > > + enum qemu_plugin_discon_type type, > > + uint64_t fro

Re: [PATCH v5 03/25] plugins: add hooks for new discontinuity related callbacks

2025-05-25 Thread Julian Ganz
Hi Richard, Richard Henderson wrote: > On 5/19/25 16:19, Julian Ganz wrote: > > diff --git a/plugins/core.c b/plugins/core.c > > index dc1f5cb4d8..f07813d588 100644 > > --- a/plugins/core.c > > +++ b/plugins/core.c > > @@ -104,6 +104,44 @@ static void plugin_vc

Re: [PATCH v5 14/25] target/openrisc: call plugin trap callbacks

2025-05-25 Thread Julian Ganz
Hi Richard, > On 5/19/25 16:19, Julian Ganz wrote: > > diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c > > index 486823094c..08f0ed9b89 100644 > > --- a/target/openrisc/interrupt.c > > +++ b/target/openrisc/interrupt.c > > @@ -25,11 +25,13

Re: [PATCH v5 03/25] plugins: add hooks for new discontinuity related callbacks

2025-05-25 Thread Julian Ganz
Hi Richard, CC-ing all the maintainers again. Richard Henderson wrote: > On 5/19/25 16:19, Julian Ganz wrote: > > +QEMU_DISABLE_CFI > > +static void plugin_vcpu_cb__discon(CPUState *cpu, > > + enum qemu_pl

Re: [PATCH v5 05/25] target/alpha: call plugin trap callbacks

2025-05-25 Thread Julian Ganz
Hi Richard, May 25, 2025 at 2:14 PM, Richard Henderson wrote: > Having read the whole series now, I think it would be better to change the > TCGCPUOps.do_interrupt interface. > > Instead of having each target call qemu_plugin_*, instead have each > do_interrupt return the discontinuity type, or

Re: [PATCH v5 08/25] target/hppa: call plugin trap callbacks

2025-05-24 Thread Julian Ganz
Hi Richard, thanks for the feedback. For some reason only three of your replies made it to my inbox, but I've seen them (on lore.kernel.org) and I will incorporate it. May 24, 2025 at 7:07 PM, Richard Henderson wrote: > On 5/19/25 16:19, Julian Ganz wrote: > > diff --git

Re: [PATCH v3 2/8] Add register write API

2025-05-22 Thread Julian Ganz
Hi Rowan, May 22, 2025 at 5:02 PM, Rowan Hart wrote: > > Again, what was the reason for moving `qemu_plugin_read_register`? > > I moved it so it's grouped with get_registers above instead of being > separated below the memory functions. I can move it back, just seemed nicer > that way. The mov

Re: [PATCH v3 2/8] Add register write API

2025-05-22 Thread Julian Ganz
e_t len) > return true; > } > > -int qemu_plugin_read_register(struct qemu_plugin_register *reg, GByteArray > *buf) > -{ > -g_assert(current_cpu); > - > -return gdb_read_register(current_cpu, buf, GPOINTER_TO_INT(reg) - 1); > -} > - Again, what was the reason for moving `qemu_plugin_read_register`? Reviewed-By: Julian Ganz Regards, Julian

Re: [PATCH v3 1/8] Expose gdb_write_register function to consumers of gdbstub

2025-05-22 Thread Julian Ganz
In this case maybe one motivating the change in one or two sentences. It's obvious enough from context here, but you want at least some context when stumbling accross a commit in isolation (e.g. after consulting git blame). Reviewed-By: Julian Ganz Regards, Julian

Re: [PATCH v3 5/8] Add memory hardware address read/write API

2025-05-22 Thread Julian Ganz
Hi Rowan, > diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h > index eff8430b4a..d4f229abd9 100644 > --- a/include/qemu/qemu-plugin.h > +++ b/include/qemu/qemu-plugin.h > @@ -1014,6 +1014,102 @@ QEMU_PLUGIN_API > bool qemu_plugin_write_memory_vaddr(uint64_t addr, >

Re: [PATCH v5 23/25] tests: add plugin asserting correctness of discon event's to_pc

2025-05-20 Thread Julian Ganz
Hi Pierrick, May 20, 2025 at 10:01 PM, Pierrick Bouvier wrote: > Regarding the issue with the same tb being mapped at different virtual > addresses, I'm ok with the current solution of comparing only page bits. > > That said, a better solution could be to compare physical addresses when a > dis

[PATCH v5 08/25] target/hppa: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
We identified a number of exceptions as interrupts, and we assume any unknown exception is also an interrupt. HPPA appears to not have any form of host-call. This change places the hook for PA-RISC targets. Signed-off-by: Julian Ganz --- target/hppa/int_helper.c | 44

[PATCH v5 24/25] tests: add test for double-traps on rv64

2025-05-19 Thread Julian Ganz
We do have a number of test-case for various architectures exercising their interrupt/exception logic. However, for the recently introduced trap API we also want to exercise the logic for double traps on at least one architecture. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Julian Ganz

[PATCH v5 25/25] tests: add test with interrupted memory accesses on rv64

2025-05-19 Thread Julian Ganz
interactions on faster machines. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Julian Ganz --- tests/tcg/riscv64/Makefile.softmmu-target | 6 ++ tests/tcg/riscv64/interruptedmemory.S | 67 +++ 2 files changed, 73 insertions(+) create mode 100644 tests/tcg/riscv64

[PATCH v5 19/25] target/sh4: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for SuperH targets. Signed-off-by: Julian Ganz

[PATCH v5 12/25] target/microblaze: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
special "exception" for interrupts and no host calls. Signed-off-by: Julian Ganz --- target/microblaze/helper.c | 8 1 file changed, 8 insertions(+) diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index 9203192483..27283c5dc4 100644 --- a/target/microblaz

[PATCH v5 03/25] plugins: add hooks for new discontinuity related callbacks

2025-05-19 Thread Julian Ganz
corresponding hooks called from target specific code inside qemu. Reviewed-by: Pierrick Bouvier Signed-off-by: Julian Ganz --- include/qemu/plugin.h | 12 ++ plugins/core.c| 53 +++ 2 files changed, 65 insertions(+) diff --git a/include

[PATCH v5 23/25] tests: add plugin asserting correctness of discon event's to_pc

2025-05-19 Thread Julian Ganz
address bits via the `compare-addr-bits` option. Signed-off-by: Julian Ganz --- Pierrick: I did implement the changes you requested, but I did not add your Reviewed-By because I felt the changes were not trivial enough to not require a new, coarse review. tests/tcg/plugins/discons.c | 216

[PATCH v5 05/25] target/alpha: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Alpha targets. Signed-off-by: Julian Ganz

[PATCH v5 04/25] contrib/plugins: add plugin showcasing new dicontinuity related API

2025-05-19 Thread Julian Ganz
Bouvier Signed-off-by: Julian Ganz --- contrib/plugins/meson.build | 3 +- contrib/plugins/traps.c | 86 + docs/about/emulation.rst| 8 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 contrib/plugins/traps.c diff --git a

[PATCH v5 18/25] target/s390x: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
ogram interrupts" and service calls as exceptions. We treat external and io "exceptions" as well as resets as interrupts. Acked-by: David Hildenbrand Signed-off-by: Julian Ganz --- target/s390x/tcg/excp_helper.c | 8 1 file changed, 8 insertions(+) diff --git a/target/s390x

[PATCH v5 14/25] target/openrisc: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
resets, timer and device interrupts as exceptions. Signed-off-by: Julian Ganz --- target/openrisc/interrupt.c | 13 + 1 file changed, 13 insertions(+) diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c index 486823094c..08f0ed9b89 100644 --- a/target/openrisc

[PATCH v5 00/25] tcg-plugins: add hooks for discontinuities

2025-05-19 Thread Julian Ganz
target-agnostic definition of the relevant event(s) - Call hooks from architecture-code rather than accel/tcg/cpu-exec.c - Added a plugin showcasing API usage Julian Ganz (25): plugins: add types for callbacks related to certain discontinuities plugins: add API for registering discontinuity c

[PATCH v5 06/25] target/arm: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
the (V)IRQ, (VI/VF)NMI, (V)FIQ and VSERR exceptions as interrupts since they are, presumably, async in nature. Signed-off-by: Julian Ganz --- target/arm/helper.c | 24 target/arm/tcg/m_helper.c | 18 ++ 2 files changed, 42 insertions(+) diff --git a

[PATCH v5 11/25] target/m68k: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Motorola 68000 targets. Signed-off-by: Julian

[PATCH v5 10/25] target/loongarch: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
special "exception" for interrupts and no host calls. Signed-off-by: Julian Ganz --- target/loongarch/cpu.c | 4 1 file changed, 4 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index f7535d1be7..d1ed56d15e 100644 --- a/target/loongarch/cpu.c +++ b/target

[PATCH v5 16/25] target/riscv: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
Barboza Reviewed-by: Alistair Francis Signed-off-by: Julian Ganz --- target/riscv/cpu_helper.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index d5039f69a9..dce7e34cba 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv

[PATCH v5 09/25] target/i386: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places the hook for x86 targets. Signed-off-by: Julian Ganz

[PATCH v5 15/25] target/ppc: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Power PC targets. Signed-off-by: Julian Ganz

[PATCH v5 17/25] target/rx: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Renesas Xtreme targets. Signed-off-by: Julian

[PATCH v5 07/25] target/avr: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
only know interrupts. Signed-off-by: Julian Ganz --- target/avr/helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/avr/helper.c b/target/avr/helper.c index b9cd6d5ef2..f28cc08637 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -28,6 +28,7 @@ #include "

[PATCH v5 20/25] target/sparc: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
interrupt other than EXTINT and IVEC as exceptions as they appear to be synchroneous events. Signed-off-by: Julian Ganz --- target/sparc/int32_helper.c | 7 +++ target/sparc/int64_helper.c | 10 ++ 2 files changed, 17 insertions(+) diff --git a/target/sparc/int32_helper.c b/target

[PATCH v5 13/25] target/mips: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
EXT_INTERRUPT to be asynchronous interrupts rather than exceptions. Signed-off-by: Julian Ganz --- target/mips/tcg/system/tlb_helper.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/target/mips/tcg/system/tlb_helper.c b/target/mips/tcg/system/tlb_helper.c index eccaf3624c

[PATCH v5 22/25] target/xtensa: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
Signed-off-by: Julian Ganz --- target/xtensa/exc_helper.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/xtensa/exc_helper.c b/target/xtensa/exc_helper.c index b611c9bf97..fdc522698d 100644 --- a/target/xtensa/exc_helper.c +++ b/target/xtensa/exc_helper.c @@ -32,6 +32,7 @@ #include

[PATCH v5 21/25] target/tricore: call plugin trap callbacks

2025-05-19 Thread Julian Ganz
implemented for this target and it has no host calls. Signed-off-by: Julian Ganz --- target/tricore/op_helper.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c index 9910c13f4b..9bd6ce55d1 100644 --- a/target/tricore/op_helper.c

[PATCH v5 01/25] plugins: add types for callbacks related to certain discontinuities

2025-05-19 Thread Julian Ganz
ed to such events. Since possible modes and the enumeration of interupts and exceptions vary greatly between different architectures, the callback type only receives the VCPU id, the type of event as well as the old and new PC. Reviewed-by: Pierrick Bouvier Signed-off-by: Julian Ganz --- in

[PATCH v5 02/25] plugins: add API for registering discontinuity callbacks

2025-05-19 Thread Julian Ganz
define one distinct plugin event type for each type of discontinuity, granting fine control to plugins in term of which events they receive. Reviewed-by: Pierrick Bouvier Signed-off-by: Julian Ganz --- include/qemu/plugin-event.h | 3 +++ include/qemu/qemu-plugin.h | 16 plugins

Re: [PATCH v4 21/23] tests: add plugin asserting correctness of discon event's to_pc

2025-05-13 Thread Julian Ganz
Hi Pierrick, May 13, 2025 at 9:45 AM, Julian Ganz wrote: > May 13, 2025 at 2:25 AM, Pierrick Bouvier wrote: > > [...] > > + if (trace_all_insns) { > > + g_autoptr(GString) report = g_string_new(NULL); > > + g_string_append_printf(report, "Exec insn at %"PRI

Re: [PATCH v4 21/23] tests: add plugin asserting correctness of discon event's to_pc

2025-05-13 Thread Julian Ganz
Hi Pierrick, May 13, 2025 at 2:25 AM, Pierrick Bouvier wrote: > On 5/11/25 6:14 AM, Julian Ganz wrote: > > +static void vcpu_discon(qemu_plugin_id_t id, unsigned int vcpu_index, > > + enum qemu_plugin_discon_type type, uint64_t from_pc, > > + uint64_t to_pc) > >

Re: [PATCH v4 04/23] contrib/plugins: add plugin showcasing new dicontinuity related API

2025-05-13 Thread Julian Ganz
Hi Pierrick, May 13, 2025 at 12:45 AM, Pierrick Bouvier wrote: > On 5/11/25 6:13 AM, Julian Ganz wrote: > > > > > We recently introduced new plugin API for registration of discontinuity > > related callbacks. This change introduces a minimal plugin showcasing > >

Re: [PATCH v4 18/23] target/s390x: call plugin trap callbacks

2025-05-12 Thread Julian Ganz
Hi list, I messed up the last messages From-address when drafting the mail by hand. Sorry for the noise. > Hi David, > > It appears you only replied to the qemu-devel list? I just saw this when > informing a co-worker about this series. > >> On 11.05.25 15:14, Julian Ganz wr

[PATCH v4 23/23] tests: add test with interrupted memory accesses on rv64

2025-05-11 Thread Julian Ganz
interactions on faster machines. Signed-off-by: Julian Ganz --- tests/tcg/riscv64/Makefile.softmmu-target | 6 ++ tests/tcg/riscv64/interruptedmemory.S | 67 +++ 2 files changed, 73 insertions(+) create mode 100644 tests/tcg/riscv64/interruptedmemory.S diff --git a

[PATCH v4 13/23] target/mips: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
EXT_INTERRUPT to be asynchronous interrupts rather than exceptions. Signed-off-by: Julian Ganz --- target/mips/tcg/system/tlb_helper.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/target/mips/tcg/system/tlb_helper.c b/target/mips/tcg/system/tlb_helper.c index eccaf3624c

[PATCH v4 22/23] tests: add test for double-traps on rv64

2025-05-11 Thread Julian Ganz
We do have a number of test-caes for various architectures exercising their interrupt/exception logic. However, for the recently introduced trap API we also want to exercise the logic for double traps on at leat one architecture. Signed-off-by: Julian Ganz --- tests/tcg/riscv64/Makefile.softmmu

[PATCH v4 08/23] target/hppa: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
We identified a number of exceptions as interrupts, and we assume any unknown exception is also an interrupt. HPPA appears to not have any form of host-call. This change places the hook for PA-RISC targets. Signed-off-by: Julian Ganz --- target/hppa/int_helper.c | 44

[PATCH v4 05/23] target/alpha: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Alpha targets. Signed-off-by: Julian Ganz

[PATCH v4 21/23] tests: add plugin asserting correctness of discon event's to_pc

2025-05-11 Thread Julian Ganz
address bits via the `compare-addr-bits` option. Signed-off-by: Julian Ganz --- tests/tcg/plugins/discons.c | 219 ++ tests/tcg/plugins/meson.build | 2 +- 2 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/plugins/discons.c diff

[PATCH v4 01/23] plugins: add types for callbacks related to certain discontinuities

2025-05-11 Thread Julian Ganz
ed to such events. Since possible modes and the enumeration of interupts and exceptions vary greatly between different architectures, the callback type only receives the VCPU id, the type of event as well as the old and new PC. Signed-off-by: Julian Ganz --- include/qemu/plugin.h | 1 + in

[PATCH v4 06/23] target/arm: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
the (V)IRQ, (VI/VF)NMI, (V)FIQ and VSERR exceptions as interrupts since they are, presumably, async in nature. Signed-off-by: Julian Ganz --- target/arm/helper.c | 24 target/arm/tcg/m_helper.c | 18 ++ 2 files changed, 42 insertions(+) diff --git a

[PATCH v4 03/23] plugins: add hooks for new discontinuity related callbacks

2025-05-11 Thread Julian Ganz
corresponding hooks called from target specific code inside qemu. Signed-off-by: Julian Ganz --- include/qemu/plugin.h | 12 ++ plugins/core.c| 53 +++ 2 files changed, 65 insertions(+) diff --git a/include/qemu/plugin.h b/include/qemu

[PATCH v4 07/23] target/avr: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
only know interrupts. Signed-off-by: Julian Ganz --- target/avr/helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/avr/helper.c b/target/avr/helper.c index b9cd6d5ef2..f28cc08637 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -28,6 +28,7 @@ #include "

[PATCH v4 16/23] target/riscv: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for RISC-V targets. Signed-off-by: Julian Ganz

[PATCH v4 10/23] target/loongarch: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
special "exception" for interrupts and no host calls. Signed-off-by: Julian Ganz --- target/loongarch/cpu.c | 4 1 file changed, 4 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index f7535d1be7..d1ed56d15e 100644 --- a/target/loongarch/cpu.c +++ b/target

[PATCH v4 19/23] target/sparc: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
interrupt other than EXTINT and IVEC as exceptions as they appear to be synchroneous events. Signed-off-by: Julian Ganz --- target/sparc/int32_helper.c | 7 +++ target/sparc/int64_helper.c | 10 ++ 2 files changed, 17 insertions(+) diff --git a/target/sparc/int32_helper.c b/target

[PATCH v4 17/23] target/rx: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Renesas Xtreme targets. Signed-off-by: Julian

[PATCH v4 11/23] target/m68k: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Motorola 68000 targets. Signed-off-by: Julian

[PATCH v4 04/23] contrib/plugins: add plugin showcasing new dicontinuity related API

2025-05-11 Thread Julian Ganz
#x27;windows' # lockstep uses socket.h contrib_plugins += 'lockstep' diff --git a/contrib/plugins/traps.c b/contrib/plugins/traps.c new file mode 100644 index 00..5fa5a853ee --- /dev/null +++ b/contrib/plugins/traps.c @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2025, Julian Ganz

[PATCH v4 18/23] target/s390x: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
ogram interrupts" and service calls as exceptions. We treat external and io "exceptions" as well as resets as interrupts. Signed-off-by: Julian Ganz --- target/s390x/tcg/excp_helper.c | 8 1 file changed, 8 insertions(+) diff --git a/target/s390x/tcg/excp_helper.c b/target/s39

[PATCH v4 00/23] tcg-plugins: add hooks for discontinuities

2025-05-11 Thread Julian Ganz
ltiple callbacks - Added a target-agnostic definition of the relevant event(s) - Call hooks from architecture-code rather than accel/tcg/cpu-exec.c - Added a plugin showcasing API usage Julian Ganz (23): plugins: add types for callbacks related to certain discontinuities plugins: add AP

[PATCH v4 15/23] target/ppc: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Power PC targets. Signed-off-by: Julian Ganz

[PATCH v4 12/23] target/microblaze: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
special "exception" for interrupts and no host calls. Signed-off-by: Julian Ganz --- target/microblaze/helper.c | 8 1 file changed, 8 insertions(+) diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index 9203192483..27283c5dc4 100644 --- a/target/microblaz

[PATCH v4 02/23] plugins: add API for registering discontinuity callbacks

2025-05-11 Thread Julian Ganz
define one distinct plugin event type for each type of discontinuity, granting fine control to plugins in term of which events they receive. Signed-off-by: Julian Ganz --- include/qemu/plugin-event.h | 3 +++ include/qemu/qemu-plugin.h | 16 plugins/core.c | 15

[PATCH v4 09/23] target/i386: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places the hook for x86 targets. Signed-off-by: Julian Ganz

[PATCH v4 14/23] target/openrisc: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
resets, timer and device interrupts as exceptions. Signed-off-by: Julian Ganz --- target/openrisc/interrupt.c | 13 + 1 file changed, 13 insertions(+) diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c index 486823094c..08f0ed9b89 100644 --- a/target/openrisc

[PATCH v4 20/23] target/xtensa: call plugin trap callbacks

2025-05-11 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for xtensa targets. Signed-off-by: Julian Ganz

Re: [PATCH 22/22] accel/tcg: also suppress asynchronous IRQs for cpu_io_recompile

2025-01-11 Thread Julian Ganz
n the block, we should also suppress IRQs. > > Signed-off-by: Alex Bennée > Cc: Richard Henderson > Cc: Julian Ganz > --- > accel/tcg/translate-all.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/accel/tcg/translate-all.c b/accel/tcg/tran

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2025-01-10 Thread Julian Ganz
Hi Alex, Sorry for tha late reply. January 9, 2025 at 5:33 PM, "Alex Bennée" wrote: > "Julian Ganz" writes: > > (Add Richard to CC) > > > > > Hi Pierrick, > > > > December 5, 2024 at 12:33 AM, "Pierrick Bouvier" wrote: >

Re: [RFC PATCH v3 04/11] contrib/plugins: add plugin showcasing new dicontinuity related API

2025-01-10 Thread Julian Ganz
Hi Alex, January 9, 2025 at 3:04 PM, "Alex Bennée" wrote: > Julian Ganz writes: > > We recently introduced new plugin API for registration of discontinuity > > related callbacks. This change introduces a minimal plugin showcasing > > the new API. It simply coun

Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2025-01-10 Thread Julian Ganz
Hi Alex, January 9, 2025 at 2:52 PM, "Alex Bennée" wrote: > Pierrick Bouvier writes: > > On 12/2/24 11:26, Julian Ganz wrote: > > > diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h > > > index 0fba36ae02..9c67374b7e 100644 &g

Re: [RFC PATCH v3 02/11] plugins: add API for registering discontinuity callbacks

2025-01-10 Thread Julian Ganz
Hi Alex, January 9, 2025 at 2:57 PM, "Alex Bennée" wrote: > Julian Ganz writes: > > diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h > > index 9c67374b7e..f998a465e5 100644 > > --- a/include/qemu/qemu-plugin.h > > +++ b/include/qemu

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-20 Thread Julian Ganz
Hi Pierrick, December 5, 2024 at 12:33 AM, "Pierrick Bouvier" wrote: > On 12/2/24 11:41, Julian Ganz wrote: > > +static void insn_exec(unsigned int vcpu_index, void *userdata) > > +{ > > + struct cpu_state *state = qemu_plugin_scoreboard_find(states, >

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-07 Thread Julian Ganz
Hi Richard, December 6, 2024 at 11:56 PM, "Richard Henderson" wrote: > On 12/6/24 14:40, Pierrick Bouvier wrote: > > > > > Do we have an architecture agnostic pc representation, or do we have to add > > this for every > target in {arch}_cpu_exec_interrupt? > > > We have CPUClass.get_pc, which

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-07 Thread Julian Ganz
Hi Richard, December 6, 2024 at 8:42 PM, "Richard Henderson" wrote: > On 12/6/24 13:02, Pierrick Bouvier wrote: > > On 12/6/24 00:42, Julian Ganz wrote: > > > IIUC qemu will schedule interrupts "opportunistically" between tb > > > executio

Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2024-12-07 Thread Julian Ganz
Hi Pierrick, December 6, 2024 at 7:59 PM, "Pierrick Bouvier" wrote: > On 12/6/24 00:58, Julian Ganz wrote: > > December 6, 2024 at 12:03 AM, "Pierrick Bouvier" wrote: > > > It's an interesting conversation. For the scope of this series, I agree

Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2024-12-06 Thread Julian Ganz
Hi Pierrick, December 6, 2024 at 12:03 AM, "Pierrick Bouvier" wrote: > On 12/5/24 13:50, Julian Ganz wrote: > > If you cannot rely on an input being a sensible value, doesn't that > > render the input useless? > > > I agree. If for a specific event it&#x

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-06 Thread Julian Ganz
Hi Pierrick, December 5, 2024 at 11:28 PM, "Pierrick Bouvier" wrote: > On 12/5/24 13:22, Julian Ganz wrote: > > December 5, 2024 at 6:30 PM, "Pierrick Bouvier" wrote: > > > We can store the next_expected pc for each instruction (from > > > curre

Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2024-12-05 Thread Julian Ganz
Hi Pierrick, December 5, 2024 at 10:50 PM, "Julian Ganz" wrote: > December 5, 2024 at 6:56 PM, "Pierrick Bouvier" wrote: > > Let's try to move forward, and solve the problems we have with from_pc. The > > testing part can be solved already (as explain

Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2024-12-05 Thread Julian Ganz
Hi Pierrick, December 5, 2024 at 6:56 PM, "Pierrick Bouvier" wrote: > On 12/5/24 04:40, Julian Ganz wrote: > > > > > Hi Pierrick, > > December 4, 2024 at 11:41 PM, "Pierrick Bouvier" wrote: > > > Does it mean that information return

Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2024-12-05 Thread Julian Ganz
Hi Pierrick, December 5, 2024 at 6:35 PM, "Pierrick Bouvier" wrote: > On 12/5/24 04:44, Julian Ganz wrote: > > > > > Hi Pierrick, > > December 4, 2024 at 11:45 PM, "Pierrick Bouvier" wrote: > > > > > > > > On 12/

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-05 Thread Julian Ganz
Hi Pierrick, December 5, 2024 at 6:30 PM, "Pierrick Bouvier" wrote: > On 12/5/24 05:10, Julian Ganz wrote: > > December 5, 2024 at 12:33 AM, "Pierrick Bouvier" wrote: > > > Trap target PC mismatch > > > Expected: 23faf3a80 > > > Encount

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-05 Thread Julian Ganz
Hi Pierrick, December 5, 2024 at 12:33 AM, "Pierrick Bouvier" wrote: > On 12/2/24 11:41, Julian Ganz wrote: > > > +/* > > + * Copyright (C) 2024, Julian Ganz > > + * > > + * License: GNU GPL, version 2 or later. > > + * S

Re: [RFC PATCH v3 04/11] contrib/plugins: add plugin showcasing new dicontinuity related API

2024-12-05 Thread Julian Ganz
Hi Pierrick, December 5, 2024 at 12:14 AM, "Pierrick Bouvier" wrote: > On 12/2/24 11:26, Julian Ganz wrote: > > +typedef struct { > > + uint64_t interrupts; > > + uint64_t exceptions; > > + uint64_t hostcalls; > > + bool active; > > &g

Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2024-12-05 Thread Julian Ganz
Hi Pierrick, December 4, 2024 at 11:45 PM, "Pierrick Bouvier" wrote: > On 12/2/24 11:26, Julian Ganz wrote: > > include/qemu/plugin.h | 1 + > > include/qemu/qemu-plugin.h | 43 ++ > > 2 files changed, 44 insertions(+) > >

Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2024-12-05 Thread Julian Ganz
Hi Pierrick, December 4, 2024 at 11:41 PM, "Pierrick Bouvier" wrote: > On 12/3/24 00:45, Julian Ganz wrote: > > > > > Hi, > > December 2, 2024 at 8:26 PM, "Julian Ganz" wrote: > > > > > > > > diff --git a/include/qem

Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2024-12-03 Thread Julian Ganz
Hi, December 2, 2024 at 8:26 PM, "Julian Ganz" wrote: > diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h > index 0fba36ae02..9c67374b7e 100644 > --- a/include/qemu/qemu-plugin.h > +++ b/include/qemu/qemu-plugin.h > @@ -154,

Re: [RFC PATCH v3 00/11] tcg-plugins: add hooks for discontinuities

2024-12-03 Thread Julian Ganz
Hi, I just realized that I forgot to run the checkpatch script on the patches again before sending and did not include the Sign-Off. Sorry about that. Regards, Julian Ganz

[RFC PATCH v3 08/11] target/mips: call plugin trap callbacks

2024-12-02 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for MIPS targets. --- target/mips/tcg/sysemu/tlb_hel

[RFC PATCH v3 10/11] target/sparc: call plugin trap callbacks

2024-12-02 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for SPARC (32bit and 64bit) targets. We treat any int

[RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-02 Thread Julian Ganz
/discons.c new file mode 100644 index 00..54e52f563a --- /dev/null +++ b/tests/tcg/plugins/discons.c @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2024, Julian Ganz + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include + +#include

[RFC PATCH v3 04/11] contrib/plugins: add plugin showcasing new dicontinuity related API

2024-12-02 Thread Julian Ganz
#x27;lockstep' diff --git a/contrib/plugins/traps.c b/contrib/plugins/traps.c new file mode 100644 index 00..ecd4beac5f --- /dev/null +++ b/contrib/plugins/traps.c @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2024, Julian Ganz + * + * Traps - count traps + * + * License: GNU GPL, version 2 or later

[RFC PATCH v3 07/11] target/avr: call plugin trap callbacks

2024-12-02 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places the hook for AVR targets. That architecture appears to only

[RFC PATCH v3 06/11] target/arm: call plugin trap callbacks

2024-12-02 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for ARM (and Aarch64) targets. We decided to treat th

[RFC PATCH v3 02/11] plugins: add API for registering discontinuity callbacks

2024-12-02 Thread Julian Ganz
The plugin API allows registration of callbacks for a variety of VCPU related events, such as VCPU reset, idle and resume. In addition to those events, we recently defined discontinuity events, which include traps. This change introduces a function to register callbacks for these events. We define

[RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2024-12-02 Thread Julian Ganz
The plugin API allows registration of callbacks for a variety of VCPU related events, such as VCPU reset, idle and resume. However, traps of any kind, i.e. interrupts or exceptions, were previously not covered. These kinds of events are arguably quite significant and usually go hand in hand with a

[RFC PATCH v3 05/11] target/alpha: call plugin trap callbacks

2024-12-02 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for Alpha targets. --- target/alpha/helper.c | 12 ++

[RFC PATCH v3 03/11] plugins: add hooks for new discontinuity related callbacks

2024-12-02 Thread Julian Ganz
The plugin API allows registration of callbacks for a variety of VCPU related events, such as VCPU reset, idle and resume. In addition, we recently introduced API for registering callbacks for discontinuity events, specifically for interrupts, exceptions and host calls. This change introduces the

[RFC PATCH v3 09/11] target/riscv: call plugin trap callbacks

2024-12-02 Thread Julian Ganz
We recently introduced API for registering callbacks for trap related events as well as the corresponding hook functions. Due to differences between architectures, the latter need to be called from target specific code. This change places hooks for RISC-V targets. --- target/riscv/cpu_helper.c |

  1   2   >