Ziyang Zhang
731525c276
plugins: use int64_t for the syscall filter return value
...
The syscall return value passed back through the syscall filter
callback is semantically signed: negative values encode errno codes.
Declaring the sysret pointer as uint64_t * is therefore misleading and
forces callers to launder the value through an unsigned temporary.
Change the sysret pointer to int64_t * across the public plugin API
typedef (qemu_plugin_vcpu_syscall_filter_cb_t), the internal
qemu_plugin_vcpu_syscall_filter() prototypes and stub, its
implementation in plugins/core.c, the linux-user caller, and the
in-tree example plugins.
Signed-off-by: Ziyang Zhang <functioner@sjtu.edu.cn >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
Link: https://lore.kernel.org/qemu-devel/20260618082426.790315-2-functioner@sjtu.edu.cn
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-18 16:47:12 -07:00
Pierrick Bouvier
25c6c15f7d
plugins: add userdata to qemu_plugin_register_vcpu_syscall_ret_cb
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-23-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
6a6001021e
plugins: remove qemu_plugin_id from qemu_plugin_vcpu_syscall_ret_cb_t
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-22-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
d7706f7e89
plugins: add userdata to qemu_plugin_register_vcpu_syscall_filter_cb
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-21-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
b8cdea393f
plugins: remove qemu_plugin_id from qemu_plugin_vcpu_syscall_filter_cb_t
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-20-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
1abe87fd59
plugins: add userdata to qemu_plugin_register_vcpu_syscall_cb
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-19-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
0d71602089
plugins: remove qemu_plugin_id from qemu_plugin_vcpu_syscall_cb_t
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-18-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
285c40aaac
plugins: add userdata to qemu_plugin_vcpu_tb_trans_cb_t
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-17-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
ab24e19b42
plugins: remove qemu_plugin_id from qemu_plugin_vcpu_tb_trans_cb_t
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-16-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
65f399bce2
plugins: remove qemu_plugin_id from qemu_plugin_vcpu_discon_cb_t
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-15-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
041dca1e1b
plugins: add userdata to qemu_plugin_register_vcpu_discon_cb
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-14-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
0079bbd8d5
plugins: add userdata to qemu_plugin_vcpu_for_each
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-12-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
e12944179a
plugins: add userdata to qemu_plugin_register_vcpu_resume_cb
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-11-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
89662f8903
plugins: add userdata to qemu_plugin_register_vcpu_idle_cb
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-10-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
214d9c0e33
plugins: add userdata to qemu_plugin_register_vcpu_exit_cb
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-9-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
7cb918441a
plugins: add userdata to qemu_plugin_register_vcpu_init_cb
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-8-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
6be156bd4d
plugins: remove qemu_plugin_id_t from qemu_plugin_vcpu_simple_cb_t
...
Not used in all our plugins.
Future commits will remove qemu_plugin_vcpu_simple_cb_t completely, and
replace it with qemu_plugin_vcpu_udata_cb_t, so id information can be
passed using userdata if needed.
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-7-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
32a0ddf36a
plugins: remove qemu_plugin_id_t from qemu_plugin_udata_cb_t
...
We can now rely on userdata being always available to pass down this id
if needed.
In our plugins, only tests/tcg/plugins/reset.c was using it.
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-6-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Pierrick Bouvier
58ba4498d8
plugins: add userdata to qemu_plugin_register_flush_cb
...
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260615193526.2883349-4-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com >
2026-06-16 10:59:05 -07:00
Florian Hofhammer
d16ffa4244
plugins: add flag to specify whether PC is rw
...
In addition to the flags specifying whether general-purpose registers
are read-write (rw) during a plugin callback, we add an additional flag
explicitly stating whether the PC is writable. This is in preparation of
a patch that allows to explicitly set the PC to divert control flow from
within a plugin callback, which is currently not possible.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Florian Hofhammer <florian.hofhammer@epfl.ch >
Link: https://lore.kernel.org/qemu-devel/20260305-setpc-v5-v7-2-4c3adba52403@epfl.ch
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
2026-03-05 10:54:09 -08:00
Pierrick Bouvier
2cc35f14ba
plugins/core: clamp syscall arguments if target is 32-bit
...
Syscall arguments are abi_long in user code, and plugin syscall
interface works with uint64_t only.
According to C integer promotion rules, the value is sign extended
before becoming unsigned, thus setting high bits when only 32-bit lower
ones should have a significant value.
As a result, we need to clamp values we receive from user-code
accordingly.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260305-setpc-v5-v7-1-4c3adba52403@epfl.ch
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
2026-03-05 10:54:09 -08:00
Pierrick Bouvier
cab15547f1
plugins: move qemu-plugin.h to include/plugins/
...
This change has two benefits:
- ensure plugins can't include anything else from QEMU than plugins API
- when compiling a C++ module, solves the header conflict with iostream
header that includes transitively the wrong ctype.h, which already
exists in include/qemu.
By Hyrum's law, there was already one usage of other headers with mem
plugin, which has been eliminated in previous commit.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Link: https://lore.kernel.org/qemu-devel/20260124182921.531562-7-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
2026-01-29 09:34:14 -08:00
Ziyang Zhang
5ed628d1d3
linux-user: add plugin API to filter syscalls
...
This commit adds a syscall filter API to the TCG plugin API set.
Plugins can register a filter callback to QEMU to decide whether
to intercept a syscall, process it and bypass the QEMU syscall
handler.
Signed-off-by: Ziyang Zhang <functioner@sjtu.edu.cn >
Co-authored-by: Mingyuan Xia <xiamy@ultrarisc.com >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
[Pierrick - move send_through_syscall_filters to linux-user/syscall.c]
Link: https://lore.kernel.org/qemu-devel/20251214144620.179282-2-functioner@sjtu.edu.cn
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
2026-01-29 09:34:14 -08:00
Alex Bennée
81c5a3f867
plugins/core: allow reading of registers during discon events
...
We have protections that prevent callbacks that didn't declare
themselves as wanting to access registers. However for discontinuities
the system state is fully rectified so they should always be able to
read the register values.
a1688bc86c (plugins: add hooks for new discontinuity related callbacks)
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Cc: Julian Ganz <neither@nut.email >
Reviewed-by: Julian Ganz <neither@nut.email >
Message-ID: <20251204194902.1340008-12-alex.bennee@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
2025-12-05 15:26:19 +00:00
Alex Bennée
78bd26bbf0
plugins/core: add missing QEMU_DISABLE_CFI annotations
...
Most of the memory callbacks come directly from the generated code
however we have do have a a direct from C callback for the slow-path
and memory helpers.
There is also a reset callback that calls out to plugins.
Like the other plugin points we need to disable CFI as we are making
function calls to dynamically linked libraries.
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/3175
Reported-by: Peter Maydell <peter.maydell@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-ID: <20251027110344.2289945-33-alex.bennee@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
2025-10-29 14:12:43 +00:00
Julian Ganz
a1688bc86c
plugins: add hooks for new discontinuity related callbacks
...
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 corresponding hooks called from target
specific code inside qemu.
Signed-off-by: Julian Ganz <neither@nut.email >
Message-ID: <20251027110344.2289945-10-alex.bennee@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
2025-10-29 14:12:43 +00:00
Julian Ganz
aac73d85d2
plugins: add API for registering discontinuity callbacks
...
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 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 <pierrick.bouvier@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Julian Ganz <neither@nut.email >
Message-ID: <20251027110344.2289945-9-alex.bennee@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
2025-10-29 14:12:43 +00:00
Richard Henderson
7330741b3e
plugins: Use tb_flush__exclusive_or_serial
...
In all cases, we are already within start_exclusive.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-09-24 10:29:43 -07:00
Rowan Hart
766e00bd57
plugins: Add enforcement of QEMU_PLUGIN_CB flags in register R/W callbacks
...
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,
called API functions (in particular, the register read and write API)
will call qemu_plugin_get_cb_flags() to check the level is at least the
level they require.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Rowan Hart <rowanbhart@gmail.com >
Message-ID: <20250624175351.440780-4-rowanbhart@gmail.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-ID: <20250627112512.1880708-8-alex.bennee@linaro.org >
2025-07-02 10:09:48 +01:00
Alex Bennée
606ad7fe17
plugins/core: make a single build unit
...
Trim through the includes and remove everything not needed for the
core. Only include tcg-op-common.h to remove the need to
TARGET_LONG_BITS and move the build unit into the common set.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20250304222439.2035603-31-alex.bennee@linaro.org >
2025-03-10 10:30:01 +00:00
Pierrick Bouvier
b709da5d29
plugins: save value during memory accesses
...
Different code paths handle memory accesses:
- tcg generated code
- load/store helpers
- atomic helpers
This value is saved in cpu->neg.plugin_mem_value_{high,low}. Values are
written only for accessed word size (upper bits are not set).
Atomic operations are doing read/write at the same time, so we generate
two memory callbacks instead of one, to allow plugins to access distinct
values.
For now, we can have access only up to 128 bits, thus split this in two
64 bits words. When QEMU will support wider operations, we'll be able to
reconsider this.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240724194708.1843704-2-pierrick.bouvier@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240916085400.1046925-5-alex.bennee@linaro.org >
2024-09-19 15:58:01 +01:00
Pierrick Bouvier
278035fc81
plugins: fix race condition with scoreboards
...
A deadlock can be created if a new vcpu (a) triggers a scoreboard
reallocation, and another vcpu (b) wants to create a new scoreboard at
the same time.
In this case, (a) holds the plugin lock, and starts an exclusive
section, waiting for (b). But at the same time, (b) is waiting for
plugin lock.
The solution is to drop the lock before entering the exclusive section.
This bug can be easily reproduced by creating a callback for any tb
exec, that allocates a new scoreboard. In this case, as soon as we reach
more than 16 vcpus, the deadlock occurs.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2344
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240812220748.95167-2-pierrick.bouvier@linaro.org >
[AJB: tweak var position to meet coding style]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240813202329.1237572-22-alex.bennee@linaro.org >
2024-08-16 14:13:07 +01:00
Philippe Mathieu-Daudé
0f3974b64c
accel/tcg: Move qemu_plugin_vcpu_init__async() to plugins/
...
Calling qemu_plugin_vcpu_init__async() on the vCPU thread
is a detail of plugins, not relevant to TCG vCPU management.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240606124010.2460-4-philmd@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240705084047.857176-30-alex.bennee@linaro.org >
2024-07-05 12:34:55 +01:00
Philippe Mathieu-Daudé
2089a2e5bb
plugins: Ensure vCPU index is assigned in init/exit hooks
...
Since vCPUs are hashed by their index, this index can't
be uninitialized (UNASSIGNED_CPU_INDEX).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240606124010.2460-2-philmd@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240705084047.857176-28-alex.bennee@linaro.org >
2024-07-05 12:34:48 +01:00
Pierrick Bouvier
ca7d7f4276
plugins: fix inject_mem_cb rw masking
...
These are not booleans, but masks.
Issue found by Richard Henderson.
Fixes: f86fd4d872 ("plugins: distinct types for callbacks")
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240612195147.93121-3-pierrick.bouvier@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240620152220.2192768-12-alex.bennee@linaro.org >
2024-06-24 10:15:16 +01:00
Alex Bennée
2fa16246dd
plugins: remove special casing for cpu->realized
...
Now the condition variable is initialised early on we don't need to go
through hoops to avoid calling async_run_on_cpu.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-ID: <20240530194250.1801701-5-alex.bennee@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
2024-06-04 10:02:39 +02:00
Pierrick Bouvier
09afe9677e
plugins: remove op from qemu_plugin_inline_cb
...
This field is not needed as the callback type already holds this
information.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240502211522.346467-10-pierrick.bouvier@linaro.org >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240514174253.694591-12-alex.bennee@linaro.org >
2024-05-16 08:55:23 +01:00
Pierrick Bouvier
f86fd4d872
plugins: distinct types for callbacks
...
To prevent errors when writing new types of callbacks or inline
operations, we split callbacks data to distinct types.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240502211522.346467-8-pierrick.bouvier@linaro.org >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240514174253.694591-10-alex.bennee@linaro.org >
2024-05-16 08:55:23 +01:00
Pierrick Bouvier
7de77d3788
plugins: conditional callbacks
...
Extend plugins API to support callback called with a given criteria
(evaluated inline).
Added functions:
- qemu_plugin_register_vcpu_tb_exec_cond_cb
- qemu_plugin_register_vcpu_insn_exec_cond_cb
They expect as parameter a condition, a qemu_plugin_u64_t (op1) and an
immediate (op2). Callback is called if op1 |cond| op2 is true.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240502211522.346467-6-pierrick.bouvier@linaro.org >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
[AJB: fix re-base conflict with tb_is_mem_only()]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240514174253.694591-8-alex.bennee@linaro.org >
2024-05-16 08:55:02 +01:00
Pierrick Bouvier
36a1d8e710
plugins: add new inline op STORE_U64
...
This new operation can store an immediate u64 value to a given
scoreboard.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240502211522.346467-4-pierrick.bouvier@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240514174253.694591-6-alex.bennee@linaro.org >
2024-05-16 08:47:01 +01:00
Pierrick Bouvier
21032784e5
plugins: prepare introduction of new inline ops
...
Until now, only add_u64 was available, and all functions assumed this or
were named uniquely.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240514174253.694591-4-alex.bennee@linaro.org >
2024-05-16 08:47:01 +01:00
Philippe Mathieu-Daudé
80f034c5b2
accel/tcg: Move @plugin_mem_cbs from CPUState to CPUNegativeOffsetState
...
@plugin_mem_cbs is accessed by tcg generated code, move it
to CPUNegativeOffsetState.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240429213050.55177-4-philmd@linaro.org >
2024-05-06 11:24:14 +02:00
Richard Henderson
97c872276d
Merge tag 'accel-sh4-ui-20240503' of https://github.com/philmd/qemu into staging
...
- Fix NULL dereference in NVMM & WHPX init_vcpu()
- Move user emulation headers "exec/user" to "user"
- Fix SH-4 ADDV / SUBV opcodes
- Drop Cocoa compatility on macOS <= 10.12
- Update Anthony PERARD email
# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmY1BE4ACgkQ4+MsLN6t
# wN73jg//dbdHQU+4oM7BgTduDZn1ulKz5DtNEJawRP6vxIcSQ+Co2Yd+gdLOSXNI
# 2BaoiOQ8cyDEHj1Uud3WVB0GsQYvHrqgXcjeHpX6yFFCZNyRvzEXizJPHKCtq+4e
# XQFtfTFftlJdaKCLqyDqVnrVNRacFPm7kinrEQbTSmglAhwnyu3GwsokDAYiJTqp
# g0n6mX/pWVEMDNY1HrDsk2Q/pyIZFmzhtuRyXRvi/bh8/BnmMCpySG+2463dnu1O
# xIGr2w8ldc+mKn2w2k3wYKDnUHz/NhOkE86tL/ZxIgjCzeenZXwXNdzM+cuAmOZX
# L9KIu5io6bTevYVwwHhd5/N6MCqVEhoRmsUQfF0CIkIzxXbyF14M89YHXZo3YJAd
# n2uoJ7i6hF/4Pt6Uqlg09+vEk7onwrobnTPnbKHEKNWHNOMKXpq1CBxxcVz2qe24
# +CTAAOOhHqaTjODPSexzHZDZYxugCy1XSqps9AFF1HqUcmsPCL/PQ75YGTJJO0oF
# 0V1Yvzjhin26AQS9SglIeXnHxYC26Cg2mXnUpVbryWnG888r0XAGpRl+FEuXK7Ln
# /dGuCIWTozypSkG9304IlxlYsOoXhL11NZqINW+W/Tor3dMRQhWUQcHqv98Jl4Ad
# rnpzZ0Dhd9ityZdbI0CCMZZZLY5dw1Rq5q407GTJr1CDU4PJBh0=
# =N8q0
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 03 May 2024 08:35:42 AM PDT
# gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org >" [full]
* tag 'accel-sh4-ui-20240503' of https://github.com/philmd/qemu :
ui/cocoa.m: Drop old macOS-10.12-and-earlier compat ifdefs
target/sh4: Rename TCGv variables as manual for SUBV opcode
target/sh4: Rename TCGv variables as manual for ADDV opcode
target/sh4: Fix SUBV opcode
target/sh4: Fix ADDV opcode
MAINTAINERS: Update my email address
plugins: Update stale comment
plugins/api: Only include 'exec/ram_addr.h' with system emulation
coverity: Update user emulation regexp
user: Move 'thunk.h' from 'exec/user' to 'user'
user: Move 'abitypes.h' from 'exec/user' to 'user'
exec: Include missing license in 'exec/cpu-common.h'
accel/whpx: Fix NULL dereference in whpx_init_vcpu()
accel/nvmm: Fix NULL dereference in nvmm_init_vcpu()
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-05-03 14:42:50 -07:00
Philippe Mathieu-Daudé
e096d370ad
plugins: Update stale comment
...
"plugin_mask" was renamed as "event_mask" in commit c006147122
("plugins: create CPUPluginState and migrate plugin_mask").
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240427155714.53669-3-philmd@linaro.org >
2024-05-03 17:21:20 +02:00
Richard Henderson
ccd8f17e02
plugins: Introduce PLUGIN_CB_MEM_REGULAR
...
Use different enumerators for vcpu_udata and vcpu_mem callbacks.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
b0748975b8
tcg: Remove TCG_CALL_PLUGIN
...
Since we no longer emit plugin helpers during the initial code
translation phase, we don't need to specially mark plugin helpers.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
c7ba94836a
plugins: Create TCGHelperInfo for all out-of-line callbacks
...
TCGHelperInfo includes the ABI for every function call.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
aff56de576
plugins: Move function pointer in qemu_plugin_dyn_cb
...
The out-of-line function pointer is mutually exclusive
with inline expansion, so move it into the union.
Wrap the pointer in a structure named 'regular' to match
PLUGIN_CB_REGULAR.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
25875fe92e
plugins: Zero new qemu_plugin_dyn_cb entries
...
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Pierrick Bouvier
3077be2545
plugins: cleanup codepath for previous inline operation
...
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240304130036.124418-13-pierrick.bouvier@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240305121005.3528075-26-alex.bennee@linaro.org >
2024-03-06 12:35:50 +00:00