aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2024-02-27 14:43:28 +0000
committerAlex Bennée <alex.bennee@linaro.org>2024-02-28 09:11:42 +0000
commitc006147122dede4440c027142ce3025f64e199c0 (patch)
treee250bdbb06eca51818dd140bf3a99505b0a90fbd /include/hw
parentc3d0b46645d4b95b1fa24f4911738cb59d26173e (diff)
downloadqemu-c006147122dede4440c027142ce3025f64e199c0.zip
qemu-c006147122dede4440c027142ce3025f64e199c0.tar.gz
qemu-c006147122dede4440c027142ce3025f64e199c0.tar.bz2
plugins: create CPUPluginState and migrate plugin_mask
As we expand the per-vCPU data for plugins we don't want to pollute CPUState. For now this just moves the plugin_mask (renamed to event_mask) as the memory callbacks are accessed directly by TCG generated code. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20240227144335.1196131-23-alex.bennee@linaro.org>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/core/cpu.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 4b65979..af1a295 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -31,7 +31,6 @@
#include "qemu/rcu_queue.h"
#include "qemu/queue.h"
#include "qemu/thread.h"
-#include "qemu/plugin-event.h"
#include "qom/object.h"
typedef int (*WriteCoreDumpFunction)(const void *buf, size_t size,
@@ -434,7 +433,8 @@ struct qemu_work_item;
* @kvm_fd: vCPU file descriptor for KVM.
* @work_mutex: Lock to prevent multiple access to @work_list.
* @work_list: List of pending asynchronous work.
- * @plugin_mask: Plugin event bitmap. Modified only via async work.
+ * @plugin_mem_cbs: active plugin memory callbacks
+ * @plugin_state: per-CPU plugin state
* @ignore_memory_transaction_failures: Cached copy of the MachineState
* flag of the same name: allows the board to suppress calling of the
* CPU do_transaction_failed hook function.
@@ -526,10 +526,13 @@ struct CPUState {
/* Use by accel-block: CPU is executing an ioctl() */
QemuLockCnt in_ioctl_lock;
- DECLARE_BITMAP(plugin_mask, QEMU_PLUGIN_EV_MAX);
-
#ifdef CONFIG_PLUGIN
+ /*
+ * The callback pointer stays in the main CPUState as it is
+ * accessed via TCG (see gen_empty_mem_helper).
+ */
GArray *plugin_mem_cbs;
+ CPUPluginState *plugin_state;
#endif
/* TODO Move common fields from CPUArchState here. */