Bastian Koppelmann
82736612e7
target/tricore: Fix helper_ret() not correctly restoring PSW
...
We are always taking the TRICORE_FEATURE_13 branch as every CPU has TRICORE_FEATURE_13.
For CPUs with ISA > 1.3 we have to take the else branch.
We fix this by inverting the condition. We check for
TRICORE_FEATURE_131, which every CPU except TRICORE_FEATURE_13 CPUs
have.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1700
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230612113245.56667-5-kbastian@mail.uni-paderborn.de >
2023-06-21 18:09:54 +02:00
Bastian Koppelmann
6991777ec4
target/tricore: Add CHECK_REG_PAIR() for insn accessing 64 bit regs
...
some insns were not checking if an even index was used to access a 64
bit register. In the worst case that could lead to a buffer overflow as
reported in https://gitlab.com/qemu-project/qemu/-/issues/1698 .
Reported-by: Siqi Chen <coc.cyqh@gmail.com >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230612113245.56667-4-kbastian@mail.uni-paderborn.de >
2023-06-21 18:09:54 +02:00
Bastian Koppelmann
5434557ffc
target/tricore: Correctly fix saving PSW.CDE to CSA on call
...
we don't want to save PSW.CDC to the CSA, but PSW.CDE must be saved.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1699
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230612113245.56667-3-kbastian@mail.uni-paderborn.de >
2023-06-21 18:09:54 +02:00
Siqi Chen
d34b092cab
target/tricore: Fix out-of-bounds index in imask instruction
...
When translating "imask" instruction of Tricore architecture, QEMU did not check whether the register index was out of bounds, resulting in a global-buffer-overflow.
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1698
Reported-by: Siqi Chen <coc.cyqh@gmail.com >
Signed-off-by: Siqi Chen <coc.cyqh@gmail.com >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230612065633.149152-1-coc.cyqh@gmail.com >
Message-Id: <20230612113245.56667-2-kbastian@mail.uni-paderborn.de >
2023-06-21 18:09:54 +02:00
Bastian Koppelmann
0b9f9b63c2
target/tricore: Add DISABLE insn variant
...
this variant saves the 'IE' bit to a 'd' register. The 'IE' bitfield
changed from ISA version 1.6.1, so we add icr_ie_offset to DisasContext
as with the other DISABLE insn.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230614100039.1337971-9-kbastian@mail.uni-paderborn.de >
2023-06-21 18:09:54 +02:00
Bastian Koppelmann
3b5d136db6
target/tricore: Implement SYCSCALL insn
...
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1452
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230614100039.1337971-8-kbastian@mail.uni-paderborn.de >
2023-06-21 18:09:54 +02:00
Bastian Koppelmann
4e3377bb5a
target/tricore: Add shuffle insn
...
this is based on code by volumit (https://github.com/volumit/qemu/ ).
Reported in https://gitlab.com/qemu-project/qemu/-/issues/1667
and https://gitlab.com/qemu-project/qemu/-/issues/1452 .
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230614100039.1337971-7-kbastian@mail.uni-paderborn.de >
2023-06-21 18:09:48 +02:00
Bastian Koppelmann
0eaafe33d0
target/tricore: Add crc32.b insn
...
reported in https://gitlab.com/qemu-project/qemu/-/issues/1667
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230614100039.1337971-6-kbastian@mail.uni-paderborn.de >
2023-06-21 17:56:45 +02:00
Bastian Koppelmann
dc0b4368be
target/tricore: Add crc32l.w insn
...
reported in https://gitlab.com/qemu-project/qemu/-/issues/1667
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230614100039.1337971-5-kbastian@mail.uni-paderborn.de >
2023-06-21 17:56:45 +02:00
Bastian Koppelmann
73f874d9fe
target/tricore: Add LHA insn
...
reported in https://gitlab.com/qemu-project/qemu/-/issues/1667
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230614100039.1337971-4-kbastian@mail.uni-paderborn.de >
2023-06-21 17:56:45 +02:00
Bastian Koppelmann
fd6f446a5e
target/tricore: Add popcnt.w insn
...
reported in https://gitlab.com/qemu-project/qemu/-/issues/1667
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230614100039.1337971-3-kbastian@mail.uni-paderborn.de >
2023-06-21 17:56:45 +02:00
Bastian Koppelmann
4d2b2e766a
target/tricore: Introduce ISA 1.6.2 feature
...
we also introduce the tc37x CPU that implements that ISA version.
Acked-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230614100039.1337971-2-kbastian@mail.uni-paderborn.de >
2023-06-21 17:56:45 +02:00
Philippe Mathieu-Daudé
de6cd7599b
meson: Replace softmmu_ss -> system_ss
...
We use the user_ss[] array to hold the user emulation sources,
and the softmmu_ss[] array to hold the system emulation ones.
Hold the latter in the 'system_ss[]' array for parity with user
emulation.
Mechanical change doing:
$ sed -i -e s/softmmu_ss/system_ss/g $(git grep -l softmmu_ss)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20230613133347.82210-10-philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-06-20 10:01:30 +02:00
Philippe Mathieu-Daudé
66352d7ef2
target/tricore: Remove pointless CONFIG_SOFTMMU guard
...
We don't build any user emulation target for Tricore,
only the system emulation. No need to check for it as
it is always defined.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230613133347.82210-3-philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-06-20 10:01:30 +02:00
Bastian Koppelmann
12b95dc432
target/tricore: Fix wrong PSW for call insns
...
we were copying PSW into a local variable, updated PSW.CDE in the local
and never wrote it back. So when we called save_context_upper() we were
using the non-local version of PSW which did not contain the updated
PSW.CDE.
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230526061946.54514-6-kbastian@mail.uni-paderborn.de >
2023-06-07 18:20:48 +02:00
Bastian Koppelmann
343cdf2c9a
target/tricore: Refactor PCXI/ICR register fields
...
starting from ISA version 1.6.1 (previously known as 1.6P/E), some
bitfields in PCXI and ICR have changed. We also refactor these
registers using the register fields API.
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1453
Message-Id: <20230526061946.54514-5-kbastian@mail.uni-paderborn.de >
2023-06-07 18:20:45 +02:00
Richard Henderson
dfd1b81274
accel/tcg: Introduce translator_io_start
...
New wrapper around gen_io_start which takes care of the USE_ICOUNT
check, as well as marking the DisasContext to end the TB.
Remove exec/gen-icount.h.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-06-05 12:04:29 -07:00
Richard Henderson
d53106c997
tcg: Pass TCGHelperInfo to tcg_gen_callN
...
In preparation for compiling tcg/ only once, eliminate
the all_helpers array. Instantiate the info structs for
the generic helpers in accel/tcg/, and the structs for
the target-specific helpers in each translate.c.
Since we don't see all of the info structs at startup,
initialize at first use, using g_once_init_* to make
sure we don't race while doing so.
Reviewed-by: Anton Johansson <anjo@rev.ng >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-06-05 12:04:29 -07:00
Richard Henderson
fafe0021e3
target/*: Add missing includes of tcg/debug-assert.h
...
This had been pulled in from tcg/tcg.h, via exec/cpu_ldst.h,
via exec/exec-all.h, but the include of tcg.h will be removed.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-06-05 12:04:28 -07:00
Richard Henderson
5a48476ec0
target/tricore: Use min/max for saturate
...
Use tcg_constant_i32 for the bounds.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-13 07:03:39 -07:00
Richard Henderson
151293c2fb
target/tricore: Avoid tcg_const_i32
...
All remaining uses are strictly read-only.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-13 06:44:38 -07:00
Richard Henderson
32f948afcf
target/tricore: Drop some temp initialization
...
The temp variables here are always set afterward;
the initialization with a constant was discarded.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-13 06:44:38 -07:00
Richard Henderson
0a47678626
target/tricore: Use setcondi instead of explicit allocation
...
This removes the only use of temp.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-13 06:44:37 -07:00
Richard Henderson
5c48ad758d
target/tricore: Rename t_off10 and use tcg_constant_i32
...
While temp3 could simply be initialized with tcg_constant_i32,
the renaming makes the purpose clearer.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-13 06:44:37 -07:00
Richard Henderson
bf38ca5c9e
target/tricore: Split t_n as constant from temp as variable
...
As required, allocate temp separately.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-13 06:44:37 -07:00
Anton Johansson
c0916c0597
target/tricore: Remove NB_MMU_MODES
define
...
Signed-off-by: Anton Johansson <anjo@rev.ng >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20230306175230.7110-22-anjo@rev.ng >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-13 06:44:37 -07:00
Alex Bennée
4ea5fe997d
gdbstub: move register helpers into standalone include
...
These inline helpers are all used by target specific code so move them
out of the general header so we don't needlessly pollute the rest of
the API with target specific stuff.
Note we have to include cpu.h in semihosting as it was relying on a
side effect before.
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-21-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-21-richard.henderson@linaro.org >
2023-03-07 20:44:08 +00:00
Richard Henderson
08ee498b37
target/tricore: Drop tcg_temp_free
...
Translators are no longer required to free tcg temporaries.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-05 13:44:08 -08:00
Richard Henderson
597f9b2d30
accel/tcg: Pass max_insn to gen_intermediate_code by pointer
...
In preparation for returning the number of insns generated
via the same pointer. Adjust only the prototypes so far.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-01 07:33:27 -10:00
Anton Johansson
25acb5e442
target/tricore: Replace tb_pc()
with tb->pc
...
Signed-off-by: Anton Johansson <anjo@rev.ng >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Message-Id: <20230227135202.9710-14-anjo@rev.ng >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-03-01 07:33:05 -10:00
Philippe Mathieu-Daudé
21917c1661
target/tricore: Remove unused fields from CPUTriCoreState
...
Remove dead code:
- unused fields in CPUTriCoreState
- (unexisting) tricore_def_t structure
- forward declaration of tricore_boot_info structure
(declared in "hw/tricore/tricore.h", used once in
hw/tricore/tricore_testboard.c).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230117184217.83305-1-philmd@linaro.org >
2023-02-27 22:29:01 +01:00
Anton Kochkov
77eb0085c8
target/tricore: Fix OPC1_16_SRO_LD_H translation
...
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Signed-off-by: Eitan Eliahu <eitan_eliahu@hotmail.com >
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/652
Message-Id: <20230112142258.514079-1-anton.kochkov@proton.me >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
2023-02-08 10:00:32 +01:00
Bastian Koppelmann
d8b33554d8
target/tricore: Fix OPC2_32_BO_LD_BU_PREINC
...
we were sign extending the result of the load, while the instruction
clearly states that the result should be unsigned.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230202120432.1268-10-kbastian@mail.uni-paderborn.de >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
2023-02-08 09:59:38 +01:00
Bastian Koppelmann
a4d5d153c4
target/tricore: Fix OPC2_32_RRRR_DEXTR
...
if cpu_gpr_d[r3] == 0 then we were shifting the lower register to the
right by 32 which is undefined behaviour. In this case the TriCore would
do nothing an just return the higher register cpu_reg_d[r1]. We fixed
that by detecting whether cpu_gpr_d[r3] was zero and cleared the lower
register.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230202120432.1268-8-kbastian@mail.uni-paderborn.de >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
2023-02-08 09:59:15 +01:00
Bastian Koppelmann
48bffe7f6b
target/tricore: Fix RRPW_DEXTR
...
if we used const16 == 0 we would crash qemu with the error:
../tcg/tcg-op.c:196: tcg_gen_shri_i32: Assertion `arg2 >= 0 && arg2 < 32' failed
This whole instruction can be handled by 'tcg_gen_extract2_tl' which
takes care of this special case as well.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Message-Id: <20230202120432.1268-6-kbastian@mail.uni-paderborn.de >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
2023-02-08 09:58:24 +01:00
Bastian Koppelmann
1c6b2e4b79
target/tricore: Fix OPC2_32_RCRW_INSERT translation
...
we were mixing up the "c" and "d" registers. We used "d" as a
destination register und "c" as the source. According to the TriCore ISA
manual 1.6 vol 2 it is the other way round.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/653
Message-Id: <20230202120432.1268-4-kbastian@mail.uni-paderborn.de >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
2023-02-08 09:57:42 +01:00
Bastian Koppelmann
65e57fdb25
target/tricore: Fix OPC2_32_RCRW_IMASK translation
...
we were mixing up the "c" and "d" registers. We used "d" as a
destination register und "c" as the source. According to the TriCore ISA
manual 1.6 vol 2 it is the other way round.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/653
Message-Id: <20230202120432.1268-2-kbastian@mail.uni-paderborn.de >
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
2023-02-08 09:57:11 +01:00
Philippe Mathieu-Daudé
883f2c591f
bulk: Rename TARGET_FMT_plx -> HWADDR_FMT_plx
...
The 'hwaddr' type is defined in "exec/hwaddr.h" as:
hwaddr is the type of a physical address
(its size can be different from 'target_ulong').
All definitions use the 'HWADDR_' prefix, except TARGET_FMT_plx:
$ fgrep define include/exec/hwaddr.h
#define HWADDR_H
#define HWADDR_BITS 64
#define HWADDR_MAX UINT64_MAX
#define TARGET_FMT_plx "%016" PRIx64
^^^^^^
#define HWADDR_PRId PRId64
#define HWADDR_PRIi PRIi64
#define HWADDR_PRIo PRIo64
#define HWADDR_PRIu PRIu64
#define HWADDR_PRIx PRIx64
#define HWADDR_PRIX PRIX64
Since hwaddr's size can be *different* from target_ulong, it is
very confusing to read one of its format using the 'TARGET_FMT_'
prefix, normally used for the target_long / target_ulong types:
$ fgrep TARGET_FMT_ include/exec/cpu-defs.h
#define TARGET_FMT_lx "%08x"
#define TARGET_FMT_ld "%d"
#define TARGET_FMT_lu "%u"
#define TARGET_FMT_lx "%016" PRIx64
#define TARGET_FMT_ld "%" PRId64
#define TARGET_FMT_lu "%" PRIu64
Apparently this format was missed during commit a8170e5e97
("Rename target_phys_addr_t to hwaddr"), so complete it by
doing a bulk-rename with:
$ sed -i -e s/TARGET_FMT_plx/HWADDR_FMT_plx/g $(git grep -l TARGET_FMT_plx)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Message-Id: <20230110212947.34557-1-philmd@linaro.org >
[thuth: Fix some warnings from checkpatch.pl along the way]
Signed-off-by: Thomas Huth <thuth@redhat.com >
2023-01-18 11:14:34 +01:00
Richard Henderson
3b1371159c
target/tricore: Fix gdbstub write to address registers
...
Typo had double-writes to data registers.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1363
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2022-12-18 09:39:17 -08:00
Peter Maydell
efcc10682e
target/tricore: Convert to 3-phase reset
...
Convert the tricore CPU class to use 3-phase reset, so it doesn't
need to use device_class_set_parent_reset() any more.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Reviewed-by: Cédric Le Goater <clg@kaod.org >
Reviewed-by: Edgar E. Iglesias <edgar@zeroasic.com >
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com >
Reviewed-by: Greg Kurz <groug@kaod.org >
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Message-id: 20221124115023.2437291-19-peter.maydell@linaro.org
2022-12-16 15:58:16 +00:00
Philippe Mathieu-Daudé
5d756c82c9
target/tricore: Rename csfr.def -> csfr.h.inc
...
We use the .h.inc extension to include C headers. To be consistent
with the rest of the codebase, rename the C headers using the .def
extension.
IDE/tools using our .editorconfig / .gitattributes will leverage
this consistency.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20221025235006.7215-4-philmd@linaro.org >
Signed-off-by: Laurent Vivier <laurent@vivier.eu >
2022-11-05 20:35:45 +01:00
Richard Henderson
3d419a4dd2
accel/tcg: Remove will_exit argument from cpu_restore_state
...
The value passed is always true, and if the target's
synchronize_from_tb hook is non-trivial, not exiting
may be erroneous.
Reviewed-by: Claudio Fontana <cfontana@suse.de >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2022-11-01 08:31:41 +11:00
Richard Henderson
b765e427b0
target/tricore: Convert to tcg_ops restore_state_to_opc
...
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2022-10-26 11:11:28 +10:00
Richard Henderson
fbf59aad17
accel/tcg: Introduce tb_pc and log_pc
...
The availability of tb->pc will shortly be conditional.
Introduce accessor functions to minimize ifdefs.
Pass around a known pc to places like tcg_gen_code,
where the caller must already have the value.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2022-10-04 12:13:12 -07:00
Richard Henderson
e4fdf9df5b
hw/core: Add CPUClass.get_pc
...
Populate this new method for all targets. Always match
the result that would be given by cpu_get_tb_cpu_state,
as we will want these values to correspond in the logs.
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk > (target/sparc)
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
---
Cc: Eduardo Habkost <eduardo@habkost.net > (supporter:Machine core)
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com > (supporter:Machine core)
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org > (reviewer:Machine core)
Cc: Yanan Wang <wangyanan55@huawei.com > (reviewer:Machine core)
Cc: Michael Rolnik <mrolnik@gmail.com > (maintainer:AVR TCG CPUs)
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com > (maintainer:CRIS TCG CPUs)
Cc: Taylor Simpson <tsimpson@quicinc.com > (supporter:Hexagon TCG CPUs)
Cc: Song Gao <gaosong@loongson.cn > (maintainer:LoongArch TCG CPUs)
Cc: Xiaojuan Yang <yangxiaojuan@loongson.cn > (maintainer:LoongArch TCG CPUs)
Cc: Laurent Vivier <laurent@vivier.eu > (maintainer:M68K TCG CPUs)
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com > (reviewer:MIPS TCG CPUs)
Cc: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com > (reviewer:MIPS TCG CPUs)
Cc: Chris Wulff <crwulff@gmail.com > (maintainer:NiosII TCG CPUs)
Cc: Marek Vasut <marex@denx.de > (maintainer:NiosII TCG CPUs)
Cc: Stafford Horne <shorne@gmail.com > (odd fixer:OpenRISC TCG CPUs)
Cc: Yoshinori Sato <ysato@users.sourceforge.jp > (reviewer:RENESAS RX CPUs)
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk > (maintainer:SPARC TCG CPUs)
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de > (maintainer:TriCore TCG CPUs)
Cc: Max Filippov <jcmvbkbc@gmail.com > (maintainer:Xtensa TCG CPUs)
Cc: qemu-arm@nongnu.org (open list:ARM TCG CPUs)
Cc: qemu-ppc@nongnu.org (open list:PowerPC TCG CPUs)
Cc: qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs)
Cc: qemu-s390x@nongnu.org (open list:S390 TCG CPUs)
2022-10-04 12:13:12 -07:00
Richard Henderson
306c872103
accel/tcg: Add pc and host_pc params to gen_intermediate_code
...
Pass these along to translator_loop -- pc may be used instead
of tb->pc, and host_pc is currently unused. Adjust all targets
at one time.
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com >
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2022-09-06 08:04:26 +01:00
Markus Armbruster
4f31b54bfe
Normalize header guard symbol definition
...
We commonly define the header guard symbol without an explicit value.
Normalize the exceptions.
Done with scripts/clean-header-guards.pl.
Signed-off-by: Markus Armbruster <armbru@redhat.com >
Message-Id: <20220506134911.2856099-4-armbru@redhat.com >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
2022-05-11 16:50:26 +02:00
Marc-André Lureau
8905770b27
compiler.h: replace QEMU_NORETURN with G_NORETURN
...
G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in
glib-compat.
Note that this attribute must be placed before the function declaration
(bringing a bit of consistency in qemu codebase usage).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com >
Reviewed-by: Warner Losh <imp@bsdimp.com >
Message-Id: <20220420132624.2439741-20-marcandre.lureau@redhat.com >
2022-04-21 17:03:51 +04:00
Richard Henderson
8eb806a763
exec/translator: Pass the locked filepointer to disas_log hook
...
We have fetched and locked the logfile in translator_loop.
Pass the filepointer down to the disas_log hook so that it
need not be fetched and locked again.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20220417183019.755276-13-richard.henderson@linaro.org >
2022-04-20 10:51:11 -07:00
Marc-André Lureau
0f9668e0c1
Remove qemu-common.h include from most units
...
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com >
Message-Id: <20220323155743.1585078-33-marcandre.lureau@redhat.com >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2022-04-06 14:31:55 +02:00