Philippe Mathieu-Daudé
7724ca9a77
accel/hvf: Display executable bit as 'X'
...
Developers are accustomed to read RWX, not RWE.
Replace E -> X.
Reported-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Mads Ynddal <mads@ynddal.dk >
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com >
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2025-07-21 13:38:33 +01:00
Stefan Hajnoczi
f96b157ebb
Merge tag 'accel-20250715' of https://github.com/philmd/qemu into staging
...
Accelerators patches
- Unify x86/arm hw/xen/arch_hvm.h header
- Move non-system-specific 'accel/accel-ops.h' and 'accel-cpu-ops.h' to accel/
- Move KVM definitions qapi/accelerator.json
- Add @qom-type field to CpuInfoFast QAPI structure
- Display CPU model name in 'info cpus' HMP command
- Introduce @x-accel-stats QMP command
- Add 'info accel' on HMP
- Improve qemu_add_vm_change_state_handler*() docstring
- Extract TCG statistic related code to tcg-stats.c
- Implement AccelClass::get_[vcpu]_stats() handlers for TCG and HVF
- Do not dump NaN in TCG statistics
- Revert incomplete "accel/tcg: Unregister the RCU before exiting RR thread"
# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmh2r4UACgkQ4+MsLN6t
# wN5i6xAAkOvwFh1GmsPUdz5RxzsWoIUDvyENg6E8Axwe5tSEMRFiPjabbTQJomQg
# GZt75XIS24LZFZ+hvqrLSA+dFgXTgWv08ZE81EjwjmAMBlLCOPhCgeN6C1p8100Y
# scSvRJbP9k9lpA5K7et/1X4AkK2cZyh+LGJgCjr2Al2mbERpPueDF8fxqeohFvXQ
# nTSks4XlA0yQ06+9r49aQAiuXvgg9lDT1wIglD2HEV7vOVs/ud+yyL8+z5YMeFzx
# pSIc6wDu4PqdA46w4MZs90uTy7S/PMvBiYDEiV3tKzg0MLttvFGlT58/YjVtguTP
# mNkfwIEwQtDQzoxsFIJO7yBTlTRBs95V4aIVk3pB+Gb/bideRPIkeVQvgMSEBKj7
# N0pEXWOxfB9iIWO6b1utYpQ4uxeDOU/8DPUCit1IBbNgKTaJkJb77fboYk7NaB0K
# KEtObAk6jMatB/xr+vUFWc4sMk9wlm72w8wcQzgKZ0xV2U3d1/Y/9nS4GvI510ev
# TRQ3mKj7N319uCeId1czF6W8rillCJ2u8ZK53u+Nfp7R3PbsRSMc6IDJ1UdDUlyR
# HFcWHxbcbEGhe8SnFGab4Qd6fWChcn2EaEoAJJz+Rqv0k3zcwqccNM5waCABAjTE
# 0S22JIHePJKcpkMLGq3EOUAQuu+8Zsol7gPCLxSAMclVqPTl9ck=
# =rAav
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 15 Jul 2025 15:44:05 EDT
# gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org >" [full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE
* tag 'accel-20250715' of https://github.com/philmd/qemu :
system/runstate: Document qemu_add_vm_change_state_handler_prio* in hdr
system/runstate: Document qemu_add_vm_change_state_handler()
accel/hvf: Implement AccelClass::get_vcpu_stats() handler
accel/tcg: Implement AccelClass::get_stats() handler
accel/tcg: Propagate AccelState to dump_accel_info()
accel/system: Add 'info accel' on human monitor
accel/system: Introduce @x-accel-stats QMP command
accel/tcg: Extract statistic related code to tcg-stats.c
Revert "accel/tcg: Unregister the RCU before exiting RR thread"
accel: Extract AccelClass definition to 'accel/accel-ops.h'
accel: Rename 'system/accel-ops.h' -> 'accel/accel-cpu-ops.h'
accel/tcg: Do not dump NaN statistics
hw/core/machine: Display CPU model name in 'info cpus' command
qapi/machine: Add @qom-type field to CpuInfoFast structure
qapi/accel: Move definitions related to accelerators in their own file
hw/arm/xen-pvh: Remove unnecessary 'hw/xen/arch_hvm.h' header
hw/xen/arch_hvm: Unify x86 and ARM variants
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com >
Conflicts:
qapi/machine.json
Commit 0462da9d6b ("qapi: remove trivial "Returns:" sections")
removed trivial "Returns:". This caused a conflict with the move from
machine.json to accelerator.json.
2025-07-16 07:13:40 -04:00
Philippe Mathieu-Daudé
ec5c2e7f38
accel/hvf: Implement AccelClass::get_vcpu_stats() handler
...
Co-developed-by: Mads Ynddal <mads@ynddal.dk >
Signed-off-by: Mads Ynddal <mads@ynddal.dk >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250715104015.72663-8-philmd@linaro.org >
2025-07-15 21:42:58 +02:00
Philippe Mathieu-Daudé
cf4305ed7a
accel/tcg: Implement AccelClass::get_stats() handler
...
Factor tcg_get_stats() out of tcg_dump_stats(),
passing the current accelerator argument to match
the AccelClass::get_stats() prototype.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250715140048.84942-7-philmd@linaro.org >
2025-07-15 19:34:33 +02:00
Philippe Mathieu-Daudé
2320453031
accel/tcg: Propagate AccelState to dump_accel_info()
...
Declare tcg_dump_stats() in "tcg/tcg.h" so it can be used out of
accel/tcg/, like by {bsd,linux}-user.
Next commit will register the TCG AccelClass::get_stats handler,
which expects a AccelState, so propagate it to dump_accel_info().
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Message-Id: <20250715140048.84942-6-philmd@linaro.org >
2025-07-15 19:34:33 +02:00
Philippe Mathieu-Daudé
c10eb74010
accel/system: Add 'info accel' on human monitor
...
'info accel' dispatches to the AccelOpsClass::get_stats()
and get_vcpu_stats() handlers.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Acked-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Message-Id: <20250715140048.84942-5-philmd@linaro.org >
2025-07-15 19:34:33 +02:00
Philippe Mathieu-Daudé
1861993f1f
accel/system: Introduce @x-accel-stats QMP command
...
Unstable QMP 'x-accel-stats' dispatches to the
AccelOpsClass::get_stats() and get_vcpu_stats() handlers.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Reviewed-by: Markus Armbruster <armbru@redhat.com >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250715140048.84942-4-philmd@linaro.org >
2025-07-15 19:34:33 +02:00
Philippe Mathieu-Daudé
8cc04fd9df
accel/tcg: Extract statistic related code to tcg-stats.c
...
Statistic code is not specific to system emulation (except
cross-page checks) and can be used to analyze user-mode binaries.
Extract statistic related code to its own file: tcg-stats.c,
keeping the original LGPL-2.1-or-later license tag.
Note, this code is not yet reachable by user-mode.
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: <20250715140048.84942-3-philmd@linaro.org >
2025-07-15 19:34:33 +02:00
Philippe Mathieu-Daudé
2d7dc398ab
Revert "accel/tcg: Unregister the RCU before exiting RR thread"
...
This reverts commit bc93332fe460211c2d2f4ff50e1a0e030c7b5159,
which was merged prematurely, re-introducing Coverity CID 1547782
(unreachable code).
Reported-by: Peter Maydell <peter.maydell@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250715104015.72663-2-philmd@linaro.org >
2025-07-15 19:34:33 +02:00
Philippe Mathieu-Daudé
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
Philippe Mathieu-Daudé
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
Philippe Mathieu-Daudé
b2ed4df79e
accel/tcg: Do not dump NaN statistics
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Message-Id: <20250710111303.8917-1-philmd@linaro.org >
2025-07-15 19:34:33 +02:00
Thomas Huth
f180e367fc
accel/kvm: Adjust the note about the minimum required kernel version
...
Since commit 126e7f7803 ("kvm: require KVM_CAP_IOEVENTFD and
KVM_CAP_IOEVENTFD_ANY_LENGTH") we require at least kernel 4.5 to
be able to use KVM. Adjust the upgrade_note accordingly.
While we're at it, remove the text about kvm-kmod and the
SourceForge URL since this is not actively maintained anymore.
Fixes: 126e7f7803 ("kvm: require KVM_CAP_IOEVENTFD and KVM_CAP_IOEVENTFD_ANY_LENGTH")
Signed-off-by: Thomas Huth <thuth@redhat.com >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru >
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru >
2025-07-13 12:08:07 +03:00
Stefan Hajnoczi
84d1639f28
Merge tag 'accel-20250704' of https://github.com/philmd/qemu into staging
...
Accelerators patches
- Generic API consolidation, cleanups (dead code removal, documentation added)
- Remove monitor TCG 'info opcount' and @x-query-opcount
- Have HVF / NVMM / WHPX use generic CPUState::vcpu_dirty field
- Expose nvmm_enabled() and whpx_enabled() to common code
- Report missing com.apple.security.hypervisor entitlement
- Have hmp_info_registers() dump vector registers
# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmhn2RwACgkQ4+MsLN6t
# wN6MEBAAw4CuK+t4TSmI+CctfSHmYzWvvflIM2CRZylgo1byAmF+g3FRBbvdSQUr
# eITVUSrdHpwdDWYQrbyaW1+eBQMbSBANID1a02sITBQPg6KTKoDygBPL2Kp4h/nH
# JlBLTWLYPbjT/Xnv9ZLzaln2AEdLQc+h+7ahfoIxjWGKFG82G+6zY7GZwO1JlwCF
# UaurFHM9atvER5Yb4mmy1nCk3r+NRZf7mir3GFQOpPAELJnE4JC1P9lxaDSuh8bG
# sh+c2ERR7uzyb6hSJVLu+7Ic/4DsTzjZW61JhEarLZmjS7B0MCHd2Wx8mAEKleUh
# BV3Y0w9foVvX4GitdpoO3JPejUV1/eh1VxG2DieV/LS5glgQTGUTlbfRLMmJXHIe
# 6S/gMj3g8KRCsRAoaWeAUj2HMzzWL0tN1hCv9dnx/uwhnYapfMYa9nIIP+opsrG4
# ouxGiLG8YZvkLkqrOLE+qelagByoiMl8JANqYeuzIvOdvcZlI4aVhwrq0f/+xmvT
# QD6FfylEL6v7xnN/WsBEC/lnqMYU+ZJ7eTdCQWWz7hffqqqY5PskfOOKGjpJPbzo
# ljTzk4xU+nieiCCk1o1kRJTMWCYp/hafSsxY93tEL4VPDU2zFBm1nHkds90dQKDS
# Xfefd/K50JUmbv3Dn8gghNLkSvYKpC1xnBbiZP9DiASJXVltctU=
# =jzsW
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 04 Jul 2025 09:37:32 EDT
# gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org >" [full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE
* tag 'accel-20250704' of https://github.com/philmd/qemu : (35 commits)
MAINTAINERS: Add me as reviewer of overall accelerators section
monitor/hmp-cmds-target: add CPU_DUMP_VPU in hmp_info_registers()
accel/system: Convert pre_resume() from AccelOpsClass to AccelClass
accel: Pass AccelState argument to gdbstub_supported_sstep_flags()
accel: Remove unused MachineState argument of AccelClass::setup_post()
accel: Directly pass AccelState argument to AccelClass::has_memory()
accel/kvm: Directly pass KVMState argument to do_kvm_create_vm()
accel/kvm: Prefer local AccelState over global MachineState::accel
accel/tcg: Prefer local AccelState over global current_accel()
accel/hvf: Re-use QOM allocated state
accel: Propagate AccelState to AccelClass::init_machine()
accel: Keep reference to AccelOpsClass in AccelClass
accel: Expose and register generic_handle_interrupt()
accel/dummy: Extract 'dummy-cpus.h' header from 'system/cpus.h'
accel/whpx: Expose whpx_enabled() to common code
accel/nvmm: Expose nvmm_enabled() to common code
accel/system: Document cpu_synchronize_state_post_init/reset()
accel/system: Document cpu_synchronize_state()
accel/kvm: Remove kvm_cpu_synchronize_state() stub
accel/whpx: Replace @dirty field by generic CPUState::vcpu_dirty field
...
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com >
Conflicts:
accel/accel-system.c
accel/hvf/hvf-all.c
include/qemu/accel.h
pre_resume_vm()-related conflicts.
2025-07-07 09:18:34 -04:00
Philippe Mathieu-Daudé
9a8e6b9ca1
accel/system: Convert pre_resume() from AccelOpsClass to AccelClass
...
Accelerators call pre_resume() once. Since it isn't a method to
call for each vCPU, move it from AccelOpsClass to AccelClass.
Adapt WHPX.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250702185332.43650-21-philmd@linaro.org >
2025-07-04 15:37:07 +02:00
Philippe Mathieu-Daudé
261573c772
accel: Pass AccelState argument to gdbstub_supported_sstep_flags()
...
In order to have AccelClass methods instrospect their state,
we need to pass AccelState by argument.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-37-philmd@linaro.org >
2025-07-04 15:22:04 +02:00
Philippe Mathieu-Daudé
c7212fd2ce
accel: Remove unused MachineState argument of AccelClass::setup_post()
...
This method only accesses xen_domid/xen_domid_restrict, which are both
related to the 'accelerator', not the machine. Besides, xen_domid aims
to be in Xen AccelState and xen_domid_restrict a xen_domid_restrict
QOM property.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-36-philmd@linaro.org >
2025-07-04 15:22:04 +02:00
Philippe Mathieu-Daudé
14784d00ce
accel: Directly pass AccelState argument to AccelClass::has_memory()
...
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-34-philmd@linaro.org >
2025-07-04 15:22:04 +02:00
Philippe Mathieu-Daudé
6b1ce32fee
accel/kvm: Directly pass KVMState argument to do_kvm_create_vm()
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-35-philmd@linaro.org >
2025-07-04 15:22:04 +02:00
Philippe Mathieu-Daudé
4bc5c9ab62
accel/kvm: Prefer local AccelState over global MachineState::accel
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-32-philmd@linaro.org >
2025-07-04 15:22:04 +02:00
Philippe Mathieu-Daudé
7bdeb984cd
accel/tcg: Prefer local AccelState over global current_accel()
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-33-philmd@linaro.org >
2025-07-04 15:22:04 +02:00
Philippe Mathieu-Daudé
d8878e4fca
accel/hvf: Re-use QOM allocated state
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250606164418.98655-8-philmd@linaro.org >
2025-07-04 15:22:04 +02:00
Philippe Mathieu-Daudé
9d01d2e86d
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 >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-31-philmd@linaro.org >
2025-07-04 15:22:02 +02:00
Stefan Hajnoczi
989dd906ed
Merge tag 'accel-20250704' of https://github.com/philmd/qemu into staging
...
Accelerators patches
- Generic API consolidation, cleanups (dead code removal, documentation added)
- Remove monitor TCG 'info opcount' and @x-query-opcount
- Have HVF / NVMM / WHPX use generic CPUState::vcpu_dirty field
- Expose nvmm_enabled() and whpx_enabled() to common code
- Have hmp_info_registers() dump vector registers
# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmhnql4ACgkQ4+MsLN6t
# wN6Lfg//R4h6dyAg02hyopwb/DSI97hAsD9kap15ro1qszYrIOkJcEPoE37HDi6d
# O0Ls+8NPpJcnMwdghHvVaRGoIH2OY5ogXKo6UK1BbOn8iAGxRrT/IPVCyFbPmQoe
# Bk78Z/wne/YgCXiW4HGHSJO5sL04AQqcFYnwjisHHf3Ox8RR85LbhWqthZluta4i
# a/Y8W5UO7jfwhAl1/Zb2cU+Rv75I6xcaLQAfmbt4j+wHP52I2cjLpIYo4sCn+ULJ
# AVX4q4MKrkDrr6CYPXxdGJzYEzVn9evynVcQoRzL6bLZFMpa284AzVd3kQg9NWAb
# p1hvKJTA57q4XDoD50qVGLhP207VVSUcdm0r2ZJA2jag5ddoT+x2talz8/f6In1b
# 7BrSM/pla8x9KvTne/ko0wSL0o2dOWyig8mBxARLZWPxk+LBVs1PBZfvn+3j1pYA
# rWV25Ht4QJlUYMbe3NvEIomsVThKg8Fh3b4mEuyPM+LZ1brgmhrzJG1SF+G4fH8A
# aig/RVqgNHtajSnG4A723k2/QzlvnAiT7E3dKB5FogjTcVzFRaWFKsUb4ORqsCAz
# c/AheCJY4PP3pAnb0ODISSVviXwAXqCLbtZhDGhHNYl3C69EyGPPMiVxCaIxKDxU
# bF7AIYhRTTMyNSbnkcRS3UDO/gZS7x5/K+/YAM9akQEYADIodYM=
# =Vb39
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 04 Jul 2025 06:18:06 EDT
# gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org >" [full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE
* tag 'accel-20250704' of https://github.com/philmd/qemu : (31 commits)
MAINTAINERS: Add me as reviewer of overall accelerators section
monitor/hmp-cmds-target: add CPU_DUMP_VPU in hmp_info_registers()
accel: Pass AccelState argument to gdbstub_supported_sstep_flags()
accel: Remove unused MachineState argument of AccelClass::setup_post()
accel: Directly pass AccelState argument to AccelClass::has_memory()
accel/kvm: Directly pass KVMState argument to do_kvm_create_vm()
accel/kvm: Prefer local AccelState over global MachineState::accel
accel/tcg: Prefer local AccelState over global current_accel()
accel: Propagate AccelState to AccelClass::init_machine()
accel: Keep reference to AccelOpsClass in AccelClass
accel: Expose and register generic_handle_interrupt()
accel/dummy: Extract 'dummy-cpus.h' header from 'system/cpus.h'
accel/whpx: Expose whpx_enabled() to common code
accel/nvmm: Expose nvmm_enabled() to common code
accel/system: Document cpu_synchronize_state_post_init/reset()
accel/system: Document cpu_synchronize_state()
accel/kvm: Remove kvm_cpu_synchronize_state() stub
accel/whpx: Replace @dirty field by generic CPUState::vcpu_dirty field
accel/nvmm: Replace @dirty field by generic CPUState::vcpu_dirty field
accel/hvf: Replace @dirty field by generic CPUState::vcpu_dirty field
...
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com >
2025-07-04 08:58:49 -04:00
Philippe Mathieu-Daudé
487b25c9d9
accel: Keep reference to AccelOpsClass in AccelClass
...
Allow dereferencing AccelOpsClass outside of accel/accel-system.c.
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 >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-30-philmd@linaro.org >
2025-07-04 14:43:46 +02:00
Philippe Mathieu-Daudé
b64bb17d14
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 >
Reviewed-by: Mads Ynddal <mads@ynddal.dk >
Message-Id: <20250703173248.44995-29-philmd@linaro.org >
2025-07-04 14:43:46 +02:00
Philippe Mathieu-Daudé
20a0181600
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 >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-27-philmd@linaro.org >
2025-07-04 14:43:46 +02:00
Philippe Mathieu-Daudé
a9c2afd74b
accel/whpx: Expose whpx_enabled() to common code
...
Currently whpx_enabled() is restricted to target-specific code.
By defining CONFIG_WHPX_IS_POSSIBLE we allow its use anywhere.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250703173248.44995-26-philmd@linaro.org >
2025-07-04 14:43:46 +02:00
Philippe Mathieu-Daudé
80a1efdedd
accel/nvmm: Expose nvmm_enabled() to common code
...
Currently nvmm_enabled() is restricted to target-specific code.
By defining CONFIG_NVMM_IS_POSSIBLE we allow its use anywhere.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-25-philmd@linaro.org >
2025-07-04 14:43:46 +02:00
Philippe Mathieu-Daudé
888a6be775
accel/kvm: Remove kvm_cpu_synchronize_state() stub
...
Since commit 57038a92bb ("cpus: extract out kvm-specific code
to accel/kvm") the kvm_cpu_synchronize_state() stub is not
necessary.
Fixes: e0715f6abc ("kvm: remove kvm specific functions from global includes")
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 >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-22-philmd@linaro.org >
2025-07-04 14:43:46 +02:00
Philippe Mathieu-Daudé
6f13a0ada0
accel/hvf: Replace @dirty field by generic CPUState::vcpu_dirty field
...
No need for accel-specific @dirty field when we have
a generic one in CPUState.
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 >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Reviewed-by: Mads Ynddal <mads@ynddal.dk >
Message-Id: <20250703173248.44995-19-philmd@linaro.org >
2025-07-04 14:43:46 +02:00
Philippe Mathieu-Daudé
5f3bfbd8e2
accel/hvf: Report missing com.apple.security.hypervisor entitlement
...
We need the QEMU binary signed to be able to use HVF.
Improve the following:
$ ./qemu-system-aarch64-unsigned -M virt -accel hvf
qemu-system-aarch64-unsigned: -accel hvf: Error: ret = HV_DENIED (0xfae94007, at ../../accel/hvf/hvf-accel-ops.c:339)
Abort trap: 6
to:
$ ./qemu-system-aarch64-unsigned -M virt -accel hvf
qemu-system-aarch64-unsigned: -accel hvf: Could not access HVF. Is the executable signed with com.apple.security.hypervisor entitlement?
Suggested-by: Shatyuka <shatyuka@qq.com >
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2800
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Acked-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Reviewed-by: Mads Ynddal <mads@ynddal.dk >
Message-Id: <20250702185332.43650-29-philmd@linaro.org >
2025-07-04 14:43:45 +02:00
Philippe Mathieu-Daudé
81490432b6
accel/hvf: Move generic method declarations to hvf-all.c
...
hvf-all.c aims to contain the generic accel methods (TYPE_ACCEL),
while hvf-accel-ops.c the per-vcpu methods (TYPE_ACCEL_OPS).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-17-philmd@linaro.org >
2025-07-04 14:43:45 +02:00
Philippe Mathieu-Daudé
3240b69f68
accel/hvf: Move per-cpu method declarations to hvf-accel-ops.c
...
hvf-all.c aims to contain the generic accel methods (TYPE_ACCEL),
while hvf-accel-ops.c the per-vcpu methods (TYPE_ACCEL_OPS).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-16-philmd@linaro.org >
2025-07-04 14:43:45 +02:00
Philippe Mathieu-Daudé
dd0b228552
accel/tcg: Unregister the RCU before exiting RR thread
...
Although unreachable, still unregister the RCU before exiting
the thread, as documented in "qemu/rcu.h":
/*
* Important !
*
* Each thread containing read-side critical sections must be registered
* with rcu_register_thread() before calling rcu_read_lock().
* rcu_unregister_thread() should be called before the thread exits.
*/
Unregister the RCU to be on par with what is done for other
accelerators.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Acked-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250702185332.43650-66-philmd@linaro.org >
2025-07-04 14:43:45 +02:00
Philippe Mathieu-Daudé
6bb8f2c51b
accel/tcg: Clear exit_request once in tcg_cpu_exec()
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250701144017.43487-62-philmd@linaro.org >
2025-07-04 14:43:45 +02:00
Philippe Mathieu-Daudé
3955a104bc
accel/tcg: Factor tcg_dump_stats() out for re-use
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-11-philmd@linaro.org >
2025-07-04 14:43:45 +02:00
Philippe Mathieu-Daudé
8becf10374
accel/tcg: Factor tcg_dump_flush_info() out
...
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 >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-10-philmd@linaro.org >
2025-07-04 14:43:45 +02:00
Philippe Mathieu-Daudé
93d7064e59
accel/tcg: Remove profiler leftover
...
TCG profiler was removed in commit 1b65b4f54c .
Fixes: 1b65b4f54c ("accel/tcg: remove CONFIG_PROFILER")
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 >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-9-philmd@linaro.org >
2025-07-04 14:43:45 +02:00
Philippe Mathieu-Daudé
7359f69009
accel/tcg: Remove 'info opcount' and @x-query-opcount
...
Since commit 1b65b4f54c ("accel/tcg: remove CONFIG_PROFILER",
released with QEMU v8.1.0) we get pointless output:
(qemu) info opcount
[TCG profiler not compiled]
Remove that unstable and unuseful command.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Acked-by: Dr. David Alan Gilbert <dave@treblig.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com >
Reviewed-by: Markus Armbruster <armbru@redhat.com >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-8-philmd@linaro.org >
2025-07-04 14:43:45 +02:00
Philippe Mathieu-Daudé
af065855ce
accel/kvm: Reduce kvm_create_vcpu() declaration scope
...
kvm_create_vcpu() is only used within the same file unit.
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 >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-7-philmd@linaro.org >
2025-07-04 14:43:45 +02:00
Philippe Mathieu-Daudé
597ae563ba
accel/kvm: Remove kvm_init_cpu_signals() stub
...
Since commit 57038a92bb ("cpus: extract out kvm-specific code
to accel/kvm") the kvm_init_cpu_signals() stub is not necessary.
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 >
Reviewed-by: Zhao Liu <zhao1.liu@intel.com >
Message-Id: <20250703173248.44995-6-philmd@linaro.org >
2025-07-04 14:43:42 +02:00
Philippe Mathieu-Daudé
842e7eecd4
accel: Pass AccelState argument to gdbstub_supported_sstep_flags()
...
In order to have AccelClass methods instrospect their state,
we need to pass AccelState by argument.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250703173248.44995-37-philmd@linaro.org >
2025-07-04 12:08:44 +02:00
Philippe Mathieu-Daudé
1e9fb43d30
accel: Remove unused MachineState argument of AccelClass::setup_post()
...
This method only accesses xen_domid/xen_domid_restrict, which are both
related to the 'accelerator', not the machine. Besides, xen_domid aims
to be in Xen AccelState and xen_domid_restrict a xen_domid_restrict
QOM property.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250703173248.44995-36-philmd@linaro.org >
2025-07-04 12:08:44 +02:00
Philippe Mathieu-Daudé
8dd5e6befc
accel: Directly pass AccelState argument to AccelClass::has_memory()
...
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Message-Id: <20250703173248.44995-34-philmd@linaro.org >
2025-07-04 12:08:44 +02:00
Philippe Mathieu-Daudé
583d1c8f16
accel/kvm: Directly pass KVMState argument to do_kvm_create_vm()
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250703173248.44995-35-philmd@linaro.org >
2025-07-04 12:08:44 +02:00
Philippe Mathieu-Daudé
f0db25adcf
accel/kvm: Prefer local AccelState over global MachineState::accel
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250703173248.44995-32-philmd@linaro.org >
2025-07-04 12:08:44 +02:00
Philippe Mathieu-Daudé
0fdcfc3baf
accel/tcg: Prefer local AccelState over global current_accel()
...
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Message-Id: <20250703173248.44995-33-philmd@linaro.org >
2025-07-04 12:08:44 +02:00
Philippe Mathieu-Daudé
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
Philippe Mathieu-Daudé
38623a9f63
accel: Keep reference to AccelOpsClass in AccelClass
...
Allow dereferencing AccelOpsClass outside of accel/accel-system.c.
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-30-philmd@linaro.org >
2025-07-04 12:08:44 +02:00