Julian Ganz and Alex Bennée
3d57ddace1
target/alpha: 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 Alpha targets.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Julian Ganz <neither@nut.email >
Message-ID: <20251027110344.2289945-12-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é
5940712ed0
target/alpha: Replace VMSTATE_UINTTL() -> VMSTATE_UINT64()
...
All these CPUAlphaState fields are of uint64_t type (except
the @fir[] array which uses float64, expanded to the same
type definition). Use the appropriate VMSTATE_UINT64() macro.
There is no functional change (the migration stream is not
modified), because the Alpha targets are only built as 64-bit:
$ git grep TARGET_LONG_BITS configs/targets/alpha*
configs/targets/alpha-linux-user.mak:4:TARGET_LONG_BITS=64
configs/targets/alpha-softmmu.mak:2:TARGET_LONG_BITS=64
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Anton Johansson <anjo@rev.ng >
Message-Id: <20250925005137.59378-1-philmd@linaro.org >
2025-10-16 10:33:34 +02:00
Philippe Mathieu-Daudé
a6a5f0b464
target/alpha: Access CPUState::cpu_index via helper
...
CPUState::cpu_index is a target agnostic field, meant
for common code (i.e. accel/ and system/ folders).
Target specific code should use the CPUClass::get_arch_id()
helper, even if there is a 1:1 mapping.
In preparation of generic changes around CPU indexing,
introduce the whoami helper to access the generic
CPUState::cpu_index field.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Anton Johansson <anjo@rev.ng >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250925010438.59755-1-philmd@linaro.org >
2025-10-16 10:33:33 +02:00
Philippe Mathieu-Daudé
482869ca84
accel/tcg: Name gen_goto_tb()'s TB slot index as @tb_slot_idx
...
tcg_gen_goto_tb() takes an unsigned index to the TB slot (0 or 1).
Declare the argument as unsigned and rename it as @tb_slot_idx
(which is more descriptive than @n) on all targets.
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: <20251010031745.37528-1-philmd@linaro.org >
2025-10-16 10:33:33 +02:00
Richard Henderson
521c9e1b1a
target/alpha: Simplify call_pal implementation
...
Since 288a5fe980 , we don't link translation blocks
directly to palcode entry points. If we load palbr
from env instead of encoding the constant, we avoid
all need for tb_flush().
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
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
Yodel Eldar and Alex Bennée
5a28fa5ba1
target/alpha: Add GDB XML feature file
...
This patch adds the GDB XML feature file that describes Alpha's core
registers.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2569
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Yodel Eldar <yodel.eldar@gmail.com >
Message-ID: <20250630164124.26315-3-yodel.eldar@gmail.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-ID: <20250710104531.3099313-5-alex.bennee@linaro.org >
2025-07-14 11:42:49 +01:00
Richard Henderson
a4027ed7d4
target: Use cpu_pointer_wrap_notreached for strict align targets
...
Alpha, HPPA, and SH4 always use aligned addresses,
and therefore never produce accesses that cross pages.
Cc: Helge Deller <deller@gmx.de >
Cc: Yoshinori Sato <ysato@users.sourceforge.jp >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2025-05-28 08:08:47 +01:00
Philippe Mathieu-Daudé
dd54fc2a6b
target/migration: Inline VMSTATE_CPU()
...
VMSTATE_CPU() is only used in 4 places and doesn't provide
much, directly inline it using VMSTATE_STRUCT().
This removes the last COMPILING_PER_TARGET in "hw/core/cpu.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Acked-by: Peter Xu <peterx@redhat.com >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250429085148.11876-1-philmd@linaro.org >
2025-05-08 14:22:12 +02: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
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
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
4ff1b33edf
tcg: Always define TARGET_INSN_START_EXTRA_WORDS
...
Do not define TARGET_INSN_START_EXTRA_WORDS under the
hood, have each target explicitly define it.
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 >
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