Philippe Mathieu-Daudé
ef932e21bd
user: Forward declare TaskState type definition
...
Forward declare TaskState in "qemu/typedefs.h" so we can
use it in generic headers like "hw/cpu/core.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240428221450.26460-9-philmd@linaro.org >
2024-05-06 14:13:45 +02:00
Philippe Mathieu-Daudé
80f034c5b2
accel/tcg: Move @plugin_mem_cbs from CPUState to CPUNegativeOffsetState
...
@plugin_mem_cbs is accessed by tcg generated code, move it
to CPUNegativeOffsetState.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240429213050.55177-4-philmd@linaro.org >
2024-05-06 11:24:14 +02:00
Philippe Mathieu-Daudé
fc44d592db
accel/tcg: Restrict cpu_plugin_mem_cbs_enabled() to TCG
...
So far cpu_plugin_mem_cbs_enabled() is only called from
TCG, so reduce it to accel/tcg/.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <5f59c754-44e5-4743-a2dd-87ef8e13eadf@linaro.org >
2024-05-06 11:24:14 +02:00
Philippe Mathieu-Daudé
b3e7bdeb78
accel/tcg: Update CPUNegativeOffsetState::can_do_io field documentation
...
The @can_do_io field got moved from CPUState to
CPUNegativeOffsetState in commit 464dacf609 ("accel/tcg:
Move can_do_io to CPUNegativeOffsetState").
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240428221450.26460-14-philmd@linaro.org >
2024-05-06 11:24:14 +02:00
Philippe Mathieu-Daudé
b254c342cf
accel/tcg: Access tcg_cflags with getter / setter
...
Access the CPUState::tcg_cflags via tcg_cflags_has() and
tcg_cflags_set() helpers.
Mechanical change using the following Coccinelle spatch script:
@@
expression cpu;
expression flags;
@@
- cpu->tcg_cflags & flags
+ tcg_cflags_has(cpu, flags)
@@
expression cpu;
expression flags;
@@
- (tcg_cflags_has(cpu, flags))
+ tcg_cflags_has(cpu, flags)
@@
expression cpu;
expression flags;
@@
- cpu->tcg_cflags |= flags;
+ tcg_cflags_set(cpu, flags);
Then manually moving the declarations, and adding both
tcg_cflags_has() and tcg_cflags_set() definitions.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240427155714.53669-15-philmd@linaro.org >
2024-05-06 11:21:05 +02:00
Philippe Mathieu-Daudé
74781c0888
exec/cpu: Extract page-protection definitions to page-protection.h
...
Extract page-protection definitions from "exec/cpu-all.h"
to "exec/page-protection.h".
The list of files requiring the new header was generated
using:
$ git grep -wE \
'PAGE_(READ|WRITE|EXEC|RWX|VALID|ANON|RESERVED|TARGET_.|PASSTHROUGH)'
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Acked-by: Nicholas Piggin <npiggin@gmail.com >
Acked-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240427155714.53669-3-philmd@linaro.org >
2024-05-06 11:17:15 +02:00
Philippe Mathieu-Daudé
7dd1259b37
exec/cpu: Remove duplicated PAGE_PASSTHROUGH definition
...
Missed in commit 58771921af ("include/exec: Move PAGE_* macros
to common header"), PAGE_PASSTHROUGH ended being defined twice.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240427155714.53669-8-philmd@linaro.org >
2024-05-06 11:17:15 +02:00
Philippe Mathieu-Daudé
a4f06b1a05
exec/cpu: Remove obsolete PAGE_RESERVED definition
...
We stopped using the PAGE_RESERVED definition in commit
50d25c8aec ("accel/tcg: Drop PAGE_RESERVED for CONFIG_BSD").
This completes commit 2e9a5713f0 ("Remove PAGE_RESERVED").
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240427155714.53669-7-philmd@linaro.org >
2024-05-06 11:17:15 +02:00
BALATON Zoltan
86b7c55182
exec/cpu: Rename PAGE_BITS macro to PAGE_RWX
...
This macro can be used to abbreviate PAGE_READ | PAGE_WRITE | PAGE_EXEC
for which PAGE_RWX is a better name and renaming it also shows it is
not related to TARGET_PAGE_BITS.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Message-ID: <20240505121008.44A0D4E602D@zero.eik.bme.hu >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
2024-05-06 11:17:15 +02:00
Philippe Mathieu-Daudé
1072f927f0
exec/cpu: Indent TARGET_PAGE_foo definitions
...
The TARGET_PAGE_foo definitions are defined with multiple
level of #ifdef'ry. Indent it a bit for clarity.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240427155714.53669-6-philmd@linaro.org >
2024-05-06 11:17:14 +02:00
Richard Henderson
97c872276d
Merge tag 'accel-sh4-ui-20240503' of https://github.com/philmd/qemu into staging
...
- Fix NULL dereference in NVMM & WHPX init_vcpu()
- Move user emulation headers "exec/user" to "user"
- Fix SH-4 ADDV / SUBV opcodes
- Drop Cocoa compatility on macOS <= 10.12
- Update Anthony PERARD email
# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmY1BE4ACgkQ4+MsLN6t
# wN73jg//dbdHQU+4oM7BgTduDZn1ulKz5DtNEJawRP6vxIcSQ+Co2Yd+gdLOSXNI
# 2BaoiOQ8cyDEHj1Uud3WVB0GsQYvHrqgXcjeHpX6yFFCZNyRvzEXizJPHKCtq+4e
# XQFtfTFftlJdaKCLqyDqVnrVNRacFPm7kinrEQbTSmglAhwnyu3GwsokDAYiJTqp
# g0n6mX/pWVEMDNY1HrDsk2Q/pyIZFmzhtuRyXRvi/bh8/BnmMCpySG+2463dnu1O
# xIGr2w8ldc+mKn2w2k3wYKDnUHz/NhOkE86tL/ZxIgjCzeenZXwXNdzM+cuAmOZX
# L9KIu5io6bTevYVwwHhd5/N6MCqVEhoRmsUQfF0CIkIzxXbyF14M89YHXZo3YJAd
# n2uoJ7i6hF/4Pt6Uqlg09+vEk7onwrobnTPnbKHEKNWHNOMKXpq1CBxxcVz2qe24
# +CTAAOOhHqaTjODPSexzHZDZYxugCy1XSqps9AFF1HqUcmsPCL/PQ75YGTJJO0oF
# 0V1Yvzjhin26AQS9SglIeXnHxYC26Cg2mXnUpVbryWnG888r0XAGpRl+FEuXK7Ln
# /dGuCIWTozypSkG9304IlxlYsOoXhL11NZqINW+W/Tor3dMRQhWUQcHqv98Jl4Ad
# rnpzZ0Dhd9ityZdbI0CCMZZZLY5dw1Rq5q407GTJr1CDU4PJBh0=
# =N8q0
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 03 May 2024 08:35:42 AM PDT
# gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org >" [full]
* tag 'accel-sh4-ui-20240503' of https://github.com/philmd/qemu :
ui/cocoa.m: Drop old macOS-10.12-and-earlier compat ifdefs
target/sh4: Rename TCGv variables as manual for SUBV opcode
target/sh4: Rename TCGv variables as manual for ADDV opcode
target/sh4: Fix SUBV opcode
target/sh4: Fix ADDV opcode
MAINTAINERS: Update my email address
plugins: Update stale comment
plugins/api: Only include 'exec/ram_addr.h' with system emulation
coverity: Update user emulation regexp
user: Move 'thunk.h' from 'exec/user' to 'user'
user: Move 'abitypes.h' from 'exec/user' to 'user'
exec: Include missing license in 'exec/cpu-common.h'
accel/whpx: Fix NULL dereference in whpx_init_vcpu()
accel/nvmm: Fix NULL dereference in nvmm_init_vcpu()
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-05-03 14:42:50 -07:00
Philippe Mathieu-Daudé
4e11165316
user: Move 'thunk.h' from 'exec/user' to 'user'
...
Keep all user emulation headers under the same user/ directory.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240428221450.26460-2-philmd@linaro.org >
2024-05-03 17:21:20 +02:00
Philippe Mathieu-Daudé
22879b6680
user: Move 'abitypes.h' from 'exec/user' to 'user'
...
Keep all user emulation headers under the same user/ directory.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240503125202.35667-1-philmd@linaro.org >
2024-05-03 17:21:18 +02:00
Philippe Mathieu-Daudé
f184f3856e
exec: Include missing license in 'exec/cpu-common.h'
...
Commit 1ad2134f91 ("Hardware convenience library") extracted
"cpu-common.h" from "cpu-all.h", which uses the LGPL-2.1+ license.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240427155714.53669-5-philmd@linaro.org >
2024-05-03 17:21:13 +02:00
Alexander Monakov
cbe3d52646
util/bufferiszero: Reorganize for early test for acceleration
...
Test for length >= 256 inline, where is is often a constant.
Before calling into the accelerated routine, sample three bytes
from the buffer, which handles most non-zero buffers.
Signed-off-by: Alexander Monakov <amonakov@ispras.ru >
Signed-off-by: Mikhail Romanov <mmromanov@ispras.ru >
Message-Id: <20240206204809.9859-3-amonakov@ispras.ru >
[rth: Use __builtin_constant_p; move the indirect call out of line.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-05-03 08:03:05 -07:00
Richard Henderson
5e379b08bc
plugins: Merge qemu_plugin_tb_insn_get to plugin-gen.c
...
Merge qemu_plugin_insn_alloc and qemu_plugin_tb_insn_get into
plugin_gen_insn_start, since it is used nowhere else.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
b384c734ec
plugins: Replace pr_ops with a proper debug dump flag
...
The DEBUG_PLUGIN_GEN_OPS ifdef is replaced with "-d op_plugin".
The second pr_ops call can be obtained with "-d op".
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
ccd8f17e02
plugins: Introduce PLUGIN_CB_MEM_REGULAR
...
Use different enumerators for vcpu_udata and vcpu_mem callbacks.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
db409c01fd
plugins: Simplify callback queues
...
We have qemu_plugin_dyn_cb.type to differentiate the various
callback types, so we do not need to keep them in separate queues.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
36ab430645
tcg: Remove INDEX_op_plugin_cb_{start,end}
...
These opcodes are no longer used.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
b0748975b8
tcg: Remove TCG_CALL_PLUGIN
...
Since we no longer emit plugin helpers during the initial code
translation phase, we don't need to specially mark plugin helpers.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
5f2a5a5b34
plugins: Remove plugin helpers
...
These placeholder helpers are no longer required.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
8a2927f290
plugins: Use emit_before_op for PLUGIN_GEN_FROM_MEM
...
Introduce a new plugin_mem_cb op to hold the address temp
and meminfo computed by tcg-op-ldst.c. Because this now
has its own opcode, we no longer need PLUGIN_GEN_FROM_MEM.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
ac977170bf
plugins: Use emit_before_op for PLUGIN_GEN_FROM_INSN
...
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
a0948bb78c
plugins: Use emit_before_op for PLUGIN_GEN_AFTER_INSN
...
Introduce a new plugin_cb op and migrate one operation.
By using emit_before_op, we do not need to emit opcodes
early and modify them later -- we can simply emit the
final set of opcodes once.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
c7ba94836a
plugins: Create TCGHelperInfo for all out-of-line callbacks
...
TCGHelperInfo includes the ABI for every function call.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
aff56de576
plugins: Move function pointer in qemu_plugin_dyn_cb
...
The out-of-line function pointer is mutually exclusive
with inline expansion, so move it into the union.
Wrap the pointer in a structure named 'regular' to match
PLUGIN_CB_REGULAR.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
83a0ad2673
tcg: Pass function pointer to tcg_gen_call*
...
For normal helpers, read the function pointer from the
structure earlier. For plugins, this will allow the
function pointer to come from elsewhere.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
ed30e7b1d9
tcg: Make tcg/helper-info.h self-contained
...
Move MAX_CALL_IARGS from tcg.h and include for
the define of TCG_TARGET_REG_BITS.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 16:12:05 -07:00
Richard Henderson
9c6c079bc6
Merge tag 'pull-target-arm-20240430' of https://git.linaro.org/people/pmaydell/qemu-arm into staging
...
target-arm queue:
* hw/core/clock: allow clock_propagate on child clocks
* hvf: arm: Remove unused PL1_WRITE_MASK define
* target/arm: Restrict translation disabled alignment check to VMSA
* docs/system/arm/emulation.rst: Add missing implemented features
* target/arm: Enable FEAT_CSV2_3, FEAT_ETS2, FEAT_Spec_FPACC for 'max'
* tests/avocado: update sunxi kernel from armbian to 6.6.16
* target/arm: Make new CPUs default to 1GHz generic timer
* hw/dmax/xlnx_dpdma: fix handling of address_extension descriptor fields
* hw/char/stm32l4x5_usart: Fix memory corruption by adding correct class_size
* hw/arm/npcm7xx: Store derivative OTP fuse key in little endian
* hw/arm: Add DM163 display to B-L475E-IOT01A board
# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmYxILcZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3pRzD/40UZrhNbS+FEANkXJ7qpUm
# giCKn8hVwteWY4T4LugUK9987lU0HZ7CGfsHoSaWNwa7RBdKUoDRqi/CQ1kCfeDO
# XET42do+6SJhak+4wmzEfYD+K7wnlauun0/dyqCjd2+JP0bln/MIY5r8JCN1GiYS
# YSAAKoZqAfG1bC3HmxELI9min09GPT+tzw0PAyVJipRtfE+ykZXoCytu0GWU5jB+
# VBI6SGmqMPd/c/7JfJV8KP8R0Mn3etA3hbOCx7YDL6cUmbepWtNPV8dLeTwofrpa
# 01uqN83PpbbSYr96QdXXa7Ov105hQH7e8jmr9+7jTpd3f9U7+GwsxxqDR1KDHLgn
# pUGZneoTDTkJugfXM28A0VoVB3eyJYPCLE9QQ/HXpChXc62NOQV5jcECgLiUDujH
# hVbeGEG0KViQlhMUfI3vIfTaIjEALDcNw5bxVUCqg8vdO6UtTXqqWdaS4Xgne8HB
# KeCu5xXngXEZjIgidZkmIC15FD60B19JdQz2WR+6BDCw8Ajm9iPWlj+ftZztuX/S
# cFSUZ05BPbTkBzAHG4GBvjXTdwsxX2acGBNtdETOQAxhkoRcug0Pn+BmrZQLqkm5
# mPKPW9FFxIkkgeK/ZdA4uIEwDZX/LQlnrX129XGt7DVr+yDNKekaVGfLL8x8alT1
# 3v0Ni/nntc6QtZDB88OIzA==
# =vAf/
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 30 Apr 2024 09:47:51 AM PDT
# gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg: issuer "peter.maydell@linaro.org "
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org >" [full]
# gpg: aka "Peter Maydell <pmaydell@gmail.com >" [full]
# gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk >" [full]
# gpg: aka "Peter Maydell <peter@archaic.org.uk >" [unknown]
* tag 'pull-target-arm-20240430' of https://git.linaro.org/people/pmaydell/qemu-arm : (21 commits)
tests/qtest : Add testcase for DM163
hw/arm : Connect DM163 to B-L475E-IOT01A
hw/arm : Create Bl475eMachineState
hw/arm : Pass STM32L4x5 SYSCFG gpios to STM32L4x5 SoC
hw/display : Add device DM163
hw/arm/npcm7xx: Store derivative OTP fuse key in little endian
hw/char/stm32l4x5_usart: Fix memory corruption by adding correct class_size
hw/dmax/xlnx_dpdma: fix handling of address_extension descriptor fields
target/arm: Default to 1GHz cntfrq for 'max' and new CPUs
hw/watchdog/sbsa_gwdt: Make watchdog timer frequency a QOM property
hw/arm/sbsa-ref: Force CPU generic timer to 62.5MHz
target/arm: Refactor default generic timer frequency handling
tests/avocado: update sunxi kernel from armbian to 6.6.16
target/arm: Enable FEAT_Spec_FPACC for -cpu max
target/arm: Implement ID_AA64MMFR3_EL1
target/arm: Enable FEAT_ETS2 for -cpu max
target/arm: Enable FEAT_CSV2_3 for -cpu max
docs/system/arm/emulation.rst: Add missing implemented features
target/arm: Restrict translation disabled alignment check to VMSA
hvf: arm: Remove PL1_WRITE_MASK
...
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2024-04-30 09:58:54 -07:00
Inès Varhol
c771f883f2
hw/display : Add device DM163
...
This device implements the IM120417002 colors shield v1.1 for Arduino
(which relies on the DM163 8x3-channel led driving logic) and features
a simple display of an 8x8 RGB matrix. The columns of the matrix are
driven by the DM163 and the rows are driven externally.
Acked-by: Alistair Francis <alistair.francis@wdc.com >
Signed-off-by: Arnaud Minier <arnaud.minier@telecom-paris.fr >
Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Message-id: 20240424200929.240921-2-ines.varhol@telecom-paris.fr
[PMM: updated to new reset hold method prototype]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2024-04-30 16:02:43 +01:00
Peter Maydell
88c756bc9e
hw/watchdog/sbsa_gwdt: Make watchdog timer frequency a QOM property
...
Currently the sbsa_gdwt watchdog device hardcodes its frequency at
62.5MHz. In real hardware, this watchdog is supposed to be driven
from the system counter, which also drives the CPU generic timers.
Newer CPU types (in particular from Armv8.6) should have a CPU
generic timer frequency of 1GHz, so we can't leave the watchdog
on the old QEMU default of 62.5GHz.
Make the frequency a QOM property so it can be set by the board,
and have our only board that uses this device set that frequency
to the same value it sets the CPU frequency.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Message-id: 20240426122913.3427983-4-peter.maydell@linaro.org
2024-04-30 15:14:15 +01:00
Song Gao
572d45e546
hw/loongarch: fdt adds pch_msi Controller
...
fdt adds pch msi controller, we use 'loongson,pch-msi-1.0'.
See:
https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-msi.c
https://lore.kernel.org/r/20200528152757.1028711-6-jiaxun.yang@flygoat.com
Signed-off-by: Song Gao <gaosong@loongson.cn >
Reviewed-by: Bibo Mao <maobibo@loongson.cn >
Message-Id: <20240426091551.2397867-14-gaosong@loongson.cn >
2024-04-29 10:25:56 +08:00
Song Gao
2904f50a81
hw/loongarch: fdt adds pch_pic Controller
...
fdt adds pch pic controller, we use 'loongson,pch-pic-1.0'
See:
https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-pch-pic.c
https://lore.kernel.org/r/20200528152757.1028711-4-jiaxun.yang@flygoat.com
Signed-off-by: Song Gao <gaosong@loongson.cn >
Reviewed-by: Bibo Mao <maobibo@loongson.cn >
Message-Id: <20240426091551.2397867-13-gaosong@loongson.cn >
2024-04-29 10:25:56 +08:00
Song Gao
975a5afe37
hw/loongarch: fdt adds Extend I/O Interrupt Controller
...
fdt adds Extend I/O Interrupt Controller,
we use 'loongson,ls2k2000-eiointc'.
See:
https://github.com/torvalds/linux/blob/v6.7/drivers/irqchip/irq-loongson-eiointc.c
https://lore.kernel.org/r/764e02d924094580ac0f1d15535f4b98308705c6.1683279769.git.zhoubinbin@loongson.cn
Signed-off-by: Song Gao <gaosong@loongson.cn >
Reviewed-by: Bibo Mao <maobibo@loongson.cn >
Message-Id: <20240426091551.2397867-12-gaosong@loongson.cn >
2024-04-29 10:25:56 +08:00
Song Gao
6042385149
hw/loongarch: Init efi_fdt table
...
The efi_system_table adds a efi_fdt configuration table.
Signed-off-by: Song Gao <gaosong@loongson.cn >
Reviewed-by: Bibo Mao <maobibo@loongson.cn >
Message-Id: <20240426091551.2397867-9-gaosong@loongson.cn >
2024-04-29 10:25:56 +08:00
Song Gao
060685041c
hw/loongarch: Init efi_initrd table
...
The efi_system_table adds a efi_initrd configuration table.
Signed-off-by: Song Gao <gaosong@loongson.cn >
Reviewed-by: Bibo Mao <maobibo@loongson.cn >
Message-Id: <20240426091551.2397867-8-gaosong@loongson.cn >
2024-04-29 10:25:56 +08:00
Song Gao
252b8e6899
hw/loongarch: Init efi_boot_memmap table
...
The efi_system_table adds a efi_boot_memmap configuration table.
Signed-off-by: Song Gao <gaosong@loongson.cn >
Reviewed-by: Bibo Mao <maobibo@loongson.cn >
Message-Id: <20240426091551.2397867-7-gaosong@loongson.cn >
2024-04-29 10:25:56 +08:00
Song Gao
4216baa90d
hw/loongarch: Init efi_system_table
...
Add init_systab and set boot_info->a2
Signed-off-by: Song Gao <gaosong@loongson.cn >
Reviewed-by: Bibo Mao <maobibo@loongson.cn >
Message-Id: <20240426091551.2397867-6-gaosong@loongson.cn >
2024-04-29 10:25:56 +08:00
Song Gao
58ee60d2d2
hw/loongarch: Add init_cmdline
...
Add init_cmline and set boot_info->a0, a1
Signed-off-by: Song Gao <gaosong@loongson.cn >
Reviewed-by: Bibo Mao <maobibo@loongson.cn >
Message-Id: <20240426091551.2397867-5-gaosong@loongson.cn >
2024-04-29 10:25:56 +08:00
Song Gao
d771ca1c10
hw/loongarch: Move boot functions to boot.c
...
Move some boot functions to boot.c and struct
loongarch_boot_info into struct LoongArchMachineState.
Signed-off-by: Song Gao <gaosong@loongson.cn >
Reviewed-by: Bibo Mao <maobibo@loongson.cn >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Message-Id: <20240426091551.2397867-2-gaosong@loongson.cn >
2024-04-29 10:25:56 +08:00
Philippe Mathieu-Daudé
671558d290
plugins: Include missing 'qemu/bitmap.h' header
...
Since commit c006147122 ("plugins: create CPUPluginState and
migrate plugin_mask") "qemu/plugin.h" uses DECLARE_BITMAP(),
which is declared in "qemu/bitmap.h".
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: <20240418192525.97451-19-philmd@linaro.org >
2024-04-26 21:36:19 +02:00
Philippe Mathieu-Daudé
76d07d321f
hw/core: Avoid including the full 'hw/core/cpu.h' in 'tcg-cpu-ops.h'
...
Only include what is required, avoiding the full
CPUState API from the huge "hw/core/cpu.h" header.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240418192525.97451-4-philmd@linaro.org >
2024-04-26 17:03:05 +02:00
Philippe Mathieu-Daudé
aacfd8bbaf
exec: Move CPUTLBEntry helpers to cputlb.c
...
The following CPUTLBEntry helpers are only used in accel/tcg/cputlb.c:
- tlb_index()
- tlb_entry()
- tlb_read_idx()
- tlb_addr_write()
Move them to this file, allowing to remove the huge "cpu.h" header
inclusion from "exec/cpu_ldst.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240418192525.97451-13-philmd@linaro.org >
2024-04-26 17:03:05 +02:00
Philippe Mathieu-Daudé
16aa8eaaac
exec: Restrict inclusion of 'user/guest-base.h'
...
Declare 'have_guest_base' in "user/guest-base.h".
Very few files require this header, so explicitly include
it there instead of "exec/cpu-all.h" which is used in many
source files.
Assert this user-specific header is only included from user
emulation.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20231211212003.21686-23-philmd@linaro.org >
Reviewed-by: Anton Johansson <anjo@rev.ng >
2024-04-26 17:03:05 +02:00
Philippe Mathieu-Daudé
d3cbde7402
exec: Rename 'exec/user/guest-base.h' as 'user/guest-base.h'
...
The include/user/ directory contains the user-emulation
specific headers. Move guest-base.h there too.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Anton Johansson <anjo@rev.ng >
Message-Id: <20240418192525.97451-15-philmd@linaro.org >
2024-04-26 17:03:05 +02:00
Philippe Mathieu-Daudé
1ce871a3e7
exec: Restrict 'cpu_ldst.h' to TCG accelerator
...
"exec/cpu_ldst.h" is specific to TCG, do not allow its
inclusion from other accelerators.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240418192525.97451-6-philmd@linaro.org >
2024-04-26 17:03:05 +02:00
Philippe Mathieu-Daudé
43bc8a6f1a
exec: Restrict TCG specific declarations of 'cputlb.h'
...
Avoid TCG specific declarations being used from non-TCG accelerators.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240418192525.97451-5-philmd@linaro.org >
2024-04-26 17:03:05 +02:00
Philippe Mathieu-Daudé
6ce1c9d085
exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header
...
The CPUBreakpoint and CPUWatchpoint structures are declared
in "hw/core/cpu.h", which contains declarations related to
CPUState and CPUClass. Some source files only require the
BP/WP definitions and don't need to pull in all CPU* API.
In order to simplify, create a new "exec/breakpoint.h" header.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Anton Johansson <anjo@rev.ng >
Message-Id: <20240418192525.97451-3-philmd@linaro.org >
2024-04-26 17:03:05 +02:00
Philippe Mathieu-Daudé
9c1283dd76
exec: Declare MMUAccessType type in 'mmu-access-type.h' header
...
The MMUAccessType enum is declared in "hw/core/cpu.h".
"hw/core/cpu.h" contains declarations related to CPUState
and CPUClass. Some source files only require MMUAccessType
and don't need to pull in all CPU* declarations. In order
to simplify, create a new "exec/mmu-access-type.h" header.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20240418192525.97451-2-philmd@linaro.org >
2024-04-26 17:03:05 +02:00