Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-23 Thread Pierrick Bouvier
On 10/23/24 10:12, Julian Ganz wrote: Hi, Pierrick, October 23, 2024 at 6:39 PM, "Pierrick Bouvier" wrote: So we could have something like: /* plugin side */ void on_cf_event(qemu_plugin_cf_event_type, uint64_t from, uint64_t to) { ... } We also need the VCPU id, but yes. Yes! /* AP

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-23 Thread Julian Ganz
Hi, Pierrick, October 23, 2024 at 6:39 PM, "Pierrick Bouvier" wrote: > > So we could have something like: > > /* plugin side */ > void on_cf_event(qemu_plugin_cf_event_type, uint64_t from, uint64_t to) { > ... > } We also need the VCPU id, but yes. > /* API side */ > void qemu_plugin_register

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-23 Thread Pierrick Bouvier
On 10/23/24 09:12, Julian Ganz wrote: Hi, Pierrick, October 23, 2024 at 5:16 PM, "Pierrick Bouvier" wrote: Hi Julian, On 10/23/24 05:56, Julian Ganz wrote: October 22, 2024 at 11:15 PM, "Pierrick Bouvier" wrote: On 10/22/24 01:21, Julian Ganz wrote: Ok, I'll introduce an enum and

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-23 Thread Julian Ganz
Hi, Pierrick, October 23, 2024 at 5:16 PM, "Pierrick Bouvier" wrote: > > Hi Julian, > > On 10/23/24 05:56, Julian Ganz wrote: > > > October 22, 2024 at 11:15 PM, "Pierrick Bouvier" wrote: > > > > > > > > On 10/22/24 01:21, Julian Ganz wrote: > > > > > > > Ok, I'll introduce an enum and co

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-23 Thread Pierrick Bouvier
On 10/23/24 06:57, Alex Bennée wrote: "Julian Ganz" writes: Hi, Pierrick, resent as I was too stupid to hit reply instead of reply-all. October 22, 2024 at 11:15 PM, "Pierrick Bouvier" wrote: On 10/22/24 01:21, Julian Ganz wrote: Hi, Pierrick, October 21, 2024 at 11:59 PM, "Pierrick B

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-23 Thread Pierrick Bouvier
Hi Julian, On 10/23/24 05:56, Julian Ganz wrote: Hi, Pierrick, resent as I was too stupid to hit reply instead of reply-all. October 22, 2024 at 11:15 PM, "Pierrick Bouvier" wrote: On 10/22/24 01:21, Julian Ganz wrote: Hi, Pierrick, October 21, 2024 at 11:59 PM, "Pierrick Bouvier" wrote

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-23 Thread Alex Bennée
"Julian Ganz" writes: > Hi, Pierrick, > > resent as I was too stupid to hit reply instead of reply-all. > > October 22, 2024 at 11:15 PM, "Pierrick Bouvier" wrote: >> >> On 10/22/24 01:21, Julian Ganz wrote: >> >> > >> > Hi, Pierrick, >> > October 21, 2024 at 11:59 PM, "Pierrick Bouvier" wrot

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-23 Thread Julian Ganz
Hi, Pierrick, resent as I was too stupid to hit reply instead of reply-all. October 22, 2024 at 11:15 PM, "Pierrick Bouvier" wrote: > > On 10/22/24 01:21, Julian Ganz wrote: > > > > > Hi, Pierrick, > > October 21, 2024 at 11:59 PM, "Pierrick Bouvier" wrote: > > > > > > > > Maybe we could ha

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-22 Thread Pierrick Bouvier
On 10/22/24 01:21, Julian Ganz wrote: Hi, Pierrick, October 21, 2024 at 11:59 PM, "Pierrick Bouvier" wrote: On 10/21/24 14:02, Julian Ganz wrote: The motivation for this API is a plugin that simulates a RISC-V tracing unit (and produces a trace). For that we actually also needed to track

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-22 Thread Julian Ganz
Hi, Alex, October 22, 2024 at 10:58 AM, "Alex Bennée" wrote: > How easy would it be to expose a Rust API? I'm curious because now we > are looking to integrate Rust into QEMU we could consider transitioning > to a Rust API for plugins. It has been done before: > > https://github.com/novafacing/q

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-22 Thread Alex Bennée
"Julian Ganz" writes: > Hi, Pierrick, > > October 21, 2024 at 11:59 PM, "Pierrick Bouvier" wrote: >> On 10/21/24 14:02, Julian Ganz wrote: >> > The motivation for this API is a plugin that simulates a RISC-V tracing >> > unit (and produces a trace). For that we actually also needed to >> > tra

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-22 Thread Julian Ganz
Hi, Pierrick, October 21, 2024 at 11:59 PM, "Pierrick Bouvier" wrote: > On 10/21/24 14:02, Julian Ganz wrote: > > The motivation for this API is a plugin that simulates a RISC-V tracing > > unit (and produces a trace). For that we actually also needed to > > track the "regular" control flow, i.

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-21 Thread Pierrick Bouvier
On 10/21/24 14:02, Julian Ganz wrote: Hi, Pierrick, October 21, 2024 at 8:00 PM, "Pierrick Bouvier" wrote: I agree it would be useful. Beyond the scope of this series, it would be nice if we could add a control flow related API instead of asking to plugins to do it themselves. If we would prov

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-21 Thread Julian Ganz
Hi, Pierrick, October 21, 2024 at 8:00 PM, "Pierrick Bouvier" wrote: > I agree it would be useful. Beyond the scope of this series, it would be > nice if we could add a control flow related API instead of asking to > plugins to do it themselves. > > If we would provide something like this, is t

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-21 Thread Pierrick Bouvier
On 10/21/24 11:47, Alex Bennée wrote: Pierrick Bouvier writes: Hi Julian, On 10/19/24 09:39, Julian Ganz wrote: Some analysis greatly benefits, or depends on, information about interrupts. For example, we may need to handle the execution of a new translation block differently if it is not

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-21 Thread Alex Bennée
Pierrick Bouvier writes: > Hi Julian, > > On 10/19/24 09:39, Julian Ganz wrote: >> Some analysis greatly benefits, or depends on, information about >> interrupts. For example, we may need to handle the execution of a new >> translation block differently if it is not the result of normal program >

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-21 Thread Pierrick Bouvier
Hi Julian, On 10/19/24 09:39, Julian Ganz wrote: Some analysis greatly benefits, or depends on, information about interrupts. For example, we may need to handle the execution of a new translation block differently if it is not the result of normal program flow but of an interrupt. Even with the

Re: [RFC PATCH v2 0/7] tcg-plugins: add hooks for interrupts, exceptions and traps

2024-10-20 Thread Alex Bennée
Julian Ganz writes: > Some analysis greatly benefits, or depends on, information about > interrupts. For example, we may need to handle the execution of a new > translation block differently if it is not the result of normal program > flow but of an interrupt. For future iterations please post a