f7a7e7dd21
accel: Extract AccelClass definition to 'accel/accel-ops.h'
...
Only accelerator implementations (and the common accelator
code) need to know about AccelClass internals. Move the
definition out but forward declare AccelState and AccelClass.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250703173248.44995-39-philmd@linaro.org >
2025-07-15 19:34:33 +02:00
05927e9dc9
accel: Rename 'system/accel-ops.h' -> 'accel/accel-cpu-ops.h'
...
Unfortunately "system/accel-ops.h" handlers are not only
system-specific. For example, the cpu_reset_hold() hook
is part of the vCPU creation, after it is realized.
Mechanical rename to drop 'system' using:
$ sed -i -e s_system/accel-ops.h_accel/accel-cpu-ops.h_g \
$(git grep -l system/accel-ops.h)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250703173248.44995-38-philmd@linaro.org >
2025-07-15 19:34:33 +02:00
51e1896199
accel: Propagate AccelState to AccelClass::init_machine()
...
In order to avoid init_machine() to call current_accel(),
pass AccelState along.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20250703173248.44995-31-philmd@linaro.org >
2025-07-04 12:08:44 +02:00
b9b8ce0384
accel: Expose and register generic_handle_interrupt()
...
In order to dispatch over AccelOpsClass::handle_interrupt(),
we need it always defined, not calling a hidden handler under
the hood. Make AccelOpsClass::handle_interrupt() mandatory.
Expose generic_handle_interrupt() prototype and register it
for each accelerator.
Suggested-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com >
Message-Id: <20250703173248.44995-29-philmd@linaro.org >
2025-07-04 12:08:44 +02:00
e8388158e6
accel/dummy: Extract 'dummy-cpus.h' header from 'system/cpus.h'
...
'dummy' helpers are specific to accelerator implementations,
no need to expose them via "system/cpus.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com >
Message-Id: <20250703173248.44995-27-philmd@linaro.org >
2025-07-04 12:08:44 +02:00
12d1a768bd
qom: Have class_init() take a const data argument
...
Mechanical change using gsed, then style manually adapted
to pass checkpatch.pl script.
Suggested-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250424194905.82506-4-philmd@linaro.org >
2025-04-25 17:00:41 +02:00
0f66536a01
accel: Forward-declare AccelOpsClass in 'qemu/typedefs.h'
...
The heavily imported "system/cpus.h" header includes "accel-ops.h"
to get AccelOpsClass type declaration. Reduce headers pressure by
forward declaring it in "qemu/typedefs.h", where we already
declare the AccelCPUState type.
Reduce "system/cpus.h" inclusions by only including
"system/accel-ops.h" when necessary.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250123234415.59850-14-philmd@linaro.org >
2025-03-06 15:46:18 +01:00
32cad1ffb8
include: Rename sysemu/ -> system/
...
Headers in include/sysemu/ are not only related to system
*emulation*, they are also used by virtualization. Rename
as system/ which is clearer.
Files renamed manually then mechanical change using sed tool.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Tested-by: Lei Yang <leiyang@redhat.com >
Message-Id: <20241203172445.28576-1-philmd@linaro.org >
2024-12-20 17:44:56 +01:00
d4d133a34b
qtest: move qtest_{get, set}_virtual_clock to accel/qtest/qtest.c
...
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240530220610.1245424-5-pierrick.bouvier@linaro.org >
Message-Id: <20240620152220.2192768-8-alex.bennee@linaro.org >
2024-06-24 10:14:56 +01:00
e83e386200
qtest: use cpu interface in qtest_clock_warp
...
This generalises the qtest_clock_warp code to use the AccelOps
handlers for updating its own sense of time. This will make the next
patch which moves the warp code closer to pure code motion.
From: Alex Bennée <alex.bennee@linaro.org >
Acked-by: Thomas Huth <thuth@redhat.com >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20240530220610.1245424-3-pierrick.bouvier@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20240620152220.2192768-6-alex.bennee@linaro.org >
2024-06-24 10:14:39 +01:00
c7b64948f8
meson: Replace CONFIG_SOFTMMU -> CONFIG_SYSTEM_ONLY
...
Since we *might* have user emulation with softmmu,
use the clearer 'CONFIG_SYSTEM_ONLY' key to check
for system emulation.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20230613133347.82210-9-philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-06-20 10:01:30 +02:00
c9923550b4
accel/qtest: Support qtest accelerator for Windows
...
Currently signal SIGIPI [=SIGUSR1] is used to kick the dummy CPU
when qtest accelerator is used. However SIGUSR1 is unsupported on
Windows. To support Windows, we add a QemuSemaphore CPUState::sem
to kick the dummy CPU instead for Windows.
Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com >
Signed-off-by: Bin Meng <bin.meng@windriver.com >
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Message-Id: <20221028045736.679903-2-bin.meng@windriver.com >
Signed-off-by: Thomas Huth <thuth@redhat.com >
2022-10-28 11:17:12 +02:00
b57dfb0f30
misc: Remove unnecessary "sysemu/cpu-timers.h" include
...
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Message-Id: <20220207075426.81934-17-f4bug@amsat.org >
2022-03-06 13:15:42 +01:00
c94a7b8892
accel: build qtest modular
...
Allow building accelerators as module.
Start with qtest as first user.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jose R. Ziviani <jziviani@suse.de >
Message-Id: <20210624103836.2382472-28-kraxel@redhat.com >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2021-07-09 18:21:33 +02:00
a05ca2d416
accel: add qtest module annotations
...
Add module annotations for qtest so autoloading works.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com >
Reviewed-by: Jose R. Ziviani <jziviani@suse.de >
Message-Id: <20210624103836.2382472-27-kraxel@redhat.com >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2021-07-09 18:21:33 +02:00
b86f59c715
accel: replace struct CpusAccel with AccelOpsClass
...
This will allow us to centralize the registration of
the cpus.c module accelerator operations (in accel/accel-softmmu.c),
and trigger it automatically using object hierarchy lookup from the
new accel_init_interfaces() initialization step, depending just on
which accelerators are available in the code.
Rename all tcg-cpus.c, kvm-cpus.c, etc to tcg-accel-ops.c,
kvm-accel-ops.c, etc, matching the object type names.
Signed-off-by: Claudio Fontana <cfontana@suse.de >
Message-Id: <20210204163931.7358-18-cfontana@suse.de >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2021-02-05 10:24:15 -10:00
940e43aa30
accel: extend AccelState and AccelClass to user-mode
...
Signed-off-by: Claudio Fontana <cfontana@suse.de >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
[claudio: rebased on Richard's splitwx work]
Signed-off-by: Claudio Fontana <cfontana@suse.de >
Message-Id: <20210204163931.7358-17-cfontana@suse.de >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2021-02-05 10:24:15 -10:00
9ce84a0d17
accel: move qtest CpusAccel functions to a common location
...
Move and rename accel/qtest/qtest-cpus.c files to accel/dummy-cpus.c so
it can be re-used by Xen.
Signed-off-by: Jason Andryuk <jandryuk@gmail.com >
Message-Id: <20201013140511.5681-3-jandryuk@gmail.com >
Reviewed-by: Claudio Fontana <cfontana@suse.de >
Acked-by: Paolo Bonzini <pbonzini@redhat.com >
Signed-off-by: Thomas Huth <thuth@redhat.com >
2020-10-24 07:23:19 +02:00
a6b0882ca7
accel: Remove _WIN32 ifdef from qtest-cpus.c
...
dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition
will never evaluate true. Remove it.
Signed-off-by: Jason Andryuk <jandryuk@gmail.com >
Message-Id: <20201013140511.5681-2-jandryuk@gmail.com >
Acked-by: Paolo Bonzini <pbonzini@redhat.com >
Reviewed-by: Claudio Fontana <cfontana@suse.de >
Reviewed-by: Thomas Huth <thuth@redhat.com >
Signed-off-by: Thomas Huth <thuth@redhat.com >
2020-10-24 07:23:19 +02:00
1583a38988
cpus: extract out qtest-specific code to accel/qtest
...
register a "CpusAccel" interface for qtest as well.
Signed-off-by: Claudio Fontana <cfontana@suse.de >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2020-10-05 16:41:22 +02:00