Julian Ganz and Alex Bennée
b2d8618c21
target/m68k: call plugin trap callbacks
...
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 Ganz <neither@nut.email >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Message-ID: <20251027110344.2289945-18-alex.bennee@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
2025-10-29 14:12:43 +00:00
Philippe Mathieu-Daudé
cb4ca3b358
target/m68k: Remove pointless @cpu_halted TCGv
...
Avoid registering a TCGv to write the generic CPUState::halted
field. Access it directly via @env in both STOP / HALT opcodes.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250925012454.60602-1-philmd@linaro.org >
2025-10-16 17:07:27 +02:00
Philippe Mathieu-Daudé
eefee97c4c
target/m68k: Remove unused @cpu_exception_index TCGv
...
When moving the @exception_index from each target ArchCPU
to the global CPUState in commit 27103424c4 ("cpu: Move
exception_index field from CPU_COMMON to CPUState"), the
@cpu_exception_index TCGv has been created for m68k target.
For years, no code ever used this register. Simply remove it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250924171308.53036-1-philmd@linaro.org >
2025-10-16 17:07:27 +02:00
Igor Mammedov and Paolo Bonzini
87511341c3
add cpu_test_interrupt()/cpu_set_interrupt() helpers and use them tree wide
...
The helpers form load-acquire/store-release pair and ensure
that appropriate barriers are in place in case checks happen
outside of BQL.
Use them to replace open-coded checkers/setters across the code,
to make sure that barriers are not missed. Helpers also make code a
bit more readable.
Signed-off-by: Igor Mammedov <imammedo@redhat.com >
Reviewed-by: Peter Xu <peterx@redhat.com >
Reviewed-by: Jason J. Herne <jjherne@linux.ibm.com >
Link: https://lore.kernel.org/r/20250821155603.2422553-1-imammedo@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2025-08-29 12:48:14 +02:00
Richard Henderson
981f2beb16
target: Use cpu_pointer_wrap_uint32 for 32-bit targets
...
M68K, MicroBlaze, OpenRISC, RX, TriCore and Xtensa are
all 32-bit targets. AVR is more complicated, but using
a 32-bit wrap preserves current behaviour.
Cc: Michael Rolnik <mrolnik@gmail.com >
Cc: Laurent Vivier <laurent@vivier.eu >
Cc: Stafford Horne <shorne@gmail.com >
Cc: Yoshinori Sato <ysato@users.sourceforge.jp >
Cc: Max Filippov <jcmvbkbc@gmail.com >
Tested-by Bastian Koppelmann <kbastian@mail.uni-paderborn.de > (tricore)
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-05-28 08:08:48 +01:00
Richard Henderson
c37f8978d9
accel/tcg: Move cpu_get_tb_cpu_state to TCGCPUOps
...
Move the global function name to a hook on TCGCPUOps.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-30 12:45:05 -07:00
Richard Henderson
4759aae432
accel/tcg: Return TCGTBCPUState from cpu_get_tb_cpu_state
...
Combine 3 different pointer returns into one structure return.
Include a cflags field in TCGTBCPUState, not filled in by
cpu_get_tb_cpu_state, but used by all callers. This fills
a hole in the structure and is useful in some subroutines.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-30 12:45:05 -07:00
Richard Henderson
a59a876999
accel/tcg: Hoist cpu_get_tb_cpu_state decl to accl/tcg/cpu-ops.h
...
For some targets, simply remove the local definition.
For other targets, move the inline definition out of line.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-30 12:45:05 -07:00
Richard Henderson
9181ab4528
accel/tcg: Introduce TCGCPUOps.cpu_exec_reset
...
Initialize all instances with cpu_reset(), so that there
is no functional change.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-30 12:45:05 -07:00
Philippe Mathieu-Daudé and Richard Henderson
84307cd602
include: Remove 'exec/exec-all.h'
...
"exec/exec-all.h" is now fully empty, let's remove it.
Mechanical change running:
$ sed -i '/exec\/exec-all.h/d' $(git grep -wl exec/exec-all.h)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Message-ID: <20250424202412.91612-14-philmd@linaro.org >
2025-04-30 12:45:05 -07:00
Philippe Mathieu-Daudé
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
Stefan Hajnoczi
019fbfa4bc
Merge tag 'pull-misc-2025-04-24' of https://repo.or.cz/qemu/armbru into staging
...
Miscellaneous patches for 2025-04-24
# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmgJ7dYSHGFybWJydUBy
# ZWRoYXQuY29tAAoJEDhwtADrkYZTiZIP/1PFAg/s3SoiLQwH/ZrjyUkm1kiKnjOH
# CC5Stw6I9tuYnDAhASAdSymofLv0NNydNe5ai6ZZAWRyRYjIcfNigKAGK4Di+Uhe
# nYxT0Yk8hNGwMhl6NnBp4mmCUNCwcbjT9uXdiYQxFYO/qqYR1388xJjeN3c362l3
# AaLrE5bX5sqa6TAkTeRPjeIqxlyGT7jnCrN7I1hMhDvbc3ITF3AMfYFMjnmAQgr+
# mTWGS1QogqqkloODbR1DKD1CAWOlpK+0HibhNF+lz71P0HlwVvy+HPXso505Wf0B
# dMwlSrZ1DnqNVF/y5IhMEMslahKajbjbFVhBjmrGl/8T821etCxxgB20c0vyFRy8
# qTyJGwBZaEo0VWr70unSmq45TRoeQvdHAw/e+GtilR0ci80q2ly4gbObnw7L8le+
# gqZo4IWmrwp2sbPepE57sYKQpEndwbRayf/kcFd0LPPpeINu9ZooXkYX0pOo6Cdg
# vDKMaEB1/fmPhjSlknxkKN9LZdR+nDw8162S1CKsUdWanAOjmP8haN19aoHhIekZ
# q+r2qUq/U827yNy9/qbInmsoFYDz9s6sAOE63jibd5rZZ9Anei6NOSgLzA4CqCR1
# +d0+TXp19gP9mLMFs7/ZclwkXCz47OQYhXYphjI3wM9x+xbdRcI4n+DOH5u5coKx
# AsA6+2n0GF4Y
# =GaoH
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 24 Apr 2025 03:52:54 EDT
# gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg: issuer "armbru@redhat.com "
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com >" [full]
# gpg: aka "Markus Armbruster <armbru@pond.sub.org >" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653
* tag 'pull-misc-2025-04-24' of https://repo.or.cz/qemu/armbru :
cleanup: Drop pointless label at end of function
cleanup: Drop pointless return at end of function
cleanup: Re-run return_directly.cocci
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com >
2025-04-24 13:44:57 -04:00
Markus Armbruster
8a2b516ba2
cleanup: Drop pointless return at end of function
...
A few functions now end with a label. The next commit will clean them
up.
Signed-off-by: Markus Armbruster <armbru@redhat.com >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-ID: <20250407082643.2310002-3-armbru@redhat.com >
[Straightforward conflict with commit 988ad4cceb (hw/loongarch/virt:
Fix cpuslot::cpu set at last in virt_cpu_plug()) resolved]
2025-04-24 09:33:42 +02:00
Philippe Mathieu-Daudé and Richard Henderson
a3d40b5eff
tcg: Convert TARGET_SUPPORTS_MTTCG to TCGCPUOps::mttcg_supported field
...
Instead of having a compile-time TARGET_SUPPORTS_MTTCG definition,
have each target set the 'mttcg_supported' field in the TCGCPUOps
structure.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Anton Johansson <anjo@rev.ng >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-ID: <20250405161320.76854-17-philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-23 15:07:32 -07:00
Philippe Mathieu-Daudé and Richard Henderson
8201f1a29c
tcg: Remove the TCG_GUEST_DEFAULT_MO definition globally
...
By directly using TCGCPUOps::guest_default_memory_order,
we don't need the TCG_GUEST_DEFAULT_MO definition anymore.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Anton Johansson <anjo@rev.ng >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-23 15:07:32 -07:00
Philippe Mathieu-Daudé and Richard Henderson
04583ce7e0
tcg: Define guest_default_memory_order in TCGCPUOps
...
Add the TCGCPUOps::guest_default_memory_order field and have
each target initialize it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Anton Johansson <anjo@rev.ng >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-23 15:07:32 -07:00
Philippe Mathieu-Daudé and Richard Henderson
c2ba9fea42
tcg: Always define TCG_GUEST_DEFAULT_MO
...
We only require the TCG_GUEST_DEFAULT_MO for MTTCG-enabled
frontends, otherwise we use a default value of TCG_MO_ALL.
In order to simplify, require the definition for all targets,
defining it for hexagon, m68k, rx, sh4 and tricore.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Anton Johansson <anjo@rev.ng >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-23 15:07:32 -07:00
Philippe Mathieu-Daudé and Richard Henderson
42fa9665e5
exec: Restrict 'cpu_ldst.h' to accel/tcg/
...
Mechanical change using:
$ sed -i -e 's,exec/cpu_ldst,accel/tcg/cpu-ldst,' \
$(git grep -l exec/cpu_ldst.h)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-23 15:07:32 -07:00
Philippe Mathieu-Daudé and Richard Henderson
21d41c566d
tcg: Declare TARGET_INSN_START_EXTRA_WORDS in 'cpu-param.h'
...
To avoid including the huge "cpu.h" for a simple definition,
move TARGET_INSN_START_EXTRA_WORDS to "cpu-param.h".
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-23 15:07:32 -07:00
Pierrick Bouvier and Richard Henderson
0df783b2fb
exec/cpu-all: remove this header
...
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Message-ID: <20250325045915.994760-16-pierrick.bouvier@linaro.org >
2025-04-23 15:04:57 -07:00
Pierrick Bouvier and Richard Henderson
d97c3b06de
exec/cpu-all: transfer exec/cpu-common include to cpu.h headers
...
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Message-ID: <20250325045915.994760-15-pierrick.bouvier@linaro.org >
2025-04-23 15:04:57 -07:00
Pierrick Bouvier and Richard Henderson
9c2ff9cdc9
exec/cpu-all: remove exec/target_page include
...
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-04-23 15:04:57 -07:00
Pierrick Bouvier and Richard Henderson
22a7c2f239
exec/cpu-all: remove exec/cpu-interrupt include
...
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Message-ID: <20250325045915.994760-8-pierrick.bouvier@linaro.org >
2025-04-23 15:04:57 -07:00
Pierrick Bouvier and Richard Henderson
342e313d6c
exec/cpu-all: remove system/memory include
...
We include this header where needed. When includes set already have
ifdef CONFIG_USER_ONLY, we add it here, else, we don't condition the
include.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Message-ID: <20250325045915.994760-5-pierrick.bouvier@linaro.org >
2025-04-23 15:04:57 -07:00
Philippe Mathieu-Daudé and Richard Henderson
cc944932ec
target/m68k: Restrict SoftMMU mmu_index() to TCG
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Message-ID: <20250401080938.32278-12-philmd@linaro.org >
2025-04-23 15:04:57 -07:00